Description
The Account Switcher plugin for WordPress is vulnerable to Privilege Escalation in all versions up to, and including, 1.0.2. This is due to the `rememberLogin` REST API endpoint using a loose comparison (`!=` instead of `!==`) for secret validation at `app/RestAPI.php:111`, combined with no validation that the secret is non-empty. When a target user has never used the "Remember me" feature, their `asSecret` user meta does not exist, causing `get_user_meta()` to return an empty string. An attacker can send an empty `secret` parameter, which passes the comparison (`'' != ''` is `false`), and the endpoint then calls `wp_set_auth_cookie()` for the target user. Additionally, all REST routes use `permission_callback => '__return_true'` with no capability checks. This makes it possible for authenticated attackers, with Subscriber-level access and above, to switch to any user account including Administrator, ultimately granting themselves full administrative privileges.
Problem types
CWE-287 Improper Authentication
Product status
Any version
Timeline
| 2026-05-19: | Disclosed |
Credits
Ren Voza
References
www.wordfence.com/...-6951-4246-9cd6-dd64fee3a1bc?source=cve
plugins.trac.wordpress.org/...her/tags/1.0.2/app/RestAPI.php
plugins.trac.wordpress.org/...0.2/app/PluginHero/BaseAPI.php
wordpress.org/plugins/account-switcher/