CVE-2026-28783
JSON

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 packageVersionsReported by
craftcms cms>= 5.0.0-RC1, <= 5.9.0-beta.1, >= 4.0.0-RC1, <= 4.17.0-beta.1CVE 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.1GitHub Advisory Database
craftcms craft_cmsfrom >4.0.0 before 4.17.0, from >5.0.0 before 5.9.0, 4.0.0, 5.0.0NVD

All scores

GitHub_M9.4critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
GitHubmedium CVSS:4.0CVSS: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
NVD9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-94CWE-184CWE-1336

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

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.

https://github.com/twigphp/Twig/blob/946ddeafa3c9f4ce279d1f34051af041db0e16f2/src/Extension/CoreExtension.php#L2096

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

https://github.com/craftcms/cms/pull/18208

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

SourceRecordLicence
CVE ListCVE-2026-28783 changed 2026-03-06CVE Terms of Use
GitHub Advisory DatabaseGHSA-5fvc-7894-ghp4 changed 2026-03-04CC-BY-4.0
NVDCVE-2026-28783 changed 2026-06-17Public domain