Template Language Vulnerability in Twig by Twig
CVE-2026-48806

7.1HIGH

Key Information:

Vendor

TwigPHP

Status
Vendor
CVE Published:
14 July 2026

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

References

CVSS V4

Score:
7.1
Severity:
HIGH
Confidentiality:
High
Integrity:
Low
Availability:
None
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
None

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.