CVE-2026-48806
published high CVSS 4.0 · 7.1Twig: Sandbox `__toString()` policy bypass via dynamic mapping keys
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| twigphp | — | Twig< 3.27.0 | Affected | Not stated | GitHub_M |
Description
Twig is a template language for PHP. Prior to 3.27.0, ArrayExpression does not guard dynamic mapping keys that are coerced to strings, allowing PHP to invoke __toString() on a Stringable object used as a mapping key without calling SandboxExtension::ensureToStringAllowed(). This issue is fixed in version 3.27.0.
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
- 7.1 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- 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
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| twigphp | Twig | < 3.27.0 (affected) | GitHub_M · cna |
Weaknesses
2- CWE-693 CWE-693: Protection Mechanism Failure
- CWE-863 CWE-863: Incorrect Authorization
References
3Provider assertions
2GitHub_M · cna
Twig: Sandbox `__toString()` policy bypass via dynamic mapping keys
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 90af27046624c659f18e0da0f50bb4d2a30b301f4da8010b515c82ed8d52e0b7
- Ingested
- 23 Sep 2026, 09:17:37 UTC
- Source record
- Official CVE record