Vulnerability · Published May 20, 2026 · Assigned by VulnCheck

CVE-2026-24425Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface

High 8.8

In plain English

A high-severity security flaw in Twig from twigphp. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 55% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.8High
Exploit odds (30 days)0.8%top 44.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13php-twig3.27.0-0+deb13u1DEBIAN-CVE-2026-24425
Debian:14php-twig3.26.0-1DEBIAN-CVE-2026-24425
Packagisttwig/twigno fix listedGHSA-2q52-x2ff-qgfr
Packagisttwig/twig3.26.0GHSA-2q52-x2ff-qgfr
Ubuntu:25.10php-twigno fix listedUBUNTU-CVE-2026-24425

Affected products (as reported)

VendorProductVersions
twigphp Twig 3.9.0 – before 3.26.02.16.*

Weakness: CWE-693 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References