Description
Craft CMS versions >= 5.0.0-RC1 before 5.10.6 and >= 4.0.0-RC1 before 4.18.2 interpolate environment variables and secrets (via ${ENV_VAR} strings in the elementId parameter) into Twig templates before rendering, even when the Twig sandbox is enabled. An authenticated attacker with control panel access can render a malicious sandboxed Twig template and, using a blind error-based technique across many requests, incrementally leak arbitrary environment variables and secrets. These can be abused to forge sessions (via CRAFT_SECURITY_KEY), escalate privileges, and steal database, SMTP, API, or blob storage credentials. Fixed in 5.10.6 and 4.18.2.
Published: 2026-08-11
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Craft CMS versions starting from 5.0.0‑RC1 up to 5.10.5 and from 4.0.0‑RC1 up to 4.18.1 allow crafted elementId parameters containing ${ENV_VAR} placeholders to be processed by Twig. The framework interpolates these placeholders into the template before rendering, even when the Twig sandbox is active. This flaw enables an attacker who can log into the control panel to inject a malicious sandboxed Twig template and, through a blind error‑based approach over multiple requests, read arbitrary environment variables and secrets. The exposed data can be used to forge sessions, elevate privileges, or steal database, SMTP, API, or blob storage credentials.

Affected Systems

The vulnerability affects Craft CMS 5.x from 5.0.0‑RC1 to 5.10.5 and Craft CMS 4.x from 4.0.0‑RC1 to 4.18.1. Both product lines expose the flaw via the elementId parameter in the control panel.

Risk and Exploitability

The CVSS score is 7.1, indicating a high severity level. The EPSS score is not available and the vulnerability is not listed in CISA KEV, so it is not known to have active public exploits yet. Based on the description, it is inferred that an attacker must first gain authenticated control panel access, create an element with a crafted elementId, and then repeatedly render the template to leak environment variables incrementally via a blind error‑based technique. Once the secrets are revealed, an attacker could forge session cookies, elevate privileges, or obtain critical credentials. Given the moderate‑to‑high likelihood of exploitation once authenticated, immediate mitigation is recommended.

Generated by OpenCVE AI on August 11, 2026 at 23:35 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Craft CMS to version 5.10.6 or 4.18.2, which contains the patch that stops environment variable interpolation.
  • Limit control panel access to trusted administrators and disable the elementId feature that accepts environment variable placeholders.
  • Implement server‑level restrictions that prevent Twig from processing ${…} placeholders, or monitor for abnormal sandboxed template activity.

Generated by OpenCVE AI on August 11, 2026 at 23:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 11 Aug 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 11 Aug 2026 12:45:00 +0000

Type Values Removed Values Added
Description Craft CMS versions >= 5.0.0-RC1 before 5.10.6 and >= 4.0.0-RC1 before 4.18.2 interpolate environment variables and secrets (via ${ENV_VAR} strings in the elementId parameter) into Twig templates before rendering, even when the Twig sandbox is enabled. An authenticated attacker with control panel access can render a malicious sandboxed Twig template and, using a blind error-based technique across many requests, incrementally leak arbitrary environment variables and secrets. These can be abused to forge sessions (via CRAFT_SECURITY_KEY), escalate privileges, and steal database, SMTP, API, or blob storage credentials. Fixed in 5.10.6 and 4.18.2.
Title Craft CMS 5.0.0-RC1 before 5.10.6 Environment Variable Leak
First Time appeared Craftcms
Craftcms craft Cms
Weaknesses CWE-668
CPEs cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:*
Vendors & Products Craftcms
Craftcms craft Cms
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 7.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Craftcms Craft Cms
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-11T17:50:10.062Z

Reserved: 2026-08-10T15:10:15.962Z

Link: CVE-2026-72782

cve-icon Vulnrichment

Updated: 2026-08-11T17:40:58.281Z

cve-icon NVD

Status : Deferred

Published: 2026-08-11T13:19:08.797

Modified: 2026-08-28T18:45:00.010

Link: CVE-2026-72782

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T10:45:03Z

Weaknesses
  • CWE-668

    Exposure of Resource to Wrong Sphere