9.4critical
Craft has a Twig Function Blocklist Bypass
- Severity
- 9.4critical CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.68% (higher than 47% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5fvc-7894-ghp4
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms cms | >= 5.0.0-RC1, <= 5.9.0-beta.1, >= 4.0.0-RC1, <= 4.17.0-beta.1 | CVE List |
| craftcms/cms (Packagist) | from 5.0.0-RC1 before 5.9.0-beta.1, from 4.0.0-RC1 before 4.17.0-beta.1 | GitHub Advisory Database |
| craftcms craft_cms | from >4.0.0 before 4.17.0, from >5.0.0 before 5.9.0, 4.0.0, 5.0.0 | NVD |
All scores
| GitHub_M | 9.4critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
Twig has already deprecated this behavior, and it will eventually be removed from Twig altogether.
This has been resolved in Craft 4.17.0 and 5.9.0, which removes the blocklist and disables all non-Clousure arrow functions in Twig globally via the enableTwigSandbox config setting. That setting is enabled by default on all new Craft projects. Existing Craft projects will need to enable the config setting to take advantage of it.
Existing projects should update to the patched versions of 5.9.0 and 4.17.0 to mitigate the issue and enable the config setting.
Resources
NVD (es)
Craft es un sistema de gestión de contenido (CMS). Antes de 5.9.0-beta.1 y 4.17.0-beta.1, Craft CMS implementa una lista de bloqueo para evitar que funciones PHP potencialmente peligrosas sean llamadas a través de funciones de flecha Twig no-Closure. Para poder ejecutar este ataque con éxito, se necesita tener allowAdminChanges habilitado en producción, o una cuenta de administrador comprometida, o una cuenta con acceso a la utilidad de Mensajes del Sistema. Varias funciones PHP no están incluidas en la lista de bloqueo, lo que podría permitir a actores maliciosos con los permisos requeridos ejecutar varios tipos de cargas útiles, incluyendo RCEs, lecturas de archivos arbitrarias, SSRFs y SSTIs. Esta vulnerabilidad está corregida en 5.9.0-beta.1 y 4.17.0-beta.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-28783 changed 2026-03-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5fvc-7894-ghp4 changed 2026-03-04 | CC-BY-4.0 |
| NVD | CVE-2026-28783 changed 2026-06-17 | Public domain |