CVE-2026-115935: CWE-94 Improper Control of Generation of Code ('Code Injection') in craftcms cms
Description
CVE-2026-115935 is a high-severity code injection vulnerability in CraftCMS that allows authenticated non-admin users with control panel access to inject a new security key into the .env file via crafted API response headers. This enables the attacker to forge signed login redirects containing Twig system() callbacks, potentially leading to remote code execution. The vulnerability affects CraftCMS versions 4.0.0 up to but not including 4.18.9, and 5.0.0 up to but not including 5.11.2.
CVSS v4.0
Score 8.7high
Affected software
craftcms
cms
pkg:composer/craftcms/cmsRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from the app/process-api-response-headers action in CraftCMS, which accepts fake API response headers from any authenticated control panel user. A non-admin user with accessCp permission can insert newline characters into the X-Craft-Plugin-Licenses header. CraftCMS passes this header value to its .env writer without sanitizing newlines, allowing the attacker to inject a new CRAFT_SECURITY_KEY into the .env file. Once the key is loaded, the attacker can forge signed login redirects containing Twig system() callbacks, enabling code injection. This issue is distinct from a previous report that involved reading the existing key via a Twig sandbox bypass; this one replaces the key via CRLF injection in API headers. Fixing one does not mitigate the other.
Potential Impact
An authenticated non-admin user with control panel access can inject a new security key into the .env file, enabling them to forge signed login redirects with arbitrary Twig system() callbacks. This can lead to remote code execution within the context of the CraftCMS application, posing a significant security risk.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict control panel access to trusted users only and monitor for unusual activity related to API response headers. Avoid granting accessCp permission to untrusted users. Follow vendor updates closely for an official fix.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- Hackrate
- Date Reserved
- 2026-10-23T21:23:18.607Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6adbd6bad73cc49347c37226
Added to database: 10/23/2026, 21:50:50 UTC
Last enriched: 10/23/2026, 22:05:10 UTC
Last updated: 10/23/2026, 22:06:00 UTC
Views: 5
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.