CVE-2024-51754: twigphp twig Exposure of Resource to Wrong Sphere
Vulnerability summary
CVE-2024-51754 is a low (CVSS 2.2) Exposure of Resource to Wrong Sphere vulnerability in twigphp twig. EPSS estimates a 0.43% chance of exploitation in the next 30 days, higher than 36.4% of scored vulnerabilities.
Advisory lineage
Upstream 0 · Downstream 1 · Related 1Timeline
- 06-11-2024PublishedVulnerability first disclosed.
- 29-05-2025Last modifiedVulnerability information updated.
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 metrics
4 scores · 4 sources · 1 version- OSV · UbuntuEcosystem advisory · calculated2.2LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
- OSV · DebianEcosystem advisory · calculated2.2LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
- NVDNIST2.2LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
EPSS trend
Probability
0.43%
Chance of exploitation in the next 30 days
Percentile
36%
Versus all other CVEs
30-day change
0.00 pp
From 0.43% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Ubuntu2 products
- php-twig< 2.12.5-1ubuntu0.1~esm2 | < 3.3.8-2ubuntu4+esm2 | < 3.8.0-2ubuntu0.1~esm1
- twigAll versions (No fix recorded)
Debian1 product
- php-twig< 3.5.1-1+deb12u3 | < 3.14.2-1 | < 2.14.3-1+deb11u4
Twigphp1 product
- twig< 3.11.2 | ≥ 3.12.0, < 3.14.1
3 vendors · 4 products