CVE-2026-28783·PHP vulnerability
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.
- Severity
- critical
- Software
- PHP
- Fixed in
- 5.9.0
- Published
- 2026-03-04
Affected versions
From: 5.0.0
Until: 5.9.0
Fixed in: 5.9.0
How to fix this CVE
Upgrade Craft CMS to version 5.9.0 or later to patch the Twig function blocklist bypass that permits unauthorized code execution. Organizations running versions 5.0.0 through 5.8.x should prioritize this update immediately, particularly if allowAdminChanges is enabled in production or if admin account compromise is suspected. After patching, audit System Messages utility access logs for suspicious Twig expressions involving previously-blocked PHP functions.
sudo dnf check-update php && sudo dnf upgrade php -yDefensia detects this vulnerability
WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Restrict HTTP POST requests to `/admin/system-messages` and similar Twig template editing endpoints to IP whitelists; monitor for Twig template submissions containing PHP function names such as `exec()`, `system()`, `file_get_contents()`, `curl_init()`, and `eval()` within arrow function syntax.How to check if you are affected
- Run `php -v` to verify the currently installed PHP version
- Check your Craft CMS version by examining `craft/composer.json` or running `./craft about` in the Craft installation directory
- Search application logs in `storage/logs/` for Twig template errors or arrow function invocations occurring before the patch date
- Verify the patch by confirming the Craft CMS version is 5.9.0 or later using `./craft about`, then inspect the blocklist in `src/web/twig/nodes/InlineBlock.php` for completeness
FAQ
What is CVE-2026-28783?
CVE-2026-28783 is a critical vulnerability in Craft CMS where the Twig template engine's protection against dangerous PHP function calls is incomplete, allowing authenticated attackers with elevated permissions to execute arbitrary code, read files, or trigger server-side request forgeries through non-Closure arrow functions.
Is CVE-2026-28783 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available, though the attack surface requires either compromised admin credentials or production allowAdminChanges configuration.
What versions of Craft CMS are affected by CVE-2026-28783?
Craft CMS versions 5.0.0 through 5.8.x are vulnerable; the 4.x branch is affected up to version 4.16.x. Fixed versions are 5.9.0-beta.1 and 4.17.0-beta.1 or later.
How do I check if my server is vulnerable to CVE-2026-28783?
Navigate to your Craft CMS installation and run `./craft about` to display the current version; if it shows 5.0.0–5.8.x or 4.0.0–4.16.x, your installation is vulnerable and requires immediate patching.
Does Defensia detect CVE-2026-28783?
Yes — Defensia's CVE advisory scanner compares installed Craft CMS package versions against the NVD database. If Craft CMS is installed on a monitored server, CVE-2026-28783 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-28783. Free for 1 server.
Get started free