CVE-2026-133766
Description
Since Twig 3.28.0, the sandbox skips the toString() check of an argument whose PHP parameter can't hold a string, like an int. A spread argument was mapped to a single parameter, although it fills every parameter from its position on. A sandboxed template could therefore call a denied toString() method: {{ tag(...[1, obj]) }} Here, the first parameter of tag() is an int, and a later one accepts strings. Applications are affected when they allow such a function, filter or test in the sandbox. No built-in callable is affected. A spread argument is now checked unless every parameter that it can fill has a safe type.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or — if you've already worked around this in production — publish your fix to the community-verified tier.
Propose a mitigation on Community Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
Debian Fixed 4 releases
| Version | Package | Status | Fixed in |
|---|---|---|---|
| trixie | php-twig |
Not affected | — |
| sid | php-twig |
Fixed | 3.31.1-1 |
| forky | php-twig |
Fixed | 3.31.1-1 |
| bookworm | php-twig |
Not affected | — |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| Packagist | twig/twig | >=3.28.0,<3.31.1 | |
Application impact
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| twig | twig_twig | {"startIncluding":"3.28.0","endExcluding":"3.31.1"} | 3.31.1 |
References
CWEs
CWE-693 CWE-863
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.