CVE-2025-68454: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in craftcms cms
CVE-2025-68454 is a medium-severity vulnerability in Craft CMS versions 4. 0. 0-RC1 through 4. 16. 16 and 5. 0. 0-RC1 through 5. 8. 20 that allows authenticated users to perform remote code execution (RCE) via Server-Side Template Injection (SSTI) in Twig templates. Exploitation requires administrator access with allowAdminChanges enabled or non-admin access with System Messages utility permissions.
AI Analysis
Technical Summary
CVE-2025-68454 is a vulnerability classified under CWE-1336, involving improper neutralization of special elements used in the Twig template engine within Craft CMS. The affected versions span from 4.0.0-RC1 up to 4.16.16 and 5.0.0-RC1 up to 5.8.20. The root cause is that certain text fields within the Craft Control Panel and the System Messages utility accept Twig template input without adequate sanitization, allowing an attacker with authenticated access to inject malicious Twig code. This injection leverages the Twig `map` filter to craft payloads that execute arbitrary code on the server, resulting in remote code execution (RCE). Exploitation requires either administrator privileges with the allowAdminChanges setting enabled—which is discouraged for production environments—or a non-administrator account that has access to the System Messages utility. The vulnerability does not require user interaction beyond authentication and can lead to full compromise of the affected server. The CVSS 4.0 score is 5.2 (medium severity), reflecting network attack vector, low attack complexity, and privileges required. No known exploits have been reported in the wild yet. The recommended remediation is to upgrade to patched versions 5.8.21 or 4.16.17 where the issue is fixed. This vulnerability highlights the risks of enabling administrative change settings in production and the importance of strict access controls on template-editing features.
Potential Impact
For European organizations, the impact of CVE-2025-68454 can be significant if exploited. Successful RCE could lead to full server compromise, data theft, defacement, or use of the server as a pivot point for further attacks within the network. Organizations running Craft CMS in digital experience platforms, especially those managing sensitive customer data or critical business applications, face confidentiality, integrity, and availability risks. The requirement for authenticated access limits exposure to insider threats or compromised credentials but does not eliminate risk, particularly in environments with weak access controls or shared credentials. The vulnerability could disrupt services, damage reputation, and incur regulatory penalties under GDPR if personal data is exposed. Given Craft CMS's use in various industries including media, e-commerce, and government websites, the threat is relevant across sectors. The lack of known exploits currently provides a window for proactive patching and mitigation before widespread attacks occur.
Mitigation Recommendations
1. Immediately upgrade Craft CMS installations to versions 5.8.21 or 4.16.17 where the vulnerability is patched. 2. Disable the allowAdminChanges setting in all non-development environments to prevent unauthorized administrative changes. 3. Restrict access to the Craft Control Panel strictly to trusted administrators using network segmentation, VPNs, or IP whitelisting. 4. Audit user roles and permissions to ensure only necessary accounts have access to the System Messages utility and other template-editing features. 5. Implement strong authentication mechanisms such as multi-factor authentication (MFA) for all accounts with control panel access. 6. Monitor logs for suspicious template input or unusual activity in the control panel and system messages. 7. Conduct regular security reviews and penetration testing focused on template injection and code execution vectors. 8. Educate administrators about the risks of enabling allowAdminChanges in production and enforce secure configuration baselines. 9. Consider web application firewalls (WAFs) with custom rules to detect and block suspicious Twig template payloads if patching is delayed. 10. Maintain an incident response plan to quickly address any suspected exploitation.
Affected Countries
Germany, United Kingdom, France, Netherlands, Sweden, Italy, Spain, Poland, Belgium, Ireland
CVE-2025-68454: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in craftcms cms
Description
CVE-2025-68454 is a medium-severity vulnerability in Craft CMS versions 4. 0. 0-RC1 through 4. 16. 16 and 5. 0. 0-RC1 through 5. 8. 20 that allows authenticated users to perform remote code execution (RCE) via Server-Side Template Injection (SSTI) in Twig templates. Exploitation requires administrator access with allowAdminChanges enabled or non-admin access with System Messages utility permissions.
AI-Powered Analysis
Technical Analysis
CVE-2025-68454 is a vulnerability classified under CWE-1336, involving improper neutralization of special elements used in the Twig template engine within Craft CMS. The affected versions span from 4.0.0-RC1 up to 4.16.16 and 5.0.0-RC1 up to 5.8.20. The root cause is that certain text fields within the Craft Control Panel and the System Messages utility accept Twig template input without adequate sanitization, allowing an attacker with authenticated access to inject malicious Twig code. This injection leverages the Twig `map` filter to craft payloads that execute arbitrary code on the server, resulting in remote code execution (RCE). Exploitation requires either administrator privileges with the allowAdminChanges setting enabled—which is discouraged for production environments—or a non-administrator account that has access to the System Messages utility. The vulnerability does not require user interaction beyond authentication and can lead to full compromise of the affected server. The CVSS 4.0 score is 5.2 (medium severity), reflecting network attack vector, low attack complexity, and privileges required. No known exploits have been reported in the wild yet. The recommended remediation is to upgrade to patched versions 5.8.21 or 4.16.17 where the issue is fixed. This vulnerability highlights the risks of enabling administrative change settings in production and the importance of strict access controls on template-editing features.
Potential Impact
For European organizations, the impact of CVE-2025-68454 can be significant if exploited. Successful RCE could lead to full server compromise, data theft, defacement, or use of the server as a pivot point for further attacks within the network. Organizations running Craft CMS in digital experience platforms, especially those managing sensitive customer data or critical business applications, face confidentiality, integrity, and availability risks. The requirement for authenticated access limits exposure to insider threats or compromised credentials but does not eliminate risk, particularly in environments with weak access controls or shared credentials. The vulnerability could disrupt services, damage reputation, and incur regulatory penalties under GDPR if personal data is exposed. Given Craft CMS's use in various industries including media, e-commerce, and government websites, the threat is relevant across sectors. The lack of known exploits currently provides a window for proactive patching and mitigation before widespread attacks occur.
Mitigation Recommendations
1. Immediately upgrade Craft CMS installations to versions 5.8.21 or 4.16.17 where the vulnerability is patched. 2. Disable the allowAdminChanges setting in all non-development environments to prevent unauthorized administrative changes. 3. Restrict access to the Craft Control Panel strictly to trusted administrators using network segmentation, VPNs, or IP whitelisting. 4. Audit user roles and permissions to ensure only necessary accounts have access to the System Messages utility and other template-editing features. 5. Implement strong authentication mechanisms such as multi-factor authentication (MFA) for all accounts with control panel access. 6. Monitor logs for suspicious template input or unusual activity in the control panel and system messages. 7. Conduct regular security reviews and penetration testing focused on template injection and code execution vectors. 8. Educate administrators about the risks of enabling allowAdminChanges in production and enforce secure configuration baselines. 9. Consider web application firewalls (WAFs) with custom rules to detect and block suspicious Twig template payloads if patching is delayed. 10. Maintain an incident response plan to quickly address any suspected exploitation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-12-17T20:22:35.081Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 695c36383839e44175942eae
Added to database: 1/5/2026, 10:07:52 PM
Last enriched: 1/13/2026, 12:59:33 AM
Last updated: 2/6/2026, 7:55:16 PM
Views: 42
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.
Related Threats
CVE-2026-2064: Cross Site Scripting in Portabilis i-Educar
MediumCVE-2026-25727: CWE-121: Stack-based Buffer Overflow in time-rs time
MediumCVE-2026-25643: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in blakeblackshear frigate
CriticalCVE-2026-1709: Key Exchange without Entity Authentication in Red Hat Red Hat Enterprise Linux 10
CriticalCVE-2025-15320: Multiple Binds to the Same Port in Tanium Tanium Client
LowActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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.