Protection Mechanism Failure Affecting twig/twig package, versions >=1.0.0, <1.44.8 >=2.0.0, <2.16.1 >=3.0.0, <3.11.1 >=3.12.0, <3.14.0
Threat Intelligence
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 ID SNYK-PHP-TWIGTWIG-7925183
- published 10 Sep 2024
- disclosed 9 Sep 2024
- credit Fabien Potencier
Introduced: 9 Sep 2024
CVE-2024-45411 Open this link in a new tabHow to fix?
Upgrade twig/twig
to version 1.44.8, 2.16.1, 3.11.1, 3.14.0 or higher.
Overview
twig/twig is a flexible, fast, and secure template language for PHP.
Affected versions of this package are vulnerable to Protection Mechanism Failure due to the incomplete enforcement of sandbox security measures. An attacker can execute arbitrary code or access unauthorized data by crafting malicious templates that exploit this oversight.
Note:
Exploiting this vulnerability is possible when all these conditions are met:
The sandbox is disabled globally;
The sandbox is enabled via a sandboxed
include()
function which references a template name (likeincluded.twig
) and not aTemplate
orTemplateWrapper
instance;The included template has been loaded before the
include()
call but in a non-sandbox context (possibly as the sandbox has been globally disabled).