Loading advisory.
Loading advisory.
Craft CMS Vulnerable to Privilege Escalation/Bypass through UsersController->actionImpersonateWithToken()
A low-privilege user (or an unauthenticated user who has been sent a shared URL) can escalate their privileges to admin by abusing UsersController->actionImpersonateWithToken.
Published 2026-03-16 18:44 UTC · Modified 2026-03-18 15:43 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| craftcms/cms | Packagist | >= 4.0.0-RC1, < 4.17.6 >= 5.0.0-RC1, < 5.9.12 versions 4.0.0, 4.0.0-RC1, 4.0.0-RC2, 4.0.0-RC3, 4.0.0.1, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.5.1, 4.0.5.2, 4.0.6, 4.1.0, 4.1.0.1, 4.1.0.2, 4.1.1, 4.1.2, 4.1.3, 4.1.4 and 376 more | 4.17.6, 5.9.12 | composer require 'craftcms/cms:>=4.17.6'composer require 'craftcms/cms:>=5.9.12' |
A low-privilege user (or an unauthenticated user who has been sent a shared URL) can escalate their privileges to admin by abusing UsersController->actionImpersonateWithToken.
Affected users should update to Craft 4.17.6 and 5.9.12 to mitigate the issue.
This vulnerability allows any low-privilege user to escalate their privileges and become an admin, or, in extreme circumstances, unprivileged users to do the same.
Therefore, this vulnerability affects Craft Pro and Team more than Craft Solo.
Specifically, an attacker who possesses a valid “preview token” can then append &action=users/impersonate-with-token&userId=1&prevUserId=1 to the preview URL to hijack the request into the impersonation endpoint, logging in as any user (including admin) without authentication. Getting the preview token is easy, and all an editor would have to do is create a single article, click “Preview”, and then recover this token.
Here’s what happens:
The action re-dispatch in actionPreview() passes $skipSpecialHandling=true to handleRequest(), bypassing all security guards, and passes $checkToken=false to checkIfActionRequest(), which allows an attacker-controlled action query parameter to override the dispatch target.
The requireToken() guard on actionImpersonateWithToken() only checks a boolean (_hadToken) that was set when the preview token was initially resolved. It does not verify that the token was intended for the impersonation action, and so any valid token from any route satisfies the check.
actionImpersonateWithToken is listed in $allowAnonymous and performs no authorization beyond requireToken(), so no prior authentication is required.
The PoC achieves full admin takeover on the latest Craft CMS 5.9.10. Spawn a local version of Craft. Then, you’ll want to log in and create a valid setup:
Log in at http://host:18895/admin
Go to Settings, Sections, New Section (name: "Blog", type: "Channel")
Under Site Settings, set URI Format to blog/{slug}
Then go to Entries, New Entry, Blog, and give it any title
Next, obtain a preview token
Open the saved entry in the editor
Click the Preview button
A preview pane opens with the entry rendered in an iframe
Right-click inside the preview pane and Inspect Element
Find the <iframe> element; its src contains the tokenized URL: http://host:18895/blog/title?x-craft-live-preview=...&token=XXXXXXXX
Copy the token= value
Finally, execute the exploit:
1. Open a new incognito/private browser window
2. Navigate to: http://host:18895/?token=XXXXXXXX&action=users/impersonate-with-token&userId=1&prevUserId=1
3. You may see a 404. This is expected.
To verify the exploit, in the same incognito tab, navigate to http://host:18895/admin. You should land on the admin dashboard, logged in as admin, without ever entering credentials.
Privilege escalation; everyone is impacted.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.097 on 2026-11-24 to 0.006 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.097 | first score | v2026.06.15 |
| 2026-11-26 | 0.006 | 0.097 | v2026.06.15 |