CVE-2026-133764Sandbox `__toString()` policy bypass via the input of custom tests
The sandbox checks that a template may call toString() on an object before converting it to a string. It didn't check the input of tests. The PHP callable of a test may convert this input to a string, for example when its parameter is typed as string. PHP then calls toString() on an object without the sandbox checking it first: {{ obj is upperish }} Applications are affected when they register such a test and allow it in the sandbox. No built-in test is affected. The sandbox now checks the input of tests like the input of filters. The built-in tests that never convert their input to a string still skip the check.
What to do
Debian has 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 |
|---|---|---|---|---|
| Debian 14 | php-twig | Fix pending | DEBIAN-CVE-2026-133764 | |
| Debian 13 | php-twig | Fix pending | DEBIAN-CVE-2026-133764 | |
| Debian 12 | php-twig | Fix pending | DEBIAN-CVE-2026-133764 |
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: before 3.31.1; fixed in
3.31.1
Vendor advisories:
- https://symfony.com/cve-2026-133764 (vendor-advisory)
- https://github.com/twigphp/Twig/security/advisories/GHSA-rc9g-xwx4-rmfh (vendor-advisory)
- https://github.com/twigphp/Twig/commit/978c60be74fc62a0f2c3af11ca5bc3609ae8b69a (patch)
References
- https://symfony.com/cve-2026-133764
- https://github.com/twigphp/Twig/security/advisories/GHSA-rc9g-xwx4-rmfh
- https://github.com/twigphp/Twig/commit/978c60be74fc62a0f2c3af11ca5bc3609ae8b69a
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.