CVE-2026-48807
HIGH 7.1CVSS 4.0Twig: Sandbox `__toString()` policy bypass via `Traversable` in `join` and `replace` filters
Twig is a template language for PHP. Prior to 3.27.0, the sandbox __toString() checks do not fully cover Traversable values passed to join and replace filters or operands evaluated by the in and not in operators, allowing contained Stringable objects to be coerced to strings without consulting the sandbox policy. This issue is fixed in version 3.27.0.
- Published
- 14 Jul 2026
- Last modified
- 24 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-693CWE-863
- Also known as
- GHSA-8x9c-rmqh-456c
- Sources
- NVDJSONOSV GHSA-8x9c-rmqh-456cJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 7.1 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | symfony | twigcpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:* |
< 3.27.0 | 3.27.0 |
| OSV | Packagist | twig/twig | < 3.27.0 | 3.27.0 |
References
- https://github.com/twigphp/Twig/releases/tag/v3.27.0 · Release Notes, WEB
- https://github.com/twigphp/Twig/security/advisories/GHSA-8x9c-rmqh-456c · Vendor Advisory, WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-48807.yaml · WEB
- https://github.com/twigphp/Twig · PACKAGE
- https://symfony.com/blog/cve-2026-48807-sandbox-tostring-policy-bypass-via-traversable-in-join-replace-and-in-not-in-operators · WEB
History
- 25 Nov 2026 21:03 UTC · NVD: first stored (published 14 Jul 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 30 Jun 2026)