Protection Mechanism Failure Affecting php-twig package, versions <3.23.0-2ubuntu0.1~esm1


Severity

Recommended
medium

Based on Ubuntu security rating.

Threat Intelligence

EPSS
0.76% (52nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UBUNTU2604-PHPTWIG-16791011
  • published8 Jun 2026
  • disclosed20 May 2026

Introduced: 20 May 2026

CVE-2026-24425  (opens in a new tab)
CWE-693  (opens in a new tab)

How to fix?

Upgrade Ubuntu:26.04 php-twig to version 3.23.0-2ubuntu0.1~esm1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream php-twig package and not the php-twig package as distributed by Ubuntu. See How to fix? for Ubuntu:26.04 relevant fixed versions and status.

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.

CVSS Base Scores

version 3.1