Skip to main content

Twig EUVDEUVD-2026-31113

| CVE-2026-24425 HIGH
Protection Mechanism Failure (CWE-693)
2026-05-20 disclosure@vulncheck.com GHSA-2q52-x2ff-qgfr
8.7
CVSS 4.0 · Vendor: vulncheck
Share

Severity by source

Vendor (vulncheck) PRIMARY
8.7 HIGH
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Primary rating from Vendor (vulncheck) · only source for this CVE.

CVSS VectorVendor: vulncheck

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
X

Lifecycle Timeline

3
Patch available
May 20, 2026 - 15:17 EUVD
Source Code Evidence Fetched
May 20, 2026 - 14:30 vuln.today
Analysis Generated
May 20, 2026 - 14:30 vuln.today

DescriptionCVE.org

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.

AnalysisAI

Sandbox bypass in Twig template engine versions 2.16.x and 3.9.0 through 3.25.x allows attackers with template rendering capabilities to execute arbitrary PHP code when the sandbox is enabled via a SourcePolicyInterface rather than globally. The runtime check on sort, filter, map, and reduce filters fails to propagate the current template source, allowing arbitrary PHP callables to be passed and executed. No public exploit identified at time of analysis and the issue is not in CISA KEV, but the RCE/PHP tagging and CVSS 4.0 score of 8.7 indicate high impact for applications offering user-editable templates.

Technical ContextAI

Twig is a widely used PHP templating engine maintained by the Symfony ecosystem and bundled with frameworks such as Symfony, Drupal, and many CMS/SaaS platforms that permit user-supplied templates. The sandbox feature restricts which tags, filters, functions, and methods templates may invoke; SourcePolicyInterface lets applications toggle the sandbox per template source instead of globally. CWE-693 (Protection Mechanism Failure) is the root cause class: the fix commit ('propagate Source to checkArrow for source-policy sandboxing') shows that the runtime callable check for arrow-function-style filters (sort, filter, map, reduce) was evaluating against the wrong/missing template source context, so source-policy-enforced sandboxing was effectively skipped for those filters and arbitrary PHP callables passed in as arguments were honored.

RemediationAI

Vendor-released patch: Twig 3.26.0 - upgrade the twig/twig Composer dependency to 3.26.0 or later (the 2.16.x branch should likewise move to the maintained 3.x line, as no separate 2.x fix tag is referenced in the release notes). Pin via composer require twig/twig:^3.26 and redeploy, then verify with composer show twig/twig. If immediate upgrade is not possible, the most targeted compensating control is to stop relying on SourcePolicyInterface for sandboxing and switch to the global sandbox mode (SandboxExtension enabled unconditionally) until patched - this closes the bypass at the cost of applying sandbox restrictions to all templates, which may break trusted internal templates that use disallowed filters/functions. As a second-line control, restrict or remove the sort, filter, map, and reduce filters from the allow-list of the SecurityPolicy used by the sandbox; this blocks the specific filters abused by the bypass but breaks any legitimate templates that use them. Consult https://github.com/twigphp/Twig/security/advisories/GHSA-2q52-x2ff-qgfr for upstream guidance.

More in PHP

View all
CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

CVE-2024-46506 CRITICAL POC
10.0 May 13

NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro

CVE-2024-8353 CRITICAL POC
9.8 Sep 28

The GiveWP - Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all

Share

EUVD-2026-31113 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy