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-28697: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in craftcms cms

0
Critical
VulnerabilityCVE-2026-28697cvecve-2026-28697cwe-1336
Published: Wed Mar 04 2026 (03/04/2026, 16:26:37 UTC)
Source: CVE Database V5
Vendor/Project: craftcms
Product: cms

Description

Craft is a content management system (CMS). Prior to 4.17.0-beta.1 and 5.9.0-beta.1, an authenticated administrator can achieve Remote Code Execution (RCE) by injecting a Server-Side Template Injection (SSTI) payload into Twig template fields (e.g., Email Templates). By calling the craft.app.fs.write() method, an attacker can write a malicious PHP script to a web-accessible directory and subsequently access it via the browser to execute arbitrary system commands. This vulnerability is fixed in 4.17.0-beta.1 and 5.9.0-beta.1.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 03/11/2026, 19:38:52 UTC

Technical Analysis

CVE-2026-28697 is a critical vulnerability classified under CWE-1336 (Improper Neutralization of Special Elements used in a Template Engine) affecting Craft CMS, a popular content management system. The flaw exists in versions prior to 4.17.0-beta.1 and 5.9.0-beta.1, where authenticated administrators can inject malicious Server-Side Template Injection (SSTI) payloads into Twig template fields, such as Email Templates. This injection enables attackers to exploit the craft.app.fs.write() method to write arbitrary PHP scripts to directories accessible via the web server. Once the malicious PHP script is written, attackers can invoke it through a browser, leading to Remote Code Execution (RCE) on the underlying system. The vulnerability does not require user interaction beyond administrator authentication, making it highly exploitable in environments where admin credentials are compromised or misused. The issue arises from improper sanitization and neutralization of special template elements, allowing crafted payloads to execute system commands. The vulnerability has a CVSS 4.0 base score of 9.4, indicating critical severity with network attack vector, low attack complexity, no user interaction, and high impact on confidentiality, integrity, and availability. Although no known exploits have been reported in the wild yet, the potential for severe damage is significant. The vulnerability is mitigated in Craft CMS versions 4.17.0-beta.1 and 5.9.0-beta.1 and later, where proper input sanitization and template handling have been implemented.

Potential Impact

The impact of CVE-2026-28697 is severe for organizations using affected versions of Craft CMS. Successful exploitation results in Remote Code Execution, allowing attackers to execute arbitrary system commands with the privileges of the web server process. This can lead to full system compromise, data theft, defacement, installation of backdoors, lateral movement within networks, and disruption of services. Since the vulnerability requires administrator authentication, the risk is elevated in environments where admin credentials are weak, reused, or compromised. The ability to write PHP scripts to web-accessible directories increases the attack surface and persistence options for adversaries. Organizations relying on Craft CMS for critical web applications, customer portals, or internal tools face significant confidentiality, integrity, and availability risks. The vulnerability could also be leveraged in targeted attacks against high-value targets or in supply chain attacks if exploited in managed hosting or development environments.

Mitigation Recommendations

To mitigate CVE-2026-28697, organizations should immediately upgrade Craft CMS to version 4.17.0-beta.1, 5.9.0-beta.1, or later stable releases where the vulnerability is patched. Additionally, restrict administrator access strictly to trusted personnel and enforce strong authentication mechanisms such as multi-factor authentication (MFA) to reduce the risk of credential compromise. Review and audit template fields, especially Email Templates, for suspicious or unauthorized changes. Implement web application firewalls (WAFs) with rules to detect and block SSTI payload patterns targeting Twig templates. Limit write permissions on web-accessible directories to prevent unauthorized file creation. Monitor logs for unusual file writes or execution attempts. Conduct regular security assessments and penetration tests focusing on template injection and code execution vectors. Educate administrators on secure template management practices and the risks of injecting untrusted input into templates. Finally, maintain an incident response plan to quickly address potential exploitation attempts.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-02T21:43:19.928Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 69a86252d1a09e29cb4c063c

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

Last enriched: 3/11/2026, 7:38:52 PM

Last updated: 4/17/2026, 6:53:15 PM

Views: 82

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