CVE-2026-133764

NameCVE-2026-133764
DescriptionThe 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
php-twig (PTS)bookworm, bookworm (security)3.5.1-1+deb12u3vulnerable
trixie (security), trixie3.27.0-0+deb13u1vulnerable
forky3.30.0-1vulnerable
sid3.31.1-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
php-twigsource(unstable)3.31.1-1

Notes

https://symfony.com/blog/cve-2026-133764-sandbox-tostring-policy-bypass-via-the-input-of-custom-tests
https://github.com/twigphp/Twig/security/advisories/GHSA-rc9g-xwx4-rmfh
https://github.com/twigphp/Twig/commit/978c60be74fc62a0f2c3af11ca5bc3609ae8b69a (v3.31.1)

Search for package or bug name: Reporting problems