Duplicate Advisory: Craft CMS: Authenticated leak of secret environment variables
Description
Craft CMS versions 4.0.0-RC1 before 4.18.2 and 5.0.0-RC1 before 5.10.6 contain a vulnerability where environment variables and secrets are interpolated into Twig templates even when sandboxing is enabled. An authenticated attacker with control panel access can exploit this to leak sensitive environment variables incrementally using a blind error-based technique. This can lead to session forgery, privilege escalation, and theft of credentials such as database, SMTP, API, or blob storage keys. The issue is fixed in versions 4.18.2 and 5.10.6.
CVSS v3.1
Score 6.5medium
Affected software
Run 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
Craft CMS versions >=4.0.0-RC1 before 4.18.2 and >=5.0.0-RC1 before 5.10.6 interpolate environment variables and secrets via ${ENV_VAR} strings in the elementId parameter into Twig templates prior to rendering, even with the Twig sandbox enabled. An authenticated attacker with control panel access can render malicious sandboxed Twig templates and use a blind error-based technique over multiple requests to leak arbitrary environment variables and secrets. These leaked secrets can be abused to forge sessions (using CRAFT_SECURITY_KEY), escalate privileges, and steal credentials for database, SMTP, API, or blob storage. The vulnerability is addressed in versions 4.18.2 and 5.10.6.
Potential Impact
An authenticated attacker with control panel access can incrementally leak sensitive environment variables and secrets, potentially allowing session forgery, privilege escalation, and theft of critical credentials such as database, SMTP, API, or blob storage keys. This compromises confidentiality but does not affect integrity or availability directly.
Mitigation Recommendations
This vulnerability is fixed in Craft CMS versions 4.18.2 and 5.10.6. Users should upgrade to these versions or later to remediate the issue. No other mitigations are indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-cc2g-26rw-g997
- Osv Schema Version
- 1.4.0
- Ecosystems
- ["Packagist"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a9845c7acd9273b496affbd
Added to database: 09/02/2026, 15:50:31 UTC
Last enriched: 09/07/2026, 18:23:01 UTC
Last updated: 10/04/2026, 01:11:25 UTC
Views: 78
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.
External Links
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.