1. Vulnerability Background
-
What is this vulnerability?
- CVE-2025-13773 is an unauthenticated remote code execution (RCE) vulnerability in the Print Invoice & Delivery Notes for WooCommerce WordPress plugin.
- The root cause is a combination of insecure PDF generation configuration and missing access control / escaping in the plugin.
- Specifically, Dompdf was configured with
isPhpEnabled = true, allowing embedded PHP code inside the generated HTML to execute on the server.
-
Why is it critical/important?
- RCE is one of the highest-impact vulnerabilities for web applications.
- An attacker can execute arbitrary PHP code with the privileges of the web server process.
- This can lead to full site compromise, data exfiltration, credential theft, pivoting to other infrastructure, and persistent backdoors.
-
What systems/versions are affected?
- All versions of Print Invoice & Delivery Notes for WooCommerce up to and including 5.8.0.
- The issue is present wherever the plugin uses Dompdf for PDF rendering and retains the insecure configuration.
2. Technical Details
-
Root cause analysis
- The core issue is insecure Dompdf configuration in
includes/front/wcdn-front-function.php. - Old code:
options->set( 'isPhpEnabled', true );
- With this option set, Dompdf evaluates PHP code found in HTML content during PDF generation.
- This is unsafe when any of the rendered content may be influenced by user input.
- The CVE description also identifies additional weaknesses:
- missing capability check in
WooCommerce_Delivery_Notes::update - missing output escaping in
template.php
- missing capability check in
- These weaknesses create an exploitable chain: unauthenticated access combined with injection of PHP-capable content into the PDF renderer.
- The core issue is insecure Dompdf configuration in
-
Attack vector and exploitation conditions
- An attacker needs:
- the vulnerable plugin installed,
- access to a function or field that is included in the HTML sent to Dompdf,
- the ability to trigger PDF generation or update the delivery note content.
- The likely chain:
- The attacker injects PHP code into a user-controllable field or template variable.
- The plugin generates a delivery note/invoice PDF using Dompdf.
- Dompdf evaluates the embedded PHP code because
isPhpEnabledis enabled. - The injected PHP executes on the server.
- The missing capability check means the attacker may not need to be authenticated to reach the vulnerable update path.
- An attacker needs:
-
Security implications
- Arbitrary code execution on the web server.
- Potential compromise of the WordPress site and host environment.
- Ability to execute system commands, install backdoors, modify files, or exfiltrate data.
- RCE via a plugin used in ecommerce sites is especially dangerous because it may include payment, customer, and order data.
3. Patch Analysis
-
What code changes were made?
- In
includes/front/wcdn-front-function.php, the Dompdf option was changed from:options->set( 'isPhpEnabled', true );
- to:
options->set( 'isPhpEnabled', false );
- In
-
How do these changes fix the vulnerability?
- Disabling
isPhpEnabledprevents Dompdf from executing PHP embedded in HTML content. - Any injected
<?php ... ?>payload is no longer evaluated by the PDF renderer. - This removes the code execution vector provided by Dompdf, which is the critical exploitation mechanism.
- Disabling
-
Security improvements introduced
- Changes the Dompdf configuration to a secure default.
- Eliminates a dangerous capability that should never be enabled for untrusted content.
- Reduces the attack surface of PDF generation in the plugin.
- Note: while this fix addresses the Dompdf vector, the broader issue also requires proper authorization checks and escaping elsewhere in the plugin.
4. Proof of Concept (PoC) Guide
-
Prerequisites for exploitation
- WordPress site running Print Invoice & Delivery Notes for WooCommerce version 5.8.0 or earlier.
- Plugin uses Dompdf for PDF generation.
- Attacker can influence content that is rendered in the delivery note or invoice HTML.
- Vulnerable path accessible without sufficient authorization (as indicated by the missing capability check).
-
Step-by-step exploitation approach
- Identify a field or template variable included in generated PDF output.
- Inject PHP code, e.g.:
<?php system($_GET['cmd']); ?>
- Trigger the plugin’s PDF generation routine for an invoice or delivery note.
- Access the generated PDF endpoint with a command parameter, for example:
?cmd=id
- Observe the command output or side effects in the response or server behavior.
-
Expected behavior vs exploited behavior
- Expected behavior:
- The plugin generates a PDF from HTML content and returns a delivery note or invoice PDF.
- No server-side PHP execution occurs from user-supplied content.
- Exploited behavior:
- The injected PHP payload is executed during PDF generation.
- Arbitrary commands run on the server as the web server user.
- Expected behavior:
-
How to verify the vulnerability exists
- Confirm plugin version is <= 5.8.0.
- Inspect
includes/front/wcdn-front-function.phpand verifyisPhpEnabledis set totrue. - Test whether user-controlled content appears in the rendered PDF HTML.
- Attempt a non-destructive probe payload and observe whether PHP execution occurs.
5. Recommendations
-
Mitigation strategies
- Upgrade the plugin to a patched version where
isPhpEnabledis disabled. - If patching immediately is not possible, disable or remove the affected PDF generation functionality.
- Restrict access to plugin endpoints with proper capability checks and authentication.
- Upgrade the plugin to a patched version where
-
Detection methods
- Monitor web logs for requests containing PHP tags (
<?php) to plugin endpoints. - Look for unusual POSTs/GETs targeting delivery note or update routes.
- Audit plugin files for insecure Dompdf configuration and missing access controls.
- Use host-based detection for unexpected PHP execution from the plugin process.
- Monitor web logs for requests containing PHP tags (
-
Best practices to prevent similar issues
- Never enable PHP execution in template or rendering engines for untrusted content.
- Apply least privilege to all admin/update functions: verify capabilities before performing updates.
- Escape all output in templates and avoid rendering raw user input.
- Use secure default settings for third-party libraries.
- Perform regular code reviews of plugin modules that handle rich content and file generation.