MediumGHSA-596p-6jv8-775v

Craft CMS: Authenticated leak of secret environment variables

Affected versions5.0.0-RC1 to before 5.10.6, 4.0.0-RC1 to before 4.18.2 - fixed in 5.10.6

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. The 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. However, the same request parameter `elementId,` which allows for sandboxed Twig templates to be rendered, also includes functionalit

Is your site exposed?Run a free passive scan. See your platform, versions and the issues on your surface in under a minute.
Check if my site is affected

Inside rootscan

Illustrative rootscan dashboard

Illustrative product preview with sample data. Explore an interactive sample finding

Connect your Shopify store

Connect once. Keep watch.

Enter your store address to prepare your connection.

Website preview: this prepares a connection summary. No app is installed and no scan runs.

Check this website

No account needed for the free scan.

The free public scan needs no account and does not log in to the site. If you later buy a pentest, you will create an account, prove you control the target, and tick a permission checkbox before any active test starts.

Run the free scan Already have an account? Sign in

No active test starts until you authorize it in the app.