CVE-2026-72782: Craft CMS Authenticated Leak Of Secret Environment Vulnerability
MODERATECVE-2026-72782 is a MODERATE authenticated leak of secret environment vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Craft CMS libraries in the Packagist ecosystem. The issue involves authenticated leak of secret environment variables. Remediation is available by upgrading affected packages to version 5.10.6, 4.18.2.
CVE-2026-72782 at a Glance
How to Fix CVE-2026-72782
To remediate this vulnerability, upgrade all affected Craft CMS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade craftcms/cms to 5.10.6
Upgrade craftcms/cms to 4.18.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for craftcms/cms
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-72782, inspect your project dependencies for Craft CMS:
inspect dependencies for craftcms/cms
Analyze the terminal output to locate any version of Craft CMS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.10.6), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Craft CMS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-72782 Affected Craft CMS Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
craftcms/cms
|
Packagist |
≥ 5.0.0-RC1
< 5.10.6
|
5.10.6
|
|
craftcms/cms
|
Packagist |
≥ 4.0.0-RC1
< 4.18.2
|
4.18.2
|
References
Frequently Asked Questions
What is CVE-2026-72782?
Which Craft CMS versions are affected?
What version fixes CVE-2026-72782?
Is craftcms/cms affected?
What CWE is associated with CVE-2026-72782?
How can I check Packagist dependencies for CVE-2026-72782?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-596p-6jv8-775v",
"modified" : "2026-09-01T21:06:54Z",
"published" : "2026-08-06T21:53:31Z",
"aliases" : [ "CVE-2026-72782" ],
"summary" : "Craft CMS: Authenticated leak of secret environment variables",
"details" : "Environment variables and secrets are interpolated into a Twig template even when the Twig sandbox is enabled, allowing them to be leaked by an authenticated attacker.\n\nThe Craft vulnerability [CVE-2026-31857](https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc) was only patched by applying sandboxed Twig templating. This theoretically protects Craft CMS against RCE attacks, provided the sandbox is enabled and secure, with no known bypasses.\n\nHowever, the same request parameter `elementId,` which allows for sandboxed Twig templates to be rendered, also includes functionality that interpolates referenced environment variables. If the parameter includes a string of the form `${ENV_VAR}` then the string is replaced with the environment variable or secret from a secrets file with that name.\n\nAfterward, the string is rendered as a Twig template. If the sandbox is disabled, Twig templates can already gain RCE or access environment variables using the getenv function. Sandboxed Twig templates should not have this access, but now do thanks to this additional environment-variable replacement behavior.\n\nThe template’s resulting value is not directly reflected in the response. To exfiltrate the value, the sandboxed Twig template cannot use network functions. But it can use a blind error-based approach similar to blind SQL injection. With enough requests, any environment variable or secret can be incrementally leaked. This can be abused to forge a session, escalate privileges with the `CRAFT_SECURITY_KEY`, and steal credentials for the database, SMTP server, or other connected APIs or blob storage.\n\n## Impact\n\nAn authenticated attacker, with permission to access the control panel, can render a malicious Twig template and steal arbitrary environment variables and secrets with a large number of requests, even if the Twig sandbox is enabled through `enableTwigSandbox()`.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/cms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0-RC1"
}, {
"fixed" : "5.10.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/cms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0-RC1"
}, {
"fixed" : "4.18.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/security/advisories/GHSA-596p-6jv8-775v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-72782"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/craftcms/cms"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/releases/tag/4.18.2"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/releases/tag/5.10.6"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/craft-cms-rc1-before-environment-variable-leak"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-668" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-06T21:53:31Z",
"nvd_published_at" : null
}
}