CVE Tools

CVE-2024-51754

Unguarded calls to __toString() when nesting an object into an array in Twig

Published: Nov 6, 2024Updated: May 29, 2025 Sources: CVE List NVD GHSACWE-668

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

AV:NAC:HPR:HUI:NS:UC:LI:NA:N
Exploitability
AV:NAttack Vector
Network
AC:HAttack Complexity
High
PR:HPrivileges Required
High
UI:NUser Interaction
None
Scope
S:UScope
Unchanged
Impact
C:LConfidentiality
Low
I:NIntegrity
None
A:NAvailability
None

Weaknesses

Affected Products

twigphposs-projectOSS Librariesaka twig
packagistpackage-ecosystemOSS Libraries

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

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 Account
Plain-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