CVE-2026-133764
published low CVSS 4.0 · 2.3Sandbox `__toString()` policy bypass via the input of custom tests
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Twig | — | twig/twig0 to < 3.31.1 · Other versions: unaffected | Affected | Not stated | 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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 2.3 / 10
- Severity
- low
- Provider
- Symfony · cna
- Vector string
- 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
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Twig | twig/twig | 0 to < 3.31.1 (affected · semver)Default: unaffected | Symfony · cna |
Weaknesses
2- CWE-693 CWE-693 Protection Mechanism Failure
- CWE-863 CWE-863 Incorrect Authorization
References
3- https://github.com/twigphp/Twig/commit/978c60be74fc62a0f2c3af11ca5bc3609ae8b69a
- GHSA-rc9g-xwx4-rmfh https://github.com/twigphp/Twig/security/advisories/GHSA-rc9g-xwx4-rmfh
- CVE-2026-133764 https://symfony.com/cve-2026-133764
Provider assertions
2Symfony · cna
Sandbox `__toString()` policy bypass via the input of custom tests
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- eb7edbf70d7db3739d713cf4e7a8aa09ee455b4031c7db9566238748862f57bd
- Ingested
- 01 Dec 2026, 19:45:57 UTC
- Source record
- Official CVE record