CVE-2026-133766Sandbox `__toString()` policy bypass via spread arguments
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.
What to do
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | php-twig | Fix pending | UBUNTU-CVE-2026-133766 | |
| Ubuntu 26.04 | php-twig | Fix pending | UBUNTU-CVE-2026-133766 | |
| Ubuntu 24.04 | php-twig | Fix pending | UBUNTU-CVE-2026-133766 | |
| Ubuntu 22.04 | php-twig | Fix pending | UBUNTU-CVE-2026-133766 | |
| Ubuntu 20.04 | php-twig | Fix pending | UBUNTU-CVE-2026-133766 | |
| Debian 14 | php-twig | Fix pending | DEBIAN-CVE-2026-133766 |
What the vendor says
As published in the CVE record by Symfony, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- twig/twig: affected: 3.28.0 to before 3.31.1; fixed in
3.31.1
Vendor advisories:
- https://symfony.com/cve-2026-133766 (vendor-advisory)
- https://github.com/twigphp/Twig/security/advisories/GHSA-56wp-8m9q-4354 (vendor-advisory)
- https://github.com/twigphp/Twig/commit/7af821c372f52cc9447afeba9e042de44b738222 (patch)
References
- https://symfony.com/cve-2026-133766
- https://github.com/twigphp/Twig/security/advisories/GHSA-56wp-8m9q-4354
- https://github.com/twigphp/Twig/commit/7af821c372f52cc9447afeba9e042de44b738222
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.