Advisory record · GHSA-2q52-x2ff-qgfr

Twig: Possible sandbox bypass when using a source policy

CVSS 8.7 HighEPSS 0.0076 · 55th percentile

Published by the GitHub Advisory Database at 5 Jun 2026, 20:41 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

PackageEcosystemAffectedFixed in
twig/twigPackagist>=2.16.0, <=2.16.1 || >=3.9.0, <3.26.03.26.0
Identifiers
GHSA-2q52-x2ff-qgfr · CVE-2026-24425 · PKSA-gw7n-z4yx-7xjt
Weakness (CWE)
CWE-693
Published
5 Jun 2026
Updated
10 Sept 2026

Machine-written summary

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

Twig, the PHP template engine, has a sandbox bypass in versions >=2.16.0 up to and including 2.16.1 and >=3.9.0 before 3.26.0. When the sandbox is enabled through a SourcePolicyInterface rather than globally, the sort, filter, map, and reduce filters can accept non-Closure callbacks that the sandbox should reject. An attacker who can supply templates that are sandboxed this way could pass arbitrary PHP callables to these filters. The source does not describe the exact impact beyond this. Upgrade to Twig 3.26.0 or later, where the fix propagates the template source to callback checks.

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 (VulnCheck)
  • CISA KEV Not listed.
  • EPSS 0.0076, the 55th percentile, on 9 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. 20 May 2026, 13:45 UTC Confirmed by the CVE List
  3. 31 Oct 2026, 13:58 UTC First seen by agentprime
  4. 31 Oct 2026, 13:58 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.