{"id":"CVE-2024-45411","aliases":["GHSA-6j75-5wfj-gh66"],"url":"https://o3.security/vulnerability/CVE-2024-45411","summary":"Twig has a possible sandbox bypass","details":"### Description\n\nUnder some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions.\n\nThe security issue happens when all these conditions are met:\n\n * The sandbox is disabled globally;\n * The sandbox is enabled via a sandboxed `include()` function which references a template name (like `included.twig`) and not a `Template` or `TemplateWrapper` instance;\n * The included template has been loaded before the `include()` call but in a non-sandbox context (possible as the sandbox has been globally disabled).\n\n### Resolution\n\nThe patch ensures that the sandbox security checks are always run at runtime.\n\n### Credits\n\nWe would like to thank Fabien Potencier for reporting and fixing the issue.\n","published":"2024-09-09T18:20:28.363Z","modified":"2026-08-12T03:51:32.188886432Z","cvss":{"score":8.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"twig/twig","fixedVersion":"1.44.8"},{"ecosystem":"Packagist","name":"twig/twig","fixedVersion":"2.16.1"},{"ecosystem":"Packagist","name":"twig/twig","fixedVersion":"3.14.0"},{"ecosystem":"Packagist","name":"twig/twig","fixedVersion":"3.11.1"}],"fix":{"url":"https://github.com/twigphp/Twig/commit/11f68e2aeb526bfaf638e30d4420d8a710f3f7c6","label":"twigphp/Twig@11f68e2"},"references":[{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00031.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45411.json"},{"type":"ADVISORY","url":"https://github.com/twigphp/Twig/security/advisories/GHSA-6j75-5wfj-gh66"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45411"},{"type":"FIX","url":"https://github.com/twigphp/Twig/commit/11f68e2aeb526bfaf638e30d4420d8a710f3f7c6"},{"type":"FIX","url":"https://github.com/twigphp/Twig/commit/2102dd135986db79192d26fb5f5817a566e0a7de"},{"type":"FIX","url":"https://github.com/twigphp/Twig/commit/7afa198603de49d147e90d18062e7b9addcf5233"},{"type":"WEB","url":"https://github.com/twigphp/Twig/commit/41103dcdc2daab4c83cdd05b5b4fde5b7e41e635"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2024-45411.yaml"},{"type":"PACKAGE","url":"https://github.com/twigphp/Twig"},{"type":"WEB","url":"https://symfony.com/blog/twig-security-release-possible-sandbox-bypass"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:32.188886432Z"}}