CVE-2026-48806 Details
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.
A sandbox policy bypass vulnerability has been identified in Twig versions prior to 3.27.0. The issue arises in the ArrayExpression component, which fails to properly guard dynamic mapping keys that are converted to strings. This oversight allows PHP to directly invoke the __toString() method on Stringable objects used as mapping keys, bypassing the necessary sandbox checks. The vulnerability can be exploited by using a dynamic key expression that resolves to a Stringable object, such as a context variable, in an array mapping. This exploitation triggers the __toString() call without proper authorization, leading to a potential unauthorized disclosure of sensitive data.
Users can upgrade to Twig version 3.27.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 15, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-693 | Protection Mechanism Failure | [email protected] |
| CWE-863 | Incorrect Authorization | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| symfony twig | < 3.27.0 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 24, 2026 | CVE Translated | [email protected] |
| Jul 17, 2026 | Initial Analysis | [email protected] |
| Jul 15, 2026 | CVE Modified | CISA-ADP |
| Jul 14, 2026 | New CVE Received | [email protected] |