Advisory record · GHSA-7p85-w9px-jpjp

Twig: PHP code injection via `{% use %}` template name

CVSS 8.7 HighEPSS 0.0077 · 56th percentile

Published by the GitHub Advisory Database at 21 May 2026, 21:24 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

PackageEcosystemAffectedFixed in
twig/twigPackagist>=1.15.1, <3.26.03.26.0
Identifiers
GHSA-7p85-w9px-jpjp · CVE-2026-46633 · PKSA-h8hf-ytnd-5t9q
Weakness (CWE)
CWE-94
Published
21 May 2026
Updated
4 Nov 2026

Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

Twig (twig/twig, Packagist) versions before 3.26.0 are affected. A template name in a {% use %} tag can contain a single quote that breaks out of a PHP string in the compiled cache file, so a template author who can supply that name can inject PHP code that runs when the cache file is loaded, even inside the Twig sandbox because {% use %} is always allowed. Upgrade to twig/twig 3.26.0, which escapes single quotes in compiled string literals.

Written 31 Oct 2026.

Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

Severity and exploitation

ScoreRatingCVSSVectorSource
8.7 High 4.0 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 CNA (GitHub_M)
  • CISA KEV Not listed.
  • EPSS 0.0077, the 56th percentile, on 14 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

Timeline

  1. 20 May 2026, 07:44 UTC Published by the maintainers as a GitHub repository advisory
  2. 21 May 2026, 21:24 UTC Confirmed by GitHub Advisory Database
  3. 14 Jul 2026, 21:14 UTC Confirmed by the CVE List
  4. 14 Jul 2026, 22:16 UTC Confirmed by NVD
  5. 31 Oct 2026, 14:02 UTC First seen by agentprime
  6. 31 Oct 2026, 14:02 UTC Confirmed by OSV

Sources

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.