Every CVE Search/ Get API key

CVE-2024-45411

Twig has a possible sandbox bypass

8.6 HighFix available

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

0.85%Up 0.7 points since Sep 10, 2024
90%50%10%1%

What each source reports

CVE List Score used 8.6

Twig has a possible sandbox bypass

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Record
CVE-2024-45411
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-693
Updated
2026-11-02
EUVDEUVD-2024-2735 8.6

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Record
EUVD-2024-2735
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-6j75-5wfj-gh66 5.8

Twig has a possible sandbox bypass

Description

Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions.

The security issue happens 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 (like included.twig) and not a Template or TemplateWrapper instance;
  • The included template has been loaded before the include() call but in a non-sandbox context (possible as the sandbox has been globally disabled).

Resolution

The patch ensures that the sandbox security checks are always run at runtime.

Credits

We would like to thank Fabien Potencier for reporting and fixing the issue.

Record
GHSA-6j75-5wfj-gh66
CVSS 4.0
5.8 MediumCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H
CVSS 3.1
8.5 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-693
Updated
2026-11-02
NVD 8.5

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Record
CVE-2024-45411
CVSS 3.1
8.5 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Weakness
CWE-693
Updated
2026-11-02
OSV 8.5

Twig has a possible sandbox bypass

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Record
CVE-2024-45411
CVSS 3.1
8.5 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-693
Updated
2026-11-02
OSVDEBIAN-CVE-2024-45411 8.6

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Record
DEBIAN-CVE-2024-45411
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Updated
2026-11-02
Show 5 moreShow less
OSVGHSA-6j75-5wfj-gh66 5.8

Twig has a possible sandbox bypass

Description

Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions.

The security issue happens 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 (like included.twig) and not a Template or TemplateWrapper instance;
  • The included template has been loaded before the include() call but in a non-sandbox context (possible as the sandbox has been globally disabled).

Resolution

The patch ensures that the sandbox security checks are always run at runtime.

Credits

We would like to thank Fabien Potencier for reporting and fixing the issue.

Record
GHSA-6j75-5wfj-gh66
CVSS 4.0
5.8 MediumCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H
CVSS 3.1
8.5 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-693
Updated
2026-11-02
OSVUBUNTU-CVE-2024-45411 8.5

Twig is a template language for PHP. Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions. This vulnerability is fixed in 1.44.8, 2.16.1, and 3.14.0.

Record
UBUNTU-CVE-2024-45411
CVSS 3.1
8.5 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Updated
2026-11-02
OSVCLSA-2026-1783991055 No score

TuxCare security update for twig/twig (1 CVE)

TuxCare rebuilt twig/twig to address 1 CVE. Fixed in v2.15.6-p1+tuxcare.

Record
CLSA-2026-1783991055
Updated
2026-11-02
OSVUSN-7456-1 No score

php-twig vulnerabilities

Fabien Potencier discovered that Twig did not run sandbox security checks in some circumstances. An attacker could possibly use this issue to cause a denial of service or execute arbitrary commands. This issue only affected Ubuntu 22.04 LTS and Ubuntu 24.04 LTS. (CVE-2024-45411)

Jamie Schouten discovered that Twig could bypass the security policy for an object call. An attacker could possibly use this issue to obtain sensitive information. (CVE-2024-51754)

Record
USN-7456-1
Updated
2026-11-02
OSVUSN-7549-1 No score

php-twig vulnerability

It was discovered that Twig did not correctly handle securing user input. An attacker could possibly use this issue to cause Twig to expose sensitive information if it opened a specially crafted file. (CVE-2024-45411)

