Quick answers
- Is CVE-2026-24425 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-24425 being exploited in the wild.
- How severe is CVE-2026-24425?
- High severity, with a CVSS score of 8.8, published 20 May 2026.
- Which products and versions are affected?
- twig/twig (Packagist) ECOSYSTEM:introduced=2.16.0,last_affected=2.16.1; Twig PHP Twig 2.16.x, 3.9.0 to 3.25.x.
- Is there a fix for CVE-2026-24425?
- A patch was published on 2026-06-05: Fixed in version 3.26.0 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-24425 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-24425?
- Check whether you run twig/twig (Packagist) or Twig PHP Twig at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
A sandbox bypass exists in Twig when the sandbox is enabled via a SourcePolicyInterface rather than globally. The vulnerability stems from a failure in the runtime check for callback-accepting filters (specifically sort, filter, map, and reduce) to verify the current template Source. This allows an attacker to pass arbitrary PHP callables instead of being restricted to Closure objects. Exploitation requires the ability to provide or modify a template that is processed under a source-based sandbox policy. The issue is resolved in version 3.26.0 by making callback sandbox checks source-aware.
Affected products
- twigphp Twig >= 2.16.0, <= 2.16.1
- twigphp Twig >= 3.9.0, < 3.26.0
Identifiers
- CVE-2026-24425
- GHSA-2q52-x2ff-qgfr
Timeline
- 2026-05-20: disclosed
- 2026-06-05: advisory
- 2026-06-05: patched: Fixed in version 3.26.0