Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-60040 Overview
CVE-2025-60040 is a stored cross-site scripting (XSS) vulnerability in the wp-mpdf WordPress plugin maintained by fkrauthan. The flaw affects all plugin versions up to and including 3.9.1. An authenticated attacker with low privileges can inject malicious script content that persists in the application and executes in the browser of any user who views the affected page. The weakness is tracked under [CWE-79] (Improper Neutralization of Input During Web Page Generation).
Critical Impact
Successful exploitation allows an authenticated attacker to execute arbitrary JavaScript in a victim's browser session, enabling session theft, account takeover of higher-privileged users, and defacement of WordPress content.
Affected Products
- WordPress plugin wp-mpdf by fkrauthan
- All versions from initial release through 3.9.1
- WordPress installations with the plugin enabled and public-facing content rendering
Discovery Timeline
- 2025-09-26 - CVE CVE-2025-60040 published to NVD
- 2026-10-11 - Last updated in NVD database
Technical Details for CVE-2025-60040
Vulnerability Analysis
The wp-mpdf plugin fails to properly neutralize user-supplied input before rendering it in generated web pages. Attackers with low-privilege authenticated access can submit crafted payloads containing JavaScript into plugin-handled input fields. The payload is stored in the WordPress database and later rendered without adequate output encoding or sanitization.
When another user, including an administrator, loads the affected page, the browser interprets the stored content as executable script. The attack scope changes from the vulnerable component to other components, which is characteristic of stored XSS reaching higher-privilege contexts. User interaction is required for the payload to trigger.
Root Cause
The root cause is missing or insufficient output encoding in the plugin's rendering logic. Input accepted through plugin-controlled fields is persisted without applying WordPress sanitization helpers such as wp_kses(), esc_html(), or esc_attr(). The absence of context-aware escaping allows HTML and JavaScript to be injected into the DOM at render time.
Attack Vector
Exploitation proceeds over the network against any WordPress site running wp-mpdf <= 3.9.1. The attacker authenticates with a low-privilege account, submits a payload into a plugin-managed input, and waits for a victim to view the rendered page. The stored payload then executes under the origin of the WordPress site, granting access to cookies, session tokens, and the WordPress REST API in the victim's authentication context.
Technical details and the proof-of-concept notes are documented in the Patchstack XSS Vulnerability Advisory.
Detection Methods for CVE-2025-60040
Indicators of Compromise
- Database entries managed by wp-mpdf containing HTML tags such as <script>, <iframe>, <svg>, or inline event handlers like onerror= and onload=.
- Unexpected outbound HTTP requests from administrator browsers to attacker-controlled domains shortly after loading plugin-rendered pages.
- Creation of new administrator accounts or unexpected changes to WordPress user roles following access to pages generated by the plugin.
Detection Strategies
- Review all wp-mpdf content and plugin options for stored HTML and JavaScript payloads using database queries against wp_posts, wp_postmeta, and wp_options.
- Inspect web server access logs for POST requests to plugin endpoints originating from low-privileged accounts with payloads containing script syntax or URL-encoded script characters.
- Enable WordPress audit logging to track content modifications made by non-administrator roles that interact with the plugin.
Monitoring Recommendations
- Alert on administrator sessions that trigger outbound requests to previously unseen external domains.
- Monitor WordPress REST API calls executed from administrator sessions immediately after rendering plugin-affected pages.
- Baseline normal plugin content and alert on insertions of HTML markup or JavaScript strings into fields that should contain plain text.
How to Mitigate CVE-2025-60040
Immediate Actions Required
- Disable or uninstall the wp-mpdf plugin until a patched release is available, since all versions through 3.9.1 are affected.
- Rotate credentials and session cookies for all WordPress administrator accounts that may have viewed plugin-rendered pages.
- Audit WordPress user accounts and remove any unexpected administrator or editor roles.
Patch Information
No fixed version is identified in the available advisory data. The vulnerability affects wp-mpdf from initial release through 3.9.1. Monitor the Patchstack advisory and the plugin's distribution page for an updated release.
Workarounds
- Deactivate the plugin in wp-admin and remove it from the wp-content/plugins/ directory on affected hosts.
- Enforce a strict Content Security Policy (CSP) that disallows inline scripts and restricts script sources to trusted origins.
- Restrict plugin-related capabilities so only trusted administrators can submit input processed by wp-mpdf.
- Place the WordPress site behind a web application firewall configured with managed XSS rulesets to block script injection payloads.
# Deactivate and remove the vulnerable plugin via WP-CLI
wp plugin deactivate wp-mpdf
wp plugin uninstall wp-mpdf
# Example Content Security Policy header for Nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'" always;
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