Record
USN-7549-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
twig/twig
Packagist
1.0.0 up to 1.44.8
1.44.8
twig/twig
Packagist
2.0.0 up to 2.16.1
2.16.1
twig/twig
Packagist
3.12.0 up to 3.14.0
3.14.0
twig/twig
Packagist
3.0.0 up to 3.11.1
3.11.1
twig/twig
TuxCare:Packagist
v2.15.6 up to v2.15.6-p1+tuxcare
v2.15.6-p1+tuxcare
php-twig
Debian:12
before 3.5.1-1+deb12u1, plus listed versions
3.5.1-1
3.5.1-1+deb12u1
php-twig
Debian:13
before 3.8.0-4
3.8.0-4
php-twig
Debian:14
before 3.8.0-4
3.8.0-4
php-twig
Debian:11
before 2.14.3-1+deb11u3, plus listed versions
2.14.3-12.14.3-1+deb11u12.14.3-1+deb11u2
2.14.3-1+deb11u3
twig/twig
Packagist
1.0.0 up to 1.44.8, plus listed versions
1.3.01.4.01.5.01.5.11.6.0
Show 45 moreShow less
1.6.11.6.21.6.31.6.41.6.5v1.10.0v1.10.1v1.10.2v1.10.3v1.11.0v1.11.1v1.12.0v1.12.0-RC1v1.12.1v1.12.2v1.12.3v1.13.0v1.13.1v1.13.2v1.14.0v1.14.1v1.14.2v1.15.0v1.15.1v1.16.0v1.16.1v1.16.2v1.16.3v1.17.0v1.18.0v1.18.1v1.18.2v1.19.0v1.20.0v1.21.0v1.21.1v1.21.2v1.22.0v1.22.1v1.22.2v1.22.3v1.23.0v1.23.1v1.23.2v1.23.3
1.44.8
Show 12 moreShow less
Affected packages
PackageAffectedFixed
twig/twig
Packagist
2.0.0 up to 2.16.1, plus listed versions
v2.0.0v2.1.0v2.10.0v2.11.0v2.11.1
Show 45 moreShow less
v2.11.2v2.11.3v2.12.0v2.12.1v2.12.2v2.12.3v2.12.4v2.12.5v2.13.0v2.13.1v2.14.0v2.14.1v2.14.10v2.14.11v2.14.12v2.14.13v2.14.2v2.14.3v2.14.4v2.14.5v2.14.6v2.14.7v2.14.8v2.14.9v2.15.0v2.15.1v2.15.2v2.15.3v2.15.4v2.15.5v2.15.6v2.16.0v2.2.0v2.3.0v2.3.1v2.3.2v2.4.0v2.4.1v2.4.2v2.4.3v2.4.4v2.4.5v2.4.6v2.4.7v2.4.8
2.16.1
twig/twig
Packagist
3.12.0 up to 3.14.0, plus listed versions
v3.12.0v3.13.0
3.14.0
twig/twig
Packagist
3.0.0 up to 3.11.1, plus listed versions
v3.0.0v3.0.1v3.0.2v3.0.3v3.0.4
Show 35 moreShow less
v3.0.5v3.1.0v3.1.1v3.10.0v3.10.1v3.10.2v3.10.3v3.11.0v3.2.1v3.3.0v3.3.1v3.3.10v3.3.2v3.3.3v3.3.4v3.3.5v3.3.6v3.3.7v3.3.8v3.3.9v3.4.0v3.4.1v3.4.2v3.4.3v3.5.0v3.5.1v3.6.0v3.6.1v3.7.0v3.7.1v3.8.0v3.9.0v3.9.1v3.9.2v3.9.3
3.11.1
twig
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
1.20.0-11.23.1-1ubuntu11.23.1-1ubuntu41.23.1-1ubuntu4+esm1
None known
twig
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
1.24.0-2ubuntu12.4.4-2ubuntu12.4.6-12.4.6-1ubuntu0.1~esm1
None known
php-twig
Ubuntu:Pro:20.04:LTS
All versions, plus listed versions
2.11.3-22.12.1-12.12.2-12.12.3-12.12.5-12.12.5-1ubuntu0.1~esm12.12.5-1ubuntu0.1~esm2
None known
php-twig
Ubuntu:Pro:22.04:LTS
before 3.3.8-2ubuntu4+esm2, plus listed versions
3.3.2-1ubuntu33.3.4-13.3.6-13.3.7-13.3.8-2ubuntu43.3.8-2ubuntu4+esm1
3.3.8-2ubuntu4+esm2
php-twig
Ubuntu:24.04:LTS
before 3.8.0-2ubuntu1, plus listed versions
3.7.0-13.7.1-13.8.0-2
3.8.0-2ubuntu1
php-twig
Ubuntu:Pro:24.04:LTS
before 3.8.0-2ubuntu0.1~esm1, plus listed versions
3.7.0-13.7.1-13.8.0-2
3.8.0-2ubuntu0.1~esm1
php-twig
Ubuntu:Pro:20.04:LTS
From an advisory covering 2 CVEs
before 2.12.5-1ubuntu0.1~esm2, plus listed versions
2.11.3-22.12.1-12.12.2-12.12.3-12.12.5-12.12.5-1ubuntu0.1~esm1
2.12.5-1ubuntu0.1~esm2
php-twig
Ubuntu:Pro:22.04:LTS
From an advisory covering 2 CVEs
before 3.3.8-2ubuntu4+esm2, plus listed versions
3.3.2-1ubuntu33.3.4-13.3.6-13.3.7-13.3.8-2ubuntu43.3.8-2ubuntu4+esm1
3.3.8-2ubuntu4+esm2
php-twig
Ubuntu:Pro:24.04:LTS
From an advisory covering 2 CVEs
before 3.8.0-2ubuntu0.1~esm1, plus listed versions
3.7.0-13.7.1-13.8.0-2
3.8.0-2ubuntu0.1~esm1

History

History
RecordedChangedSources
affected, facts
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-45411 is a high vulnerability (CVSS 8.6) in Symfony Twig, published September 9, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.85%, the 58th percentile. Fixed in twig/twig 1.44.8.

References

Show 12 moreShow less
This page doesn't list everything

Left out here: 76 versions. The JSON record has them.

MoveEnter Open