Template Language Vulnerability in Twig by Twig
CVE-2026-48806
7.1HIGH
What is CVE-2026-48806?
Twig, a widely-used PHP template language, contains a vulnerability related to how dynamic mapping keys are handled within ArrayExpressions. In versions prior to 3.27.0, the framework does not adequately guard against coercing dynamic keys to strings. This oversight allows PHP to call the __toString() method on Stringable objects without the necessary safeguards from SandboxExtension::ensureToStringAllowed(). This could potentially lead to unexpected behavior or security issues when processing template data. Users are recommended to upgrade to version 3.27.0 or later to mitigate this risk.
Affected Version(s)
Twig < 3.27.0
