CVE-2024-51754
published low CVSS 3.1 · 2.2Unguarded calls to __toString() when nesting an object into an array in Twig
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| twigphp | — | Twig< 3.11.2 · >= 3.12.0, < 3.14.1 | Affected | Not stated | GitHub_M |
| Debian | bookworm | php-twig | Advisory build | 3.5.1-1+deb12u3 | DSA-6320-1 |
| Ubuntu | focal | php-twig | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
| Debian | bullseye | php-twig | Advisory build | 2.14.3-1+deb11u4 | DLA-4186-1 |
| Ubuntu | focal | php-twig-cssinliner-extra | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
| Ubuntu | focal | php-twig-extra-bundle | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
| Ubuntu | focal | php-twig-html-extra | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
| Ubuntu | focal | php-twig-inky-extra | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
Show 20 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | focal | php-twig-intl-extra | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
| Ubuntu | focal | php-twig-markdown-extra | Advisory build | 2.12.5-1ubuntu0.1~esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-cache-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-cssinliner-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-extra-bundle | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-html-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-inky-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-intl-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-markdown-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | jammy | php-twig-string-extra | Advisory build | 3.3.8-2ubuntu4+esm2 | USN-7456-1 |
| Ubuntu | noble | php-twig | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-cache-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-cssinliner-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-extra-bundle | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-html-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-inky-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-intl-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-markdown-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
| Ubuntu | noble | php-twig-string-extra | Advisory build | 3.8.0-2ubuntu0.1~esm1 | USN-7456-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 2.2 / 10
- Severity
- low
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| twigphp | Twig | < 3.11.2 (affected)>= 3.12.0, < 3.14.1 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-668 CWE-668: Exposure of Resource to Wrong Sphere
References
3Provider assertions
3GitHub_M · cna
Unguarded calls to __toString() when nesting an object into an array in Twig
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 28ba82ee1d29526c78baff54798ea63dfbfca2b179c43691ccdb6ea43faab3c3
- Ingested
- 23 Sep 2026, 08:30:23 UTC
- Source record
- Official CVE record