{"id":"CVE-2024-45411","aliases":["CVE-2024-45411","GHSA-6j75-5wfj-gh66"],"related":[],"kind":"vulnerability","state":"published","title":"Twig has a possible sandbox bypass","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Twig es un lenguaje de plantillas para PHP. En determinadas circunstancias, las comprobaciones de seguridad de la zona protegida no se ejecutan, lo que permite que las plantillas aportadas por los usuarios eludan las restricciones de la zona protegida. Esta vulnerabilidad se ha corregido en las versiones 1.44.8, 2.16.1 y 3.14.0.","source":"nvd"}],"published":"2024-09-09T18:20:28.363Z","modified":"2026-06-17T07:54:09.913Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","score":8.6,"rating":"HIGH"}],"cwes":["CWE-693"],"affected":[{"ranges":[{"version":"> 1.0.0, < 1.44.8","status":"affected"},{"version":"> 2.0.0, < 2.16.1","status":"affected"},{"version":"> 3.0.0, < 3.14.0","status":"affected"}],"vendor":"twigphp","product":"Twig","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"1.0.0","fixed":"1.44.8","status":"affected"},{"type":"custom","introduced":"2.0.0","fixed":"2.16.1","status":"affected"},{"type":"custom","introduced":"3.0.0","fixed":"3.14.0","status":"affected"}],"vendor":"symfony","product":"twig","cpe":"cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.0.0","status":"affected","fixed":"1.44.8"}],"ecosystem":"Packagist","package":"twig/twig","purl":"pkg:composer/twig/twig","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.16.1"}],"ecosystem":"Packagist","package":"twig/twig","purl":"pkg:composer/twig/twig","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.12.0","status":"affected","fixed":"3.14.0"}],"ecosystem":"Packagist","package":"twig/twig","purl":"pkg:composer/twig/twig","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.11.1"}],"ecosystem":"Packagist","package":"twig/twig","purl":"pkg:composer/twig/twig","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.0.0","fixed":"1.44.8"},{"status":"affected","introduced":"2.0.0","fixed":"2.16.1"},{"status":"affected","introduced":"3.0.0","fixed":"3.14.0"}],"vendor":"symfony","product":"twig","cpe":"cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-6j75-5wfj-gh66","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/11f68e2aeb526bfaf638e30d4420d8a710f3f7c6","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/2102dd135986db79192d26fb5f5817a566e0a7de","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/7afa198603de49d147e90d18062e7b9addcf5233","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00031.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45411","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/twigphp/Twig/commit/41103dcdc2daab4c83cdd05b5b4fde5b7e41e635","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2024-45411.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/twigphp/Twig","tags":["package"],"sources":["ghsa"]},{"url":"https://symfony.com/blog/twig-security-release-possible-sandbox-bypass","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2024-09-09T18:37:50.091Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-45411","url":"https://www.cve.org/CVERecord?id=CVE-2024-45411","licence":"CVE Terms of Use","modified":"2024-09-16T12:04:18.107Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6j75-5wfj-gh66","url":"https://github.com/advisories/GHSA-6j75-5wfj-gh66","licence":"CC-BY-4.0","modified":"2024-10-10T15:29:44.509Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-45411","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45411","licence":"Public domain","modified":"2026-06-17T07:54:09.913Z"}],"updatedAt":"2026-11-25T22:58:45.188Z","epss":{"score":0.00849,"percentile":0.59251,"date":"2026-12-01T12:00:22.000Z"}}