Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-28783: CWE-94: Improper Control of Generation of Code ('Code Injection') in craftcms cms

0
Critical
VulnerabilityCVE-2026-28783cvecve-2026-28783cwe-94cwe-184cwe-1336
Published: Wed Mar 04 2026 (03/04/2026, 16:50:27 UTC)
Source: CVE Database V5
Vendor/Project: craftcms
Product: cms

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.

AI-Powered Analysis

AILast updated: 03/04/2026, 17:32:55 UTC

Technical Analysis

Craft CMS, a popular content management system, suffered from a critical vulnerability identified as CVE-2026-28783, classified under CWE-94 (Improper Control of Generation of Code). The issue stems from Craft CMS's implementation of a blocklist designed to prevent dangerous PHP functions from being invoked via Twig non-Closure arrow functions. However, this blocklist was incomplete, omitting several PHP functions that could be leveraged by attackers to execute malicious payloads. To exploit this vulnerability, an attacker must have elevated privileges, such as a compromised admin account, access to the System Messages utility, or the allowAdminChanges setting enabled in production environments. Successful exploitation can lead to remote code execution (RCE), arbitrary file reads, server-side request forgery (SSRF), and server-side template injection (SSTI). The vulnerability affects Craft CMS versions from 4.0.0-RC1 up to 4.17.0-beta.1 and 5.0.0-RC1 up to 5.9.0-beta.1. The CVSS 4.0 base score of 9.4 reflects the vulnerability's critical nature, with network attack vector, low attack complexity, no required user interaction, and high privileges required. The vulnerability was publicly disclosed on March 4, 2026, and fixed in the 5.9.0-beta.1 and 4.17.0-beta.1 releases. No known exploits have been reported in the wild yet, but the potential for severe impact on confidentiality, integrity, and availability is high.

Potential Impact

The impact of CVE-2026-28783 is severe for organizations using affected versions of Craft CMS. Exploitation can result in remote code execution, allowing attackers to run arbitrary code on the server, potentially leading to full system compromise. This can enable data theft, destruction, or manipulation, impacting confidentiality and integrity. Arbitrary file reads can expose sensitive configuration files or credentials. SSRF vulnerabilities can be leveraged to pivot attacks within internal networks, potentially compromising additional systems. SSTI can allow attackers to inject malicious templates, further escalating control. Given Craft CMS's use in managing web content, exploitation could also lead to website defacement, service disruption, or use of the server as a launchpad for further attacks. Organizations with publicly accessible Craft CMS instances and insufficient privilege management are at highest risk. The requirement for elevated privileges or specific configuration settings somewhat limits the attack surface but does not eliminate the risk, especially if admin accounts are compromised or misconfigurations exist.

Mitigation Recommendations

To mitigate this vulnerability, organizations should immediately upgrade Craft CMS to versions 5.9.0-beta.1 or 4.17.0-beta.1 or later, where the issue is patched. Disable the allowAdminChanges setting in production environments to reduce the attack surface. Enforce strict access controls and multi-factor authentication for all admin and privileged accounts to prevent account compromise. Regularly audit and monitor usage of the System Messages utility and restrict access to trusted personnel only. Implement web application firewalls (WAFs) with rules to detect and block suspicious Twig template payloads or unusual PHP function calls. Conduct thorough code reviews and penetration testing focusing on template injection and code execution vectors. Maintain up-to-date backups and incident response plans to quickly recover from potential exploitation. Finally, educate developers and administrators about secure configuration and the risks of enabling development features in production.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-03T14:25:19.244Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 69a8695ad1a09e29cb4e1dc1

Added to database: 3/4/2026, 5:18:18 PM

Last enriched: 3/4/2026, 5:32:55 PM

Last updated: 3/4/2026, 8:01:24 PM

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses