Sandbox bypass in Twig join filter exposes object properties
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-863.
Summary
Twig versions from 0 before 3.31.1 are affected. The join filter converts a non-iterable value with (array) $value, so an object exposes all of its properties, including private and protected ones. A sandboxed template that is allowed to use join can print properties that the sandbox policy denies, and CWE-863 applies. An attacker needs only a template that the sandbox permits to use join, over a network with low privileges.
Written with Claude Haiku 5.5 from the sources below · 2026-11-24
Description from the CNA
The join filter converted a value that isn't iterable with (array) $value. For an object, that gives every property, including the private and protected ones. A sandboxed template allowed to use join could therefore print properties that the policy denies, and that templates can't read otherwise: {{ user|join(',') }} A value that isn't iterable is now joined as a single item. A Stringable object prints its checked string, and other objects throw, as with the first and last filters.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Upgrade twig/twig to 3.31.1, which is the fixed version. A non-iterable value is now joined as a single item, and a Stringable object prints its checked string.
Written with Claude Haiku 5.5 from the sources below · 2026-11-24
- Fix · CNA twig/twig (Twig) Fixed in 3.31.1
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
twig/twig 3.31.1
7 records Highest priority Priority LOW 7 LOW
Other records, highest priority first
- TI-2026-97281 Twig sandbox bypass through dynamic embed parent expressionsPriority LOW 25
- TI-2026-97279 Sandbox toString() policy bypass in Twig via assignmentsPriority LOW 25
- TI-2026-97277 Sandbox toString policy bypass via is true test in TwigPriority LOW 25
Timeline
- 2026-11-24 Threatist record created from CVE-2026-133768
References
More Twig vulnerabilities
- TI-2026-97281 Twig sandbox bypass through dynamic embed parent expressions CVSS 4.0MEDIUM 5.3
- TI-2026-97279 Sandbox toString() policy bypass in Twig via assignments CVSS 4.0MEDIUM 5.3
- TI-2026-97277 Sandbox toString policy bypass via is true test in Twig CVSS 4.0MEDIUM 5.3
- TI-2026-97287 Unbounded converter cache in Twig markdown-extra exhausts memory CVSS 4.0LOW 2.3
- TI-2026-97286 Sandbox bypass in Twig guard tag lets templates use disallowed tags CVSS 4.0LOW 2.3
- TI-2026-97285 Twig skips autoescaping for variables named like import aliases CVSS 4.0LOW 2.3
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences