
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-28783 is a Twig function blocklist bypass vulnerability in Craft CMS that allows privileged attackers to execute arbitrary code, read files, conduct SSRF attacks, and perform server-side template injection (SSTI). It affects Craft CMS versions >= 4.0.0-RC1 and < 4.17.0, and >= 5.0.0-RC1 and < 5.9.0. The vulnerability was published on March 2, 2026, and patched in versions 4.17.0 and 5.9.0. It carries a CVSS v3.1 base score of 9.1 (Critical) and a CVSS v4.0 base score of 9.4 (Critical) (GitHub Advisory, Craft CMS Advisory).
The root cause is an incomplete PHP function blocklist (CWE-184) used by Craft CMS to restrict dangerous PHP functions callable via Twig non-Closure arrow functions, compounded by improper neutralization of template engine special elements (CWE-1336) and code injection (CWE-94). Twig supports passing string function names as arrow function callbacks (e.g., names|map('ucfirst')), and Craft's blocklist failed to enumerate all dangerous PHP functions, leaving gaps that could be exploited. Exploitation requires either allowAdminChanges enabled on production, a compromised admin account, or access to the System Messages utility — all of which allow template content to be injected and evaluated. The fix, implemented in PR #18208, removes the blocklist approach entirely and instead enables Twig's Sandbox extension via a new enableTwigSandbox config setting, which globally disables all non-Closure arrow functions (GitHub Advisory, Craft CMS PR).
Successful exploitation allows an attacker with the required privileges to execute arbitrary remote code on the server, read sensitive files from the filesystem, conduct server-side request forgery (SSRF) to access internal resources, and perform server-side template injection (SSTI). These capabilities can lead to complete system compromise, sensitive data exfiltration, and lateral movement within the hosting infrastructure. All three pillars of the CIA triad — confidentiality, integrity, and availability — are rated HIGH in the CVSS scoring (GitHub Advisory, Craft CMS Advisory).
No public proof-of-concept exploit code or evidence of in-the-wild exploitation has been reported as of the time of this report (GitHub Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.062%, placing it in the 11th percentile for exploitation likelihood within 30 days. Exploitation requires high privileges (admin account or System Messages utility access), which significantly limits the attack surface compared to unauthenticated vulnerabilities.
allowAdminChanges enabled in production, or gain access to the System Messages utility.items|map('system') or similar unlisted functions) to achieve RCE, file read, or SSRF..env with database credentials), or pivot to internal services via SSRF (GitHub Advisory, Craft CMS Advisory)..env or configuration files indicating credential access.sh, bash, curl, wget) executing system commands.Update Craft CMS to version 4.17.0 (for the 4.x branch) or 5.9.0 (for the 5.x branch), which remove the blocklist and disable all non-Closure arrow functions in Twig via the new enableTwigSandbox config setting. This setting is enabled by default on new Craft projects, but existing projects must manually enable it in their configuration after upgrading to benefit from the protection. As additional hardening measures, disable allowAdminChanges on production environments and restrict access to the System Messages utility to trusted personnel only (GitHub Advisory, Craft CMS PR).
The vulnerability was reported by security researcher mHe4am and the fix was implemented by Craft CMS core developer brandonkelly via PR #18208, merged on January 2, 2026 (Craft CMS PR). The advisory notes that Twig itself has already deprecated the non-Closure arrow function behavior and plans to remove it in a future version, aligning the Craft CMS fix with the upstream Twig project's direction. No significant broader media coverage or notable community controversy has been identified beyond the standard advisory publication.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."