{"id":"CVE-2024-51755","aliases":["CVE-2024-51755","GHSA-jjxq-ff2g-95vh"],"related":[],"kind":"vulnerability","state":"published","title":"Unguarded calls to __isset() and to array-accesses when the sandbox is enabled in Twig","summary":"Twig is a template language for PHP. In a sandbox, an attacker can access attributes of Array-like objects as they were not checked by the security policy. They are now checked via the property policy and the `__isset()` method is now called after the security check. This is a BC break. This issue has been patched in versions 3.11.2 and 3.14.1. All users are advised to upgrade. There are no known workarounds for this issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Twig is a template language for PHP. In a sandbox, an attacker can access attributes of Array-like objects as they were not checked by the security policy. They are now checked via the property policy and the `__isset()` method is now called after the security check. This is a BC break. This issue has been patched in versions 3.11.2 and 3.14.1. All users are advised to upgrade. There are no known workarounds for this issue.","source":"cvelist"},{"lang":"en","text":"### Description\n\nIn a sandbox, and attacker can access attributes of Array-like objects as they were not checked by the security policy.\nThey are now checked via the property policy and the `__isset()` method is now called after the security check.\n**This is a BC break.**\n\n### Resolution\n\nThe sandbox mode now ensures access to array-like's properties is allowed.\n\nThe patch for this issue is available [here](https://github.com/twigphp/Twig/commit/ec39a9dccc5fb4eaaba55e5d79a6f84a8dd8b69d) for the 3.11.x branch, and [here](https://github.com/twigphp/Twig/commit/b957e5a44cc0075d04ccff52f8fa9d8e6db3e3a0) for the 3.x branch.\n\n### Credits\n\nWe would like to thank Jamie Schouten for reporting the issue and Nicolas Grekas for providing the fix.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Twig es un lenguaje de plantillas para PHP. En un entorno aislado, un atacante puede acceder a los atributos de objetos similares a matrices, ya que no fueron comprobados por la política de seguridad. Ahora se comprueban a través de la política de propiedades y se llama al método `__isset()` después de la comprobación de seguridad. Esto es una falla de BC. Este problema se ha corregido en las versiones 3.11.2 y 3.14.1. Se recomienda a todos los usuarios que actualicen. No hay workarounds para este problema.","source":"nvd"}],"published":"2024-11-06T19:27:05.347Z","modified":"2026-06-17T08:06:16.337Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N","score":2.2,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N","score":2.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N","score":2.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"LOW"}],"cwes":["CWE-668"],"affected":[{"ranges":[{"version":"< 3.11.2","status":"affected"},{"version":">= 3.12.0, < 3.14.1","status":"affected"}],"vendor":"twigphp","product":"Twig","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.11.2"}],"ecosystem":"Packagist","package":"twig/twig","purl":"pkg:composer/twig/twig","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.12","status":"affected","fixed":"3.14.1"}],"ecosystem":"Packagist","package":"twig/twig","purl":"pkg:composer/twig/twig","source":"ghsa"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-jjxq-ff2g-95vh","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/831c148e786178e5f2fde9db67266be3bf241c21","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-51755","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2024-51755.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/twigphp/Twig","tags":["package"],"sources":["ghsa"]},{"url":"https://symfony.com/blog/unguarded-calls-to-__isset-and-to-array-accesses-when-the-sandbox-is-enabled","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-11-06T19:44:58.084Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-51755","url":"https://www.cve.org/CVERecord?id=CVE-2024-51755","licence":"CVE Terms of Use","modified":"2024-11-07T15:12:59.408Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jjxq-ff2g-95vh","url":"https://github.com/advisories/GHSA-jjxq-ff2g-95vh","licence":"CC-BY-4.0","modified":"2024-11-12T19:45:48.742Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-51755","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-51755","licence":"Public domain","modified":"2026-06-17T08:06:16.337Z"}],"updatedAt":"2026-11-25T22:58:47.843Z","epss":{"score":0.00425,"percentile":0.38765,"date":"2026-12-01T12:00:22.000Z"}}