CVE-2026-48806

CRITICAL

Twig: Sandbox `__toString()` policy bypass via dynamic mapping keys

Title source: cna
STIX 2.1

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.

Scores

CVSS v3 9.1
EPSS 0.0023
EPSS Percentile 14.4%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

CISA SSVC

Vulnrichment
Exploitation none
Automatable no
Technical Impact partial

Details

CWE
CWE-693 CWE-863
Status published
Products (2)
symfony/twig < 3.27.0
twigphp/Twig < 3.27.0
Published Jul 14, 2026
Tracked Since Jul 15, 2026