CVE-2024-51754

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

LOW
2.2
CVSS Score
Published: November 6, 2024 at 07:28 PM UTC
Updated: June 17, 2026 at 08:06 AM UTC
1 product affected across 1 vendorTwig

Using Twig by twigphp?

Get instant alerts when new vulnerabilities affect Twig - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
LOW2.2
Exploit prediction
EPSS 0.4%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.11.2v < 3.14.1
Affected range stops below 3.11.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.14.1, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

2.2LOWGitHub_M
Attack Vector
NETWORK
Complexity
HIGH
Privileges
HIGH
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-668

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card