critical CVSS 9.1

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 -y

Defensia 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

  1. Run `php -v` to verify the currently installed PHP version
  2. Check your Craft CMS version by examining `craft/composer.json` or running `./craft about` in the Craft installation directory
  3. Search application logs in `storage/logs/` for Twig template errors or arrow function invocations occurring before the patch date
  4. 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

CVE-2024-5932CVSS 10The GiveWP – Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all versions up to, and including, 3.14.1 via deserialization of untrusted input from the 'give_title' parameter. This makes it possible for unauthenticated attackers to inject a PHP Object. The additional presence of a POP chain allows attackers to execute code remotely, and to delete arbitrary files.
CVE-2026-39337CVSS 10ChurchCRM is an open-source church management system. Prior to 7.1.0, critical pre-authentication remote code execution vulnerability in ChurchCRM's setup wizard allows unauthenticated attackers to inject arbitrary PHP code during the initial installation process, leading to complete server compromise. The "$dbPassword" variable is not sanitized. This vulnerability exists due to an incomplete fix for CVE-2025-62521. This vulnerability is fixed in 7.1.0.
CVE-2025-62521CVSS 10ChurchCRM is an open-source church management system. Prior to version 5.21.0, a pre-authentication remote code execution vulnerability in ChurchCRM's setup wizard allows unauthenticated attackers to inject arbitrary PHP code during the initial installation process, leading to complete server compromise. The vulnerability exists in `setup/routes/setup.php` where user input from the setup form is directly concatenated into a PHP configuration template without any validation or sanitization. Any parameter in the setup form can be used to inject PHP code that gets written to `Include/Config.php`, which is then executed on every page load. This is more severe than typical authenticated RCE vulnerabilities because it requires no credentials and affects the installation process that administrators must complete. Version 5.21.0 patches the issue.
CVE-2025-25174CVSS 10Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') vulnerability in beeteam368 BeeTeam368 Extensions beeteam368-extensions allows PHP Local File Inclusion.This issue affects BeeTeam368 Extensions: from n/a through <= 1.9.4.
CVE-2026-28289CVSS 10FreeScout is a free help desk and shared inbox built with PHP's Laravel framework. A patch bypass vulnerability for CVE-2026-27636 in FreeScout 1.8.206 and earlier allows any authenticated user with file upload permissions to achieve Remote Code Execution (RCE) on the server by uploading a malicious .htaccess file using a zero-width space character prefix to bypass the security check. The vulnerability exists in the sanitizeUploadedFileName() function in app/Http/Helper.php. The function contains a Time-of-Check to Time-of-Use (TOCTOU) flaw where the dot-prefix check occurs before sanitization removes invisible characters. This vulnerability is fixed in 1.8.207.

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