WP All Import <= 4.0.0 - Reflected Cross-Site Scripting via 'filepath'
Description
The WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the ‘filepath’ parameter in all versions up to, and including, 4.0.0 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that execute if they can successfully trick a user into performing an action such as clicking on a link.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v4.0.1
Source Code
WordPress.org SVN# Research Plan: CVE-2026-2830 - Reflected XSS via 'filepath' ## 1. Vulnerability Summary The **WP All Import** plugin (v4.0.0 and below) is vulnerable to **Reflected Cross-Site Scripting (XSS)** via the `filepath` parameter. The vulnerability exists because the plugin captures the `filepath` from …
Show full research plan
Research Plan: CVE-2026-2830 - Reflected XSS via 'filepath'
1. Vulnerability Summary
The WP All Import plugin (v4.0.0 and below) is vulnerable to Reflected Cross-Site Scripting (XSS) via the filepath parameter. The vulnerability exists because the plugin captures the filepath from the URL and reflects it back into the HTML response during the import workflow (specifically when moving between steps or displaying error messages) without proper sanitization or output escaping using functions like esc_attr() or esc_html().
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin.php - Query Parameters:
page:pmxi-admin-import(The primary admin page slug for the plugin)step:2(Step 2 is where the plugin processes the file identified in Step 1)filepath: The XSS payload.
- Authentication: Required (Victim must be an Administrator). The attacker is unauthenticated but must trick the Administrator into clicking a malicious link.
- Preconditions: The plugin must be active. No specific import needs to be in progress, as the plugin will often reflect the parameter even if the file doesn't exist.
3. Code Flow (Inferred)
- Entry Point: The
admin_menuhook (registered inPMXI_Plugin::__construct) registers thepmxi-admin-importpage. - Controller: The request is handled by the
PMXI_Admin_Importcontroller'sindexmethod. - Parameter Capture: The code retrieves
$_GET['filepath']to determine which file to process for Step 2 of the import. - Reflection Sink:
- The controller likely assigns this value to a template variable (e.g.,
$this->data['filepath']). - The view (likely
admin/views/admin/import/step2.phporindex.php) echoes this value inside a hidden input field or a label:<input type="hidden" name="filepath" value="<?php echo $_GET['filepath']; ?>" /> - Alternatively, it may echo it in an error message if the file is not found:
<div class="error"><p>File <?php echo $_GET['filepath']; ?> not found.</p></div>
- The controller likely assigns this value to a template variable (e.g.,
4. Nonce Acquisition Strategy
Reflected XSS in a GET parameter on an admin page typically does not require a nonce to trigger the reflection. Nonces in WordPress are primarily used to protect against state-changing actions (POST requests/AJAX). Since the goal is to execute a script via a URL, the GET request to admin.php with the malicious parameter should trigger the vulnerable view directly.
5. Exploitation Strategy
The goal is to provide a filepath that breaks out of an HTML attribute (like value="") and executes a script.
Step-by-Step Plan:
- Preparation: Ensure an Administrator user is logged in (handled by the test environment).
- Craft Payload:
- Primary Payload (Attribute Breakout):
"><script>alert(document.domain)</script> - SVG Payload (Bypasses simple filters):
"><svg/onload=alert(document.cookie)>
- Primary Payload (Attribute Breakout):
- Execute Request: Use the
http_requesttool to simulate the Administrator clicking the link. - Target URL:
http://localhost:8080/wp-admin/admin.php?page=pmxi-admin-import&step=2&filepath=%22%3E%3Cscript%3Ealert(1)%3C/script%3E
HTTP Request Details:
- Method:
GET - URL:
http://localhost:8080/wp-admin/admin.php?page=pmxi-admin-import&step=2&filepath=%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E - Headers:
Cookie: (The agent's session cookies for the Admin user)
6. Test Data Setup
- Activate Plugin: Ensure
wp-all-importversion 4.0.0 is installed and activated. - No Specific Data: Since this is reflected XSS via a GET parameter that is echoed back regardless of file existence, no specific imports or files need to be pre-created.
7. Expected Results
- The HTTP response will have a
200 OKstatus. - The response body will contain the literal string:
value=""><script>alert(document.domain)</script>"or<div class="error">..."><script>alert(document.domain)</script>...</div>. - This confirms that the input was not sanitized by
sanitize_text_field(which would strip tags) and not escaped byesc_attroresc_html.
8. Verification Steps
- Grep Response: Search the response body for the injected
<script>tag.# Conceptually: grep "<script>alert(document.domain)</script>" response_body.html - Manual Browser Check: Use
browser_navigateto the crafted URL and usewait_untilto check if an alert or a specific DOM change occurred.
9. Alternative Approaches
If step=2 does not reflect the parameter, try other common WP All Import parameters/steps:
admin.php?page=pmxi-admin-import&action=view_resource&filepath=<payload>admin.php?page=pmxi-admin-import&step=1&filepath=<payload>- Check if the reflection occurs inside a JavaScript block. If so, use a payload like:
';alert(1);//
If PR:N implies an unauthenticated endpoint, check for wp_ajax_nopriv_ actions in the source (though the description points to reflected XSS via link-clicking, which is typically admin-targeted).
Summary
The WP All Import plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the 'filepath' parameter in versions up to 4.0.0. This occurs because the plugin reflects the 'filepath' query parameter back into the HTML response during the import workflow (specifically Step 2) without sufficient sanitization or output escaping, allowing arbitrary script execution in a user's browser.
Vulnerable Code
// Inferred from research plan: admin/views/admin/import/step2.php or index.php <input type="hidden" name="filepath" value="<?php echo $_GET['filepath']; ?>" /> --- // Alternatively reflected in error messages when the file is not found: <div class="error"><p>File <?php echo $_GET['filepath']; ?> not found.</p></div>
Security Fix
@@ -25,7 +25,7 @@ */ define('WP_ALL_IMPORT_PREFIX', 'pmxi_'); -define('PMXI_VERSION', '4.0.0'); +define('PMXI_VERSION', '4.0.1'); define('PMXI_EDITION', 'free'); @@ -196,6 +196,10 @@ == Changelog == += 4.0.1 = +* security improvement: fixes CVE-2026-2830 +* maintenance: update packages +
Exploit Outline
To exploit this vulnerability, an attacker must trick an authenticated administrator into clicking a crafted link. The attack targets the WP All Import admin page by supplying a malicious payload in the 'filepath' GET parameter. 1. Target URL: /wp-admin/admin.php?page=pmxi-admin-import&step=2&filepath="><script>alert(document.domain)</script> 2. The payload uses a double quote and angle bracket (">") to break out of the HTML attribute (e.g., value="") where the parameter is reflected. 3. Because the plugin echoes the 'filepath' parameter directly into the page without using functions like esc_attr() or esc_html(), the script tag is rendered as part of the DOM and executed by the browser. 4. No nonce is required to trigger this reflection as it is a GET-based reflected XSS.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.