{"id":"CVE-2024-51754","aliases":["GHSA-6377-hfv9-hqf6"],"url":"https://o3.security/vulnerability/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.","published":"2024-11-06T19:28:17.553Z","modified":"2026-08-08T03:47:30.368824184Z","cvss":{"score":2.2,"severity":"LOW","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N"},"epss":{"score":0.00444,"percentile":0.36556,"asOf":"2026-08-08"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"twig/twig","fixedVersion":"3.11.2"},{"ecosystem":"Packagist","name":"twig/twig","fixedVersion":"3.14.1"}],"fix":{"url":"https://github.com/twigphp/Twig/commit/2bb8c2460a2c519c498df9b643d5277117155a73","label":"twigphp/Twig@2bb8c24"},"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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-08T03:47:30.368824184Z"}}