CVE-2024-51754

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

Published Nov 6, 2024 CVSS 3.1 · 2.2 Low EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4186-1 php-twig security update
Debian DSA Debian DSA DSA-6320-1 php-twig security update
EUVD EUVD EUVD-2024-3201 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.
Github GHSA Github GHSA GHSA-6377-hfv9-hqf6 Twig has unguarded calls to `__toString()` when nesting an object into an array
Ubuntu USN Ubuntu USN USN-7456-1 Twig vulnerabilities
History
Type Values Removed Values Added
Metrics epss

{'score': 0.0009}

epss

{'score': 0.00097}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Unguarded calls to __toString() when nesting an object into an array in Twig
Weaknesses CWE-668
References
Metrics cvssV3_1

{'score': 2.2, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N'}

Subscriptions

No data.

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 29, 2025, 9:03 AM
Reserved
Oct 31, 2024, 2:12 PM
Status
Deferred
Published
Nov 6, 2024, 8:15 PM
Modified
Jun 17, 2026, 8:06 AM