Vulnerability · Published Nov 6, 2024 · Assigned by GitHub_M

CVE-2024-51754Unguarded calls to __toString() when nesting an object into an array in Twig

Low 2.2

In plain English

A low-severity security flaw in Twig from twigphp. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 38% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)2.2Low
Exploit odds (30 days)0.4%top 62.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12php-twig3.5.1-1+deb12u3DEBIAN-CVE-2024-51754
Debian:13php-twig3.14.2-1DEBIAN-CVE-2024-51754
Debian:14php-twig3.14.2-1DEBIAN-CVE-2024-51754
Packagisttwig/twig3.11.2GHSA-6377-hfv9-hqf6
Packagisttwig/twig3.14.1GHSA-6377-hfv9-hqf6

Affected products (as reported)

VendorProductVersions
twigphp Twig < 3.11.2>= 3.12.0, < 3.14.1

Weakness: CWE-668 · Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N

References