CVE-2026-46639
High · 8.8Twig: Sandbox property and method bypass via object-destructuring assignment
CVSS
8.8
EPSS
0.4%
Published
May 21, 2026
CISA due date
—
The record
The object-destructuring assignment syntax introduced in Twig 3.24.0 generates a call to `CoreExtension::getAttribute()` with the `$sandboxed` argument hardcoded to `false`, regardless of whether a `SandboxExtension` is active. This permanently disables the sandbox's property and method policy checks for every destructuring expression. `ObjectDestructuringSetBinary::compile()` emits: ```php CoreExtension::getAttribute($this->env, $this->source, ..., \Twig\Template::ANY_CALL, false, false, false, ...); // ^^^^^ // sandbox check never runs ``` Whereas `GetAttrExpression::compile()` correctly passes `$env->hasExtension(SandboxExtension::class)`. An attacker with write access to a sandboxed Twig template can read any public property or invoke any public getter on objects passed to the template engine, bypassing `SecurityPolicy` restrictions. The exploit requires only the `{% do %}` tag to be in `allowedTags`, which is a common configuration.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-113730 OGNL is an Object Graph Navigation Library for Java. CWE-693
- CVE-2026-112077 A vulnerability was detected in radareorg radare2 6.2.0/6.2.2. CWE-693
- CVE-2026-88838 A flaw was found in BusyBox's mount utility. CWE-693
- CVE-2026-101899 Axios is a promise-based HTTP client for the browser and Node.js. CWE-693
- CVE-2026-107226 The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP… CWE-693
- CVE-2026-107697 FFmpeg before 8.1.3 contains a protection mechanism failure in the HLS demuxer that… CWE-693
- CVE-2026-105083 ImageMagick before 7.1.2-32 and 6.9.13-57 contains a policy bypass vulnerability in… CWE-693
- CVE-2026-101900 Axios is a promise-based HTTP client for the browser and Node.js. CWE-693