CVE-2024-51754
LOW2.2EPSS 0.14%php-twig - security update
Published: 11/6/2024Modified: 6/2/2026
Also known as:DEBIAN-CVE-2024-51754
Description
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.
Affected packages (3)
- Debian/php-twigfrom 0, < 2.14.3-1+deb11u4
- Debian/php-twigfrom 0, < 2.14.3-1+deb11u4
- Packagist/twig/twigfrom 0, < 3.11.2
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 4.0 | — | 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 |
| osv | CVSS 3.1 | LOW2.2 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N |
References (8)
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2024-51754
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2024-51754
- PATCHhttps://github.com/twigphp/Twig
- WEBhttps://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2024-51754.yaml
- WEBhttps://github.com/twigphp/Twig/commit/2bb8c2460a2c519c498df9b643d5277117155a73
- WEBhttps://github.com/twigphp/Twig/security/advisories/GHSA-6377-hfv9-hqf6
- WEBhttps://lists.debian.org/debian-lts-announce/2025/05/msg00039.html
- WEBhttps://symfony.com/blog/unguarded-calls-to-__tostring-when-nesting-an-object-into-an-array