Code Injection Flaw in Twig Template Language Affecting PHP Applications
CVE-2026-46633

8.7HIGH

Key Information:

Vendor

TwigPHP

Status
Vendor
CVE Published:
14 July 2026

Key facts: CVE-2026-46633 is a high severity (CVSS 8.7) vulnerability in TwigPHP Twig. No exploitation in the wild or public proof-of-concept has been recorded so far. Its EPSS score is 0.7%, the estimated probability of exploitation in the next 30 days.

What is CVE-2026-46633?

CVE-2026-46633 is a vulnerability found in the Twig template language, which is widely utilized in PHP applications for rendering templates. This flaw, present in versions prior to 3.26.0, arises from an insufficient escaping mechanism in the Compiler::string() function. Specifically, when a template name is derived from a {% use %} tag within a single-quoted PHP string literal, the vulnerability allows the crafted template name to end the string prematurely. As a result, this facilitates the injection of arbitrary PHP expressions into the compiled cache file, which poses a significant security risk to affected applications. Organizations relying on Twig for PHP templating could face severe consequences if this vulnerability is exploited, including unauthorized code execution and potential system compromise.

Potential impact of CVE-2026-46633

  1. Arbitrary Code Execution: The vulnerability enables attackers to inject malicious PHP code into a Twig template, which could be executed on the server, allowing them to execute arbitrary commands and gain control over the application or broader system.

  2. Data Breach Risks: The ability to execute arbitrary code increases the likelihood of data theft or exposure, posing significant risks to sensitive information managed by the affected PHP applications. This could lead to compliance violations and loss of customer trust.

  3. Cache Compromise: Exploitation of this vulnerability can lead to the manipulation of cached templates, potentially altering the output of the application in malicious ways, further increasing the attack surface and making it difficult for administrators to trace the source of the issue.

Affected Version(s)

Twig < 3.26.0

References

Browse all analysed vulnerabilities ›

CVSS V4

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

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.