ZeroHour

CVE-2026-92592

large

Authenticated Twig template injection RCE in Craft CMS via HMAC purpose-confusion

CVSS 4.0
8.7 high
EPSS
Published
()
Modified
AI analysis

CVE-2026-92592 is a signature-purpose-confusion flaw in Craft CMS 4.8.0 through 4.18.5 and 5.0.0 through 5.10.12: the license-shun cookie and signed redirect parameters are validated with the same HMAC key and format (Yii's cookieValidationKey derived from the shared Craft securityKey), so a signature minted for one purpose is accepted for the other. An authenticated non-administrator user (Control Panel access is not required) can obtain a signed cookie via the license-shun endpoint and transplant that signed envelope into a redirect parameter; on a subsequent successful login, Craft validates the signature and renders the authenticated bytes as an unsandboxed Twig template, where Twig's map filter accepts a string callback that permits calling PHP system(). A successful attacker thereby executes arbitrary operating-system commands as the web-server user on the CMS host. Exploitation requires an account using password authentication without active 2FA, the default request configuration, and availability of PHP system(). No public proof-of-concept is known, the flaw is not in CISA's KEV, and there is no confirmed in-the-wild exploitation.

What to do: Upgrade to Craft CMS 4.18.6 or 5.10.13 (or later) on all affected 4.x and 5.x installations. As interim mitigation, enforce 2FA on every account (active 2FA blocks this path), consider removing system() and similar functions via PHP's disable_functions, and audit for unexpected accounts plus review login and redirect activity for signs of license-shun cookie tampering.

Affected
Craft CMS4.8.0 through 4.18.5 (fixed in 4.18.6)
Craft CMS5.0.0 through 5.10.12 (fixed in 5.10.13)
Estimated exposure
large≈100,000+ Craft CMS sites per public web-technology tracking, with tens of thousands of instances internet-exposed — Public technology-usage trackers place Craft CMS's install base on the order of 10^5 sites, and internet-wide scans show tens of thousands of exposed Craft instances, though exploitability is further gated by the need for a…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

Craft CMS 4.8.0 through 4.18.5 and 5.0.0 through 5.10.12 sign an authenticated user's attacker-controlled license-shun cookie with the same key and format used to validate signed redirect parameters, because the HMAC signature is not bound to its purpose (Yii's cookieValidationKey is derived from the same Craft securityKey used for signed request parameters). An authenticated, non-administrator user (Control Panel access is not required) can set the cookie via the license-shun endpoint and transplant the signed envelope into the redirect parameter; on a successful login, Craft validates the signature and renders the authenticated bytes as an unsandboxed Twig template, where Twig's map filter accepts a string callback and allows PHP system() to execute arbitrary operating-system commands as the web-server user. Exploitation requires an account using password authentication without active 2FA, the default request configuration, and availability of PHP system(). The issue is fixed in 4.18.6 and 5.10.13.

Weakness
CWE-1336
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.