{"id":"CVE-2024-51754","summary":"Unguarded calls to __toString() when nesting an object into an array in Twig","details":"Twig is a template language for PHP. In a sandbox, an attacker can call `__toString()` on an object even if the `__toString()` method is not allowed by the security policy when the object is part of an array or an argument list (arguments to a function or a filter for instance). 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.","aliases":["GHSA-6377-hfv9-hqf6"],"modified":"2026-08-12T03:51:40.300372351Z","published":"2024-11-06T19:28:17.553Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/51xxx/CVE-2024-51754.json","cna_assigner":"GitHub_M","cwe_ids":["CWE-668"]},"references":[{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00039.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/51xxx/CVE-2024-51754.json"},{"type":"ADVISORY","url":"https://github.com/twigphp/Twig/security/advisories/GHSA-6377-hfv9-hqf6"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-51754"},{"type":"FIX","url":"https://github.com/twigphp/Twig/commit/2bb8c2460a2c519c498df9b643d5277117155a73"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/twigphp/twig","events":[{"introduced":"0"},{"introduced":"4d19472d4ac1838e0b1f0e029ce1fa4040eb34ea"},{"fixed":"5b580ec1882b54c98cbd8c0f8a3ca5d1904db6b1"},{"fixed":"f405356d20fb43603bcadc8b09bfb676cb04a379"},{"fixed":"2bb8c2460a2c519c498df9b643d5277117155a73"}],"database_specific":{"source":["AFFECTED_FIELD","REFERENCES"],"extracted_events":[{"introduced":"0"},{"fixed":"3.11.2"},{"introduced":"3.12.0"},{"fixed":"3.14.1"}]}}],"versions":["v3.11.1","v3.14.0","v3.11.0","v3.13.0","v3.12.0","v3.10.3","v3.10.2","v3.10.1","v3.10.0","v3.9.3","v3.9.2","v3.9.1","v3.9.0","v3.8.0","v3.7.1","v3.7.0","v3.6.1","v3.6.0","v3.5.1","v3.5.0","v3.4.3","v3.4.2","v3.4.1","v3.4.0","v3.3.10","v3.3.9","v3.3.8","v3.3.7","v3.3.6","v3.3.5","v3.3.4","v3.3.3","v3.3.2","v3.3.1","v3.3.0","v3.2.1","v3.1.1","v3.1.0","v3.0.5","v3.0.4","v3.0.3","v3.0.2","v3.0.1","v3.0.0","v3.0.0-BETA1","v2.8.1","v2.8.0","v2.7.4","v2.7.3","v2.7.2","v2.7.1","v2.7.0","v2.6.2","v2.6.1","v2.6.0","v2.5.0","v2.4.8","v2.4.7","v2.4.6","v2.4.5","v2.4.4","v2.4.3","v2.4.2","v2.4.1","v2.4.0","v2.3.2","v2.3.1","v2.3.0","v2.2.0","v2.1.0","v2.0.0","v1.18.0","v1.17.0","v1.16.3","v1.16.2","v1.16.1","v1.16.0","v1.15.1","v1.15.0","v1.14.2","v1.14.1","v1.14.0","v1.13.2","v1.13.1","v1.13.0","v1.12.3","v1.12.2","v1.12.1","v1.12.0","v1.12.0-RC1","v1.11.1","v1.11.0","v1.10.3","v1.10.2","v1.10.1","v1.10.0","v1.9.2","v1.9.1","v1.9.0","v1.8.3","v1.8.2","v1.8.1","v1.8.0","v1.7.0","v1.6.4","v1.6.3","v1.6.2","v1.6.1","v1.5.1","v1.6.0","v1.5.0","v1.5.0-RC2","v1.5.0-RC1","v1.4.0","v1.4.0-RC2","v1.4.0-RC1","v1.3.0","v1.3.0-RC1","v1.2.0","v1.2.0-RC1","v1.1.2","v1.1.1","v1.1.0","v1.1.0-RC3","v1.1.0-RC2","v1.1.0-RC1","v1.0.0","v1.0.0-RC2","v1.0.0-RC1","v0.9.10","v0.9.9","v0.9.8","v0.9.7","v0.9.6","v0.9.5","v0.9.4","v0.9.2","v0.9.1","v0.9.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-51754.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N"}]}