VYPR
Moderate severityNVD Advisory· Published Mar 4, 2026· Updated Mar 6, 2026

Craft has a Twig Function Blocklist Bypass

CVE-2026-28783

Description

Craft is a content management system (CMS). Prior to 5.9.0-beta.1 and 4.17.0-beta.1, Craft CMS implements a blocklist to prevent potentially dangerous PHP functions from being called via Twig non-Closure arrow functions. In order to be able to successfully execute this attack, you need to either have allowAdminChanges enabled on production, or a compromised admin account, or an account with access to the System Messages utility. Several PHP functions are not included in the blocklist, which could allow malicious actors with the required permissions to execute various types of payloads, including RCEs, arbitrary file reads, SSRFs, and SSTIs. This vulnerability is fixed in 5.9.0-beta.1 and 4.17.0-beta.1.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Craft CMS before 5.9.0-beta.1 and 4.17.0-beta.1 allows RCE, file reads, SSRF, and SSTI via a Twig non-Closure arrow function blocklist bypass.

Vulnerability

Craft CMS uses a blocklist to prevent dangerous PHP functions from being called through Twig non-Closure arrow functions. However, several PHP functions are missing from this blocklist, allowing a bypass of the intended restriction [1][4].

Exploitation

Successful exploitation requires either allowAdminChanges enabled on production, a compromised admin account, or an account with access to the System Messages utility. The attacker can then call arbitrary PHP functions excluded from the blocklist via Twig arrow functions [1][2].

Impact

This vulnerability can lead to remote code execution (RCE), arbitrary file reads, server-side request forgery (SSRF), and server-side template injection (SSTI), giving an attacker significant control over the server and its data [4].

Mitigation

The issue is fixed in Craft CMS 5.9.0-beta.1 and 4.17.0-beta.1. The fix removes the blocklist and disables all non-Closure arrow functions by default via the enableTwigSandbox config setting. Existing projects must update to a patched version and enable the config setting to fully mitigate the risk [4].

AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
craftcms/cmsPackagist
>= 5.0.0-RC1, < 5.9.0-beta.15.9.0-beta.1
craftcms/cmsPackagist
>= 4.0.0-RC1, < 4.17.0-beta.14.17.0-beta.1

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.