Twig html-extra sandbox bypass via html_cva() variant values
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- 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\Extra\Html\Cva::apply() converted variant values with (array), so a sandboxed template could pass any object from its context through html_cva() and print that object's private and protected properties. Variant maps that were ArrayAccess objects were also read with a template-chosen key, bypassing the sandbox property check, and the template printed whatever offsets the object returned. Applications are affected when the sandbox allows the html_cva function and the apply method of Twig\Extra\Html\Cva, and the weakness is CWE-863 (Incorrect Authorization). The CVSS 4.0 base score is 2.3 (LOW).
Written with Claude Haiku 5.5 from the sources below · 2026-11-24
Description from the CNA
Cva::apply() converted the values of variants, default variants and compound variants with (array). These values come from the arguments of html_cva(). A sandboxed template could therefore pass any object of its context, and print the private and protected properties of that object: {{ html_cva('base', {c: {p: user}}).apply({c: 'p'}) }} Variant maps that are ArrayAccess objects were also read with a key that the template chooses, without the property check of the sandbox. The template then printed the offsets that the object returned. Applications are affected when the sandbox allows the html_cva function and the apply method of Twig\Extra\Html\Cva. A value that isn't an array is now treated as a single item, so objects are dropped and never match a variant. Variant maps are also only used when they're arrays.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Upgrade twig/html-extra to 3.31.1 or later. Versions from 3.12.0 before 3.31.1 are affected. The fix treats a value that is not an array as a single item, so objects never match a variant, and uses variant maps only when they are arrays.
Written with Claude Haiku 5.5 from the sources below · 2026-11-24
- Fix · CNA twig/html-extra (Twig) Fixed in 3.31.1
Timeline
- 2026-11-24 Threatist record created from CVE-2026-133769
References
More Twig vulnerabilities
- TI-2026-97282 Sandbox bypass in Twig join filter exposes object properties CVSS 4.0MEDIUM 5.3
- 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
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences