Skip to main content

Craft CMS: Authenticated leak of secret environment variables (CVE-2026-72782)

0
Medium
Published: 08/06/2026 (08/06/2026, 21:53:31 UTC)
Source: GCVE Database
Product: craftcms/cms

Description

Craft CMS versions 4.0.0-RC1 through before 4.18.2 and 5.0.0-RC1 through before 5.10.6 contain a vulnerability where authenticated users with control panel access can leak secret environment variables. This occurs because environment variables are interpolated into Twig templates even when the Twig sandbox is enabled, allowing secrets to be extracted via blind error-based techniques. The vulnerability enables attackers to incrementally exfiltrate sensitive secrets such as the CRAFT_SECURITY_KEY, database credentials, and API keys, potentially leading to session forgery and privilege escalation.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vuln. Confidentiality
Low
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Affected software

Packagistghsa
craftcms/cms
Affected versions
>=5.0.0-RC1 <5.10.6
Packagistghsa
craftcms/cms
Affected versions
>=4.0.0-RC1 <4.18.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/13/2026, 15:02:45 UTC

Technical Analysis

In affected Craft CMS versions, environment variables and secrets are replaced in Twig templates during rendering, even when the Twig sandbox is enabled. The sandbox was intended to prevent remote code execution and unauthorized access to environment variables. However, the interpolation of environment variables via the elementId request parameter allows an authenticated attacker to leak secrets by rendering malicious sandboxed Twig templates. Although direct output of the secrets is not reflected in responses, attackers can use blind error-based methods to exfiltrate secrets over multiple requests. This flaw undermines the protection provided by the Twig sandbox and exposes critical environment secrets to authenticated control panel users.

Potential Impact

An authenticated attacker with control panel access can steal arbitrary environment variables and secrets, including the CRAFT_SECURITY_KEY, database credentials, SMTP credentials, and API keys. This can lead to session forgery, privilege escalation, and unauthorized access to connected services. The vulnerability affects confidentiality of sensitive data but requires authenticated access with elevated privileges.

Mitigation Recommendations

A patch is available for this vulnerability. Users should upgrade to Craft CMS versions 4.18.2 or later and 5.10.6 or later where this issue is fixed. Applying the official patch eliminates the environment variable interpolation flaw and restores the intended security of the Twig sandbox. No additional mitigations are required if the patch is applied.

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

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-596p-6jv8-775v
Osv Schema Version
1.4.0
Ecosystems
["Packagist"]
Database Specific Severity
MODERATE
Cvss Version
4.0

Threat ID: 6a7573b9bf8831d539d940b3

Added to database: 08/07/2026, 05:57:13 UTC

Last enriched: 09/13/2026, 15:02:45 UTC

Last updated: 09/22/2026, 14:37:17 UTC

Views: 49

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