CVE-2026-28783

Craft has a Twig Function Blocklist Bypass

Published Mar 4, 2026 CVSS 4.0 · 9.4 Critical EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Craft CMS prior to 5.9.0-beta.1 and 4.17.0-beta.1 implements a blocklist that is intended to prevent the execution of dangerous PHP functions through Twig non‑Closure arrow functions. The blocklist, however, does not include all potentially harmful PHP functions. Attackers who acquire either administrative privileges, the ability to modify system settings via allowAdminChanges, or access to the System Messages utility can exploit this omission to invoke disallowed PHP functions, allowing them to execute arbitrary code, read files, or perform SSRFs and SSTIs. This vulnerability is essentially a code‑execution flaw and is classified under CWE‑1336, CWE‑184, and CWE‑94.

Affected Systems

The back‑end product affected is Craft CMS. The CVE applies to all versions released before 5.9.0-beta.1 and 4.17.0-beta.1, including legacy 5.0.0 releases and the 4.0.0 series up through rc3. Any installation of those users is considered vulnerable unless the back‑end has been upgraded to the fixed versions. The vulnerability is tied to the system configuration that permits admin changes or provides access to system‑message editing functions. Administrators using the affected CMS should check the version in use against the fixed releases.

Risk and Exploitability

The flaw carries a CVSS score of 9.4, indicating a high‑severity risk. Its EPSS score is below 1 %, implying a low probability that an exploit is actively used; however the vulnerability is not listed in the CISA KEV catalog. Because the attack requires privileged access, the exploitation pathway is limited to environments where an attacker can enable allowAdminChanges or compromise an admin account. The overall risk is elevated for production sites that have not upgraded and still expose the required interfaces. The highest threat is the potential for remote code execution if the blocklist is bypassed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Craft CMS to version 5.9.0‑beta.1 or later, or 4.17.0‑beta.1 or later.
  • Disable allowAdminChanges unless absolutely required and restrict its usage to trusted administrators.
  • Restrict access to the System Messages utility to a minimal set of highly trusted users.
  • Monitor application logs for unusual Twig function usage or attempts to execute disallowed PHP functions.
  • If immediate upgrade is not possible, consider temporarily disabling the execution of all PHP functions via custom patch or configuration until a patch is applied.

Generated by OpenCVE AI on April 16, 2026 at 13:32 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5fvc-7894-ghp4 Craft CMS has Twig Function Blocklist Bypass
History
Type Values Removed Values Added
First Time appeared Craftcms craft Cms
CPEs cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:*
cpe:2.3:a:craftcms:craft_cms:4.0.0:-:*:*:*:*:*:*
cpe:2.3:a:craftcms:craft_cms:4.0.0:rc1:*:*:*:*:*:*
cpe:2.3:a:craftcms:craft_cms:4.0.0:rc2:*:*:*:*:*:*
cpe:2.3:a:craftcms:craft_cms:4.0.0:rc3:*:*:*:*:*:*
cpe:2.3:a:craftcms:craft_cms:5.0.0:-:*:*:*:*:*:*
cpe:2.3:a:craftcms:craft_cms:5.0.0:rc1:*:*:*:*:*:*
Vendors & Products Craftcms craft Cms
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Craftcms
Craftcms craftcms
Vendors & Products Craftcms
Craftcms craftcms
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Craft has a Twig Function Blocklist Bypass
Weaknesses CWE-1336
CWE-184
CWE-94
References
Metrics cvssV4_0

{'score': 9.4, 'vector': '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'}

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine

  • CWE-184

    Incomplete List of Disallowed Inputs

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 6, 2026, 5:01 AM
Reserved
Mar 3, 2026, 2:25 PM
Status
Analyzed
Published
Mar 4, 2026, 5:16 PM
Modified
Jun 17, 2026, 10:29 AM