CVE-2025-60040

6.5 MEDIUM

📋 TL;DR

This stored cross-site scripting (XSS) vulnerability in the wp-mpdf WordPress plugin allows attackers to inject malicious scripts into web pages generated by the plugin. When users view affected pages, the scripts execute in their browsers, potentially stealing session cookies or performing actions on their behalf. All WordPress sites using vulnerable versions of wp-mpdf are affected.

💻 Affected Systems

Products:
  • wp-mpdf WordPress plugin
Versions: All versions up to and including 3.9.1
Operating Systems: Any OS running WordPress
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability affects the PDF generation functionality where user input is not properly sanitized before being included in generated web pages.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could steal administrator session cookies, take over WordPress sites, deface websites, or redirect visitors to malicious sites, potentially leading to complete site compromise and data theft.

🟠

Likely Case

Attackers inject malicious JavaScript that steals user session cookies or credentials when users view affected PDF pages, leading to account compromise and unauthorized access.

🟢

If Mitigated

With proper input validation and output encoding, malicious scripts would be neutralized before reaching users, preventing execution while maintaining PDF functionality.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires the ability to inject malicious input into the PDF generation process, which typically requires some level of access to the WordPress site.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version after 3.9.1

Vendor Advisory: https://patchstack.com/database/wordpress/plugin/wp-mpdf/vulnerability/wordpress-wp-mpdf-plugin-3-9-1-cross-site-scripting-xss-vulnerability?_s_id=cve

Restart Required: No

Instructions:

1. Log into WordPress admin panel. 2. Navigate to Plugins → Installed Plugins. 3. Find wp-mpdf and check for updates. 4. If update available, click 'Update Now'. 5. If no update available, deactivate and remove the plugin until a patched version is released.

🔧 Temporary Workarounds

Disable wp-mpdf plugin

WordPress

Temporarily disable the vulnerable plugin until a patch can be applied

wp plugin deactivate wp-mpdf

Implement WAF rules

all

Configure web application firewall to block XSS payloads targeting PDF generation endpoints

🧯 If You Can't Patch

  • Restrict access to PDF generation functionality to trusted users only
  • Implement Content Security Policy (CSP) headers to restrict script execution

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin panel → Plugins → Installed Plugins for wp-mpdf version. If version is 3.9.1 or earlier, the site is vulnerable.

Check Version:

wp plugin get wp-mpdf --field=version

Verify Fix Applied:

After updating, verify wp-mpdf version is higher than 3.9.1 in WordPress admin panel.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to PDF generation endpoints
  • JavaScript payloads in PDF-related parameters
  • Multiple failed PDF generation attempts

Network Indicators:

  • Malicious script tags in PDF generation requests
  • Suspicious user-agent strings targeting wp-mpdf endpoints

SIEM Query:

source="wordpress.log" AND ("wp-mpdf" OR "/mpdf/") AND ("<script>" OR "javascript:" OR "onerror=" OR "onload=")

🔗 References

📤 Share & Export