# CVE-2026-133764: Sandbox `__toString()` policy bypass via the input of custom tests

- Severity: Low 2.3 (CVSS:4.0, scored by Symfony) `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.53%, higher than 46% of CVEs (2026-12-01)
- Published: 2026-11-24T13:07:47.621Z
- Modified: 2026-12-01T20:18:25.113Z
- Weaknesses: CWE-693, CWE-863
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Symfony

## Description

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.

(As written by CVE List.)

## Affected

- twig/twig: before 3.31.1

## References

- <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)

## Sources

- CVE List: [CVE-2026-133764](https://www.cve.org/CVERecord?id=CVE-2026-133764), CVE Terms of Use, modified 2026-12-01
- NVD: [CVE-2026-133764](https://nvd.nist.gov/vuln/detail/CVE-2026-133764), Public domain, modified 2026-12-01

---

Page: https://cve.day/CVE-2026-133764 · Whole record: https://cve.day/CVE-2026-133764.json · Rebuilt by cve.day 2026-12-01T20:32:30.469Z
