Skip to main content

CVE-2024-0957: WooCommerce PDF Invoices XSS Vulnerability

CVE-2024-0957 is a stored XSS vulnerability in WooCommerce PDF Invoices plugin that lets unauthenticated attackers inject malicious scripts via Customer Notes. This article covers technical details, affected versions, and mitigation.

Published:

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-2024-0957 Overview

CVE-2024-0957 is a stored Cross-Site Scripting (XSS) vulnerability in the WebToffee WooCommerce PDF Invoices, Packing Slips, Delivery Notes and Shipping Labels plugin for WordPress. The flaw affects all versions up to and including 4.4.1. It stems from insufficient input sanitization and output escaping on the Customer Notes field. Unauthenticated attackers can inject arbitrary web scripts that execute whenever a user opens an affected invoice for printing. The issue is categorized under [CWE-79] (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Unauthenticated attackers can inject persistent JavaScript that runs in the browser of any store operator who prints an affected invoice, enabling session theft, admin action forgery, and further compromise of the WordPress site.

Affected Products

  • WebToffee WooCommerce PDF Invoices, Packing Slips, Delivery Notes and Shipping Labels plugin for WordPress
  • All plugin versions up to and including 4.4.1
  • WordPress sites running WooCommerce with this plugin installed

Discovery Timeline

  • 2024-03-22 - CVE-2024-0957 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-0957

Vulnerability Analysis

The vulnerability resides in how the plugin handles the Customer Notes field associated with WooCommerce orders. Input supplied through this field is stored in the database without adequate sanitization. When the plugin renders an invoice for printing, the stored value is echoed to the page without proper output escaping. This allows arbitrary HTML and JavaScript to be embedded in the rendered invoice document.

Because the Customer Notes field is exposed on public checkout flows, an unauthenticated attacker can place a WooCommerce order and supply a malicious payload as part of the checkout process. The payload persists in the store backend and triggers when a store operator, typically an administrator or shop manager, opens the invoice for printing.

The attack requires user interaction from a privileged operator opening the invoice, and the scope changes because the script executes in the context of the WordPress admin session.

Root Cause

The root cause is the absence of server-side sanitization on write and missing output escaping on read for the Customer Notes field. The plugin passes the stored order note string directly into the invoice template without applying WordPress functions such as wp_kses_post() or esc_html(). Any HTML tags, including <script> and event-handler attributes, are preserved through storage and rendering.

Attack Vector

An unauthenticated attacker places an order on the target WooCommerce store and submits a JavaScript payload inside the Customer Notes field during checkout. The order is stored normally. When an administrator or shop manager later opens the invoice through the plugin's print-invoice functionality, the browser executes the injected script under the same origin as the WordPress admin panel.

Successful exploitation can lead to session cookie theft, forced administrative actions through CSRF-authenticated requests, redirection to attacker-controlled sites, or drive-by installation of additional malicious plugins. The change log for the plugin repository documents the fix; see the WordPress Plugin Change Log for the corrective changeset. Detailed technical analysis is available in the Wordfence Vulnerability Report.

Detection Methods for CVE-2024-0957

Indicators of Compromise

  • Presence of <script>, onerror=, onload=, or javascript: strings inside the customer_note column of the wp_posts or WooCommerce order tables.
  • Outbound requests from admin browser sessions to unfamiliar domains immediately after an operator opens a customer invoice.
  • New WordPress administrator accounts, altered plugin files, or unexpected option changes shortly after invoice printing activity.
  • Orders placed by unauthenticated shoppers containing unusually long, HTML-encoded, or obfuscated note content.

Detection Strategies

  • Query the WooCommerce order database for customer notes containing HTML tags or JavaScript syntax and review matches.
  • Inspect web server access logs for POST requests to /checkout or ?wc-ajax=checkout that include suspicious payload patterns in the notes parameter.
  • Deploy a Web Application Firewall (WAF) rule to flag order submissions that contain script tags or common XSS vectors in the notes field.
  • Correlate invoice-print URL access by administrative users with subsequent anomalous admin activity in WordPress audit logs.

Monitoring Recommendations

  • Enable WordPress activity logging to capture administrator sessions, plugin changes, and user creation events.
  • Monitor browser Content Security Policy (CSP) violation reports for inline script execution on invoice pages.
  • Track the installed version of the print-invoices-packing-slip-labels-for-woocommerce plugin across all WordPress instances and alert on versions at or below 4.4.1.
  • Review outbound network telemetry from workstations that access the WordPress admin panel for connections to newly registered domains.

How to Mitigate CVE-2024-0957

Immediate Actions Required

  • Upgrade the WebToffee WooCommerce PDF Invoices, Packing Slips, Delivery Notes and Shipping Labels plugin to a version later than 4.4.1.
  • Audit existing order records for customer notes containing HTML or JavaScript and sanitize or remove malicious content.
  • Rotate WordPress administrator and shop manager passwords, and invalidate active sessions if invoice printing occurred on suspicious orders.
  • Review installed plugins, themes, and administrator accounts for unauthorized additions or modifications.

Patch Information

The vendor released a corrective changeset in the plugin repository that adds sanitization and output escaping for the Customer Notes field. Update the plugin through the WordPress admin dashboard or reinstall the latest release from the WordPress plugin directory. Review the fix in the WordPress Plugin Change Log.

Workarounds

  • Temporarily disable the plugin if immediate patching is not feasible and invoice generation is not business-critical.
  • Deploy a WAF rule that strips or blocks HTML tags in the WooCommerce checkout order_comments parameter.
  • Restrict access to the invoice-print endpoint to a small set of trusted administrator IP addresses.
  • Apply a strict Content Security Policy on WordPress admin pages to block inline script execution on rendered invoices.
bash
# Example WP-CLI commands to check plugin version and update
wp plugin get print-invoices-packing-slip-labels-for-woocommerce --field=version
wp plugin update print-invoices-packing-slip-labels-for-woocommerce

# Search order notes for suspicious script content
wp db query "SELECT ID, post_date FROM wp_posts WHERE post_type='shop_order' AND post_excerpt REGEXP '<script|onerror=|onload=|javascript:';"

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.