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


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (24th 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-PHP-TWIGTWIG-7925183
  • published10 Sept 2024
  • disclosed9 Sept 2024
  • creditFabien Potencier

Introduced: 9 Sep 2024

CVE-2024-45411  (opens in a new tab)
CWE-693  (opens in a new tab)

How 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:

  1. The sandbox is disabled globally;

  2. The sandbox is enabled via a sandboxed include() function which references a template name (like included.twig) and not a Template or TemplateWrapper instance;

  3. The included template has been loaded before the include() call but in a non-sandbox context (possibly as the sandbox has been globally disabled).

CVSS Scores

version 4.0
version 3.1