CVE-2024-51754
Unguarded calls to __toString() when nesting an object into an array in Twig
2.2CVSSLOW
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.
CVSS Vector Breakdown
Exploitability
AV:NAttack VectorNetwork
AC:HAttack ComplexityHigh
PR:HPrivileges RequiredHigh
UI:NUser InteractionNone
Scope
S:UScopeUnchanged
Impact
C:LConfidentialityLow
I:NIntegrityNone
A:NAvailabilityNone
Weaknesses
Affected Products
Exploitability
1 exploit source identified
Exploit details including PoC links, Metasploit modules, and scanner templates are available after registration.
View exploit details Official Patch Available
References
https://github.com/twigphp/Twig/commit/2bb8c2460a2c519c498df9b643d5277117155a73
github.com
https://github.com/twigphp/Twig/security/advisories/GHSA-6377-hfv9-hqf6
github.com
https://lists.debian.org/debian-lts-announce/2025/05/msg00039.html
lists.debian.org
and 4 more references View all →
Timeline
Published
Nov 6, 2024
Last Updated
May 29, 2025
Unlock Complete Vulnerability Intelligence
Get the full picture for CVE-2024-51754 and every CVE in our database. Create a free account — no credit card required.
Create Free AccountPlain-language analysis
Impact assessment and exploitation scenario in plain English
Attack graph visualization
Interactive attack path and kill chain mapping
Exploit details & PoC links
ExploitDB, Metasploit, GitHub PoCs with direct links
Nuclei scanner templates
Ready-to-use vulnerability scanner templates
Full remediation guide
Patch instructions, workarounds, and compliance impact
Interactive AI chat
Ask questions about this vulnerability in natural language
Related vulnerabilities
Semantically similar CVEs and attack patterns
REST API & MCP access
Integrate vulnerability data into your workflows