Twig: Protection Mechanism Failure
CVE-2026-24425 is a critical-severity protection mechanism failure vulnerability in Twig from Twigphp, with a CVSS 3.1 base score of 9.9 out of 10. It can be exploited remotely over the network by an attacker with a low-privileged account, without any action from a user. The record lists version 3.26.0 as the first without the flaw, so updating Twig to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.76% chance of exploitation within 30 days, higher than 56% of scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update Twig to 3.26.0 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Twigphp | Twig | 3.9.0 up to, but not including, 3.26.0; 2.16.* | 3.26.0 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- ChangedThe attack can reach beyond the vulnerable component into other systems.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 4.0 | 8.7 | High | CNA (vulncheck.com) |
| CVSS 3.1 | 8.8 | High | CNA (vulncheck.com) |
| CVSS 3.1 | 9.9 | Critical | NVD |
Official description
Twig versions 2.16.x and 3.9.0 through 3.25.x contain a sandbox bypass vulnerability when using a SourcePolicyInterface that allows attackers with template rendering capabilities to pass arbitrary PHP callables to sort, filter, map, and reduce filters. Attackers can exploit the runtime check that fails to use the current template source to bypass sandbox restrictions and execute arbitrary code when the sandbox is enabled through a source policy rather than globally.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Protection Mechanism Failure
The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/twigphp/Twig/releases/tag/v3.26.0Product, Release Notes
Third-party and government advisories
- vulncheck.com/advisories/twig-x-x-sandbox-bypass-via-sourcepolicyinterfaceThird Party Advisory
Other vulnerabilities in Twig
- 8.7 High severity
- 8.2 High severity
- 7.5 High severity
- 9.1 Critical severity
- 9.1 Critical severity
- 9.1 Critical severity
Recent Protection Mechanism Failure vulnerabilities
- 8.1 High severity
- 7.5 High severity
- 8.3 High severity
- 7.2 High severity
- 8.8 High severity
- 7.5 High severity
Spotted an error? Tell us.