GHSA-CC7P-2J3X-X7XF
Vulnerability from github – Published: 2026-03-16 18:44 – Updated: 2026-03-16 21:57Summary
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.
Details
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=truetohandleRequest(), bypassing all security guards, and passes$checkToken=falsetocheckIfActionRequest(), which allows an attacker-controlled action query parameter to override the dispatch target. - The
requireToken()guard onactionImpersonateWithToken()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. actionImpersonateWithTokenis listed in$allowAnonymousand performs no authorization beyondrequireToken(), so no prior authentication is required.
PoC
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 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.
Impact
Privilege escalation; everyone is impacted.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 4.17.5"
},
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0-RC1"
},
{
"fixed": "4.17.6"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.9.11"
},
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0-RC1"
},
{
"fixed": "5.9.12"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-32267"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-16T18:44:20Z",
"nvd_published_at": "2026-03-16T20:16:19Z",
"severity": "CRITICAL"
},
"details": "### Summary\nA low-privilege user (or an unauthenticated user who has been sent a shared URL) can escalate their privileges to admin by abusing `UsersController-\u003eactionImpersonateWithToken`.\n\nAffected users should update to Craft 4.17.6 and 5.9.12 to mitigate the issue.\n\n### Details\nThis vulnerability allows any low-privilege user to escalate their privileges and become an admin, or, in extreme circumstances, unprivileged users to do the same.\n\nTherefore, this vulnerability affects Craft Pro and Team more than Craft Solo.\n\nSpecifically, an attacker who possesses a valid \u201cpreview token\u201d can then append `\u0026action=users/impersonate-with-token\u0026userId=1\u0026prevUserId=1` to the preview URL to hijack the request\u00a0into 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 \u201cPreview\u201d, and then recover this token.\n\nHere\u2019s what happens:\n\n1. 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.\n2. 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.\n3. `actionImpersonateWithToken` is listed in `$allowAnonymous` and performs no authorization beyond `requireToken()`, so no prior authentication is required.\n\n### PoC\n\nThe PoC achieves full admin takeover on the latest Craft CMS 5.9.10. Spawn a local version of Craft. Then, you\u2019ll want to log in and create a valid setup:\n\n1. Log in at http://host:18895/admin\n2. Go to Settings,\u00a0 Sections, New Section (name: \"Blog\", type: \"Channel\")\n3. Under Site Settings, set URI Format to blog/{slug}\n4. Then go to Entries, New Entry, Blog, and give it any title\n\nNext, obtain a preview token\n\n1. Open the saved entry in the editor\n2. Click the Preview button\n3. A preview pane opens with the entry rendered in an iframe\n4. Right-click inside the preview pane and Inspect Element\n5. Find the \u003ciframe\u003e element; its src contains the tokenized URL: `http://host:18895/blog/title?x-craft-live-preview=...\u0026token=XXXXXXXX`\n6. Copy the `token=` value\n\nFinally, execute the exploit:\n\n\u00a0 1. Open a new incognito/private browser window\n\u00a0 2. Navigate to: `http://host:18895/?token=XXXXXXXX\u0026action=users/impersonate-with-token\u0026userId=1\u0026prevUserId=1`\n\u00a0 3. You may see a 404. This is expected.\n\nTo verify the exploit, in the same incognito tab, navigate to\u00a0`http://host:18895/admin`.\u00a0You should land on the admin dashboard, logged in as admin, without ever entering credentials.\n\n### Impact\n\nPrivilege escalation; everyone is impacted.",
"id": "GHSA-cc7p-2j3x-x7xf",
"modified": "2026-03-16T21:57:43Z",
"published": "2026-03-16T18:44:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-cc7p-2j3x-x7xf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32267"
},
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/commit/6301e217c5f15617d939c432cb770db50af14b33"
},
{
"type": "PACKAGE",
"url": "https://github.com/craftcms/cms"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Craft CMS Vulnerable to Privilege Escalation/Bypass through UsersController-\u003eactionImpersonateWithToken()"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.