CVE-2026-133768: Sandbox property allow-list bypass via the `join` filter on non-iterable objects
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.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using Twig's sandbox mode where templates can apply the join filter to object values are exposed. The issue matters when those objects contain private or protected properties that the sandbox policy would otherwise deny.
What does an attacker need to exploit it?
An attacker needs the ability to cause a sandboxed Twig template to run the join filter on a non-iterable object, such as {{ user|join(',') }}. This can cause the object's properties, including private and protected ones, to be converted and printed.
How does the corrected behavior affect templates?
A non-iterable value is now treated as a single item for joining. Stringable objects produce their checked string representation, while other objects throw an error, consistent with the first and last filters.