---
title: "CVE-2026-46633: Twig: PHP code injection via `{% use %}` template name"
url: https://erroneo.us/security/cve/CVE-2026-46633/
description: "CVE-2026-46633 (twig/twig (Composer (PHP))): Twig is a template language for PHP. Prior to 3.26.0, Compiler::string() does not escape single quotes when a…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-07-14
date_modified: 2026-07-16
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-46633"
kev: false
cvss: 8.7
epss: 0.00688
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2026-46633: Twig: PHP code injection via `{% use %}` template name

**Signal:** Normal patch cycle. No exploitation signal; fix it in your next routine update if you are affected. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.7% , percentile 52: FIRST’s model estimates a 0.7% chance of exploitation activity in the next 30 days, higher than 52% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Needs an account (low (any account)). Exposure depends on who can log in.
- Only applies if your dependency tree includes twig/twig (Composer (PHP)) < 3.26.0, fixed in 3.26.0 . Check your lockfile, including transitive dependencies.

## What it is

Twig is a template language for PHP. Prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.

## Affected packages

- Composer (PHP) `twig/twig` < 3.26.0 → fixed: 3.26.0

## Affected products (CVE record)

- twigphp Twig: < 3.26.0

## Severity

- GitHub_M CVSS 4.0: 8.7 `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- GitHub CVSS 4.0: 9.3 `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable no , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.69% probability of exploitation activity in the next 30 days; percentile 52.

## Sources

- [GitHub Advisory GHSA-7p85-w9px-jpjp](https://github.com/advisories/GHSA-7p85-w9px-jpjp)
- [CVE.org record CVE-2026-46633](https://www.cve.org/CVERecord?id=CVE-2026-46633)
- [NVD entry CVE-2026-46633](https://nvd.nist.gov/vuln/detail/CVE-2026-46633)
- [github.com](https://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp)
- [github.com](https://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8)
- [github.com](https://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3)
- [github.com](https://github.com/twigphp/Twig/releases/tag/v3.26.0)
- [github.com](https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml)
- [symfony.com](https://symfony.com/cve-2026-46633)

---
Source page: https://erroneo.us/security/cve/CVE-2026-46633/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
