Severity by source
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
Lifecycle Timeline
3DescriptionCVE.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.
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
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
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
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
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
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro
The GiveWP - Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all
Same weakness CWE-693 – Protection Mechanism Failure
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-31113
GHSA-2q52-x2ff-qgfr