CVE-2026-133769: Sandbox property allow-list bypass via `html_cva()` variant values
Cva::apply() converted the values of variants, default variants and compound variants with (array). These values come from the arguments of htmlcva(). A sandboxed template could therefore pass any object of its context, and print the private and protected properties of that object:
{{ htmlcva('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 htmlcva 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.
Affected Software
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications are affected when a sandboxed Twig template is permitted to call both the html_cva function and the apply method of Twig\Extra\Html\Cva. The issue applies to composer/twig/html-extra in that configuration.
What access does an attacker need to exploit it?
An attacker needs the ability to supply or control a sandboxed template that can invoke html_cva() and Cva::apply(). They can use objects available in the template context as variant values or ArrayAccess-based variant maps.
What could exploitation expose?
A malicious sandboxed template could print private and protected properties of an object from its context. It could also select keys on ArrayAccess variant maps and print offsets returned by those objects.
What can be done if updating is not immediately possible?
Do not allow sandboxed templates to use the html_cva function or the apply method of Twig\Extra\Html\Cva. Restricting either capability prevents the affected configuration described for this issue.