CVE-2026-28784: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in craftcms cms
Craft is a content management system (CMS). Prior to 5.8.22 and 4.16.18, it is possible to craft a malicious payload using the Twig map filter in text fields that accept Twig input under Settings in the Craft control panel or using the System Messages utility, which could lead to a RCE. For this to work, you must have administrator access to the Craft Control Panel, and allowAdminChanges must be enabled for this to work, which is against our recommendations for any non-dev environment. Alternatively, you can have a non-administrator account with allowAdminChanges disabled, but you have access to the System Messages utility. Users should update to the patched versions (5.8.22 and 4.16.18) to mitigate the issue.
AI Analysis
Technical Summary
CVE-2026-28784 is a critical vulnerability in Craft CMS, a popular content management system, caused by improper neutralization of special elements in the Twig template engine (CWE-1336). The flaw exists in the handling of the Twig map filter within text fields that accept Twig input, such as those found under Settings in the Craft control panel or the System Messages utility. An attacker with administrator privileges and allowAdminChanges enabled can craft a malicious payload that leads to remote code execution (RCE). Alternatively, a non-administrator user with access to the System Messages utility can also exploit the vulnerability even if allowAdminChanges is disabled. The vulnerability stems from insufficient sanitization of user-controlled input that is processed by the Twig engine, allowing execution of arbitrary code on the server hosting the CMS. This can lead to full system compromise, data theft, or service disruption. The vulnerability affects Craft CMS versions from 4.0.0-RC1 up to but not including 4.17.0-beta.1 and from 5.0.0-RC1 up to but not including 5.9.0-beta.1. The vendor has released patched versions 5.8.22 and 4.16.18 to address this issue. The CVSS 4.0 score of 8.6 reflects the vulnerability's high impact and ease of exploitation given the required privileges. No known exploits are currently reported in the wild, but the risk remains significant due to the potential severity of RCE in web-facing CMS platforms.
Potential Impact
The impact of CVE-2026-28784 is substantial for organizations using vulnerable Craft CMS versions. Successful exploitation results in remote code execution, allowing attackers to run arbitrary commands on the server. This can lead to full system compromise, unauthorized data access or modification, deployment of malware or ransomware, and disruption of web services. Since Craft CMS is often used to manage websites and web applications, attackers could deface sites, steal sensitive user data, or pivot to internal networks. The requirement for administrative or specific utility access limits the attack surface but does not eliminate risk, especially in environments where administrative controls are lax or where multiple users have elevated privileges. The vulnerability undermines confidentiality, integrity, and availability of affected systems. Organizations with public-facing Craft CMS installations are particularly at risk, as attackers may attempt to gain the necessary privileges through other means and then exploit this vulnerability to escalate control. The absence of known exploits in the wild suggests a window for proactive mitigation, but the high CVSS score indicates that once exploited, the consequences are severe.
Mitigation Recommendations
To mitigate CVE-2026-28784, organizations should immediately update Craft CMS to versions 5.8.22 or 4.16.18 or later, where the vulnerability is patched. Beyond patching, administrators should disable allowAdminChanges in production environments as recommended by the vendor to reduce the attack surface. Restrict access to the Craft control panel and the System Messages utility to only trusted administrators and limit the number of users with such privileges. Implement strong authentication and authorization controls, including multi-factor authentication for administrative accounts. Regularly audit user permissions and remove unnecessary access rights. Monitor logs for unusual Twig input or attempts to access the System Messages utility. Employ web application firewalls (WAFs) with rules to detect and block suspicious template injection patterns. Conduct regular security assessments and penetration tests focusing on CMS components. Finally, maintain a robust backup and incident response plan to recover quickly in case of compromise.
Affected Countries
United States, United Kingdom, Germany, Australia, Canada, Netherlands, France, Japan, Sweden, Brazil
CVE-2026-28784: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in craftcms cms
Description
Craft is a content management system (CMS). Prior to 5.8.22 and 4.16.18, it is possible to craft a malicious payload using the Twig map filter in text fields that accept Twig input under Settings in the Craft control panel or using the System Messages utility, which could lead to a RCE. For this to work, you must have administrator access to the Craft Control Panel, and allowAdminChanges must be enabled for this to work, which is against our recommendations for any non-dev environment. Alternatively, you can have a non-administrator account with allowAdminChanges disabled, but you have access to the System Messages utility. Users should update to the patched versions (5.8.22 and 4.16.18) to mitigate the issue.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-28784 is a critical vulnerability in Craft CMS, a popular content management system, caused by improper neutralization of special elements in the Twig template engine (CWE-1336). The flaw exists in the handling of the Twig map filter within text fields that accept Twig input, such as those found under Settings in the Craft control panel or the System Messages utility. An attacker with administrator privileges and allowAdminChanges enabled can craft a malicious payload that leads to remote code execution (RCE). Alternatively, a non-administrator user with access to the System Messages utility can also exploit the vulnerability even if allowAdminChanges is disabled. The vulnerability stems from insufficient sanitization of user-controlled input that is processed by the Twig engine, allowing execution of arbitrary code on the server hosting the CMS. This can lead to full system compromise, data theft, or service disruption. The vulnerability affects Craft CMS versions from 4.0.0-RC1 up to but not including 4.17.0-beta.1 and from 5.0.0-RC1 up to but not including 5.9.0-beta.1. The vendor has released patched versions 5.8.22 and 4.16.18 to address this issue. The CVSS 4.0 score of 8.6 reflects the vulnerability's high impact and ease of exploitation given the required privileges. No known exploits are currently reported in the wild, but the risk remains significant due to the potential severity of RCE in web-facing CMS platforms.
Potential Impact
The impact of CVE-2026-28784 is substantial for organizations using vulnerable Craft CMS versions. Successful exploitation results in remote code execution, allowing attackers to run arbitrary commands on the server. This can lead to full system compromise, unauthorized data access or modification, deployment of malware or ransomware, and disruption of web services. Since Craft CMS is often used to manage websites and web applications, attackers could deface sites, steal sensitive user data, or pivot to internal networks. The requirement for administrative or specific utility access limits the attack surface but does not eliminate risk, especially in environments where administrative controls are lax or where multiple users have elevated privileges. The vulnerability undermines confidentiality, integrity, and availability of affected systems. Organizations with public-facing Craft CMS installations are particularly at risk, as attackers may attempt to gain the necessary privileges through other means and then exploit this vulnerability to escalate control. The absence of known exploits in the wild suggests a window for proactive mitigation, but the high CVSS score indicates that once exploited, the consequences are severe.
Mitigation Recommendations
To mitigate CVE-2026-28784, organizations should immediately update Craft CMS to versions 5.8.22 or 4.16.18 or later, where the vulnerability is patched. Beyond patching, administrators should disable allowAdminChanges in production environments as recommended by the vendor to reduce the attack surface. Restrict access to the Craft control panel and the System Messages utility to only trusted administrators and limit the number of users with such privileges. Implement strong authentication and authorization controls, including multi-factor authentication for administrative accounts. Regularly audit user permissions and remove unnecessary access rights. Monitor logs for unusual Twig input or attempts to access the System Messages utility. Employ web application firewalls (WAFs) with rules to detect and block suspicious template injection patterns. Conduct regular security assessments and penetration tests focusing on CMS components. Finally, maintain a robust backup and incident response plan to recover quickly in case of compromise.
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: 69a8695ad1a09e29cb4e1dc5
Added to database: 3/4/2026, 5:18:18 PM
Last enriched: 3/11/2026, 7:39:33 PM
Last updated: 4/18/2026, 11:37:34 PM
Views: 53
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.