Skip to main content
CVE-2024-51754VulnerabilityPublished Updated

CVE-2024-51754: twigphp Twig · Resource Exposure

Affects twigphp TwigSource CVE Database V5

0

Not known to be exploited · CVSS 2.2 Low : upgrade to 3.11.2 when convenient.

Data as of 25 Oct 2026, 19:02 UTC

CVSS 3.1 base score
2.2Low
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.4% chance of exploitation in 30 days – higher than 37% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 3.11.2
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 6 Nov 2024

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.

What to do

Upgrade twig/twig to 3.11.2.

Affected software

ProductAffectedFixed in
Packagisttwig/twigpkg:composer/twig/twigOther threatsAffected
  • <3.11.2
Fixed in
  • 3.11.2

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

The primary mitigation is to upgrade Twig to a patched version: 3.11.2 or later, or 3.14.1 or later if using versions between 3.12.0 and 3.14.1. Since no workarounds exist, organizations should prioritize updating their dependencies promptly. Additionally, organizations should audit their use of Twig sandboxing to ensure that untrusted user input cannot influence template rendering or object injection. Implement strict input validation and sanitization to prevent injection of malicious objects into templates. Monitoring and logging template rendering activities may help detect anomalous usage patterns. For environments where immediate upgrade is not feasible, consider isolating or restricting access to affected applications and applying web application firewall (WAF) rules to detect and block suspicious payloads targeting template injection. Finally, maintain an inventory of applications using Twig to ensure comprehensive patching.

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.

References

Community reviews

Loading reviews…