Live threats

All CVEs / twigphp

CVE-2024-51754twigphp Twig

Low 2.2

Priority
13
CVSS 3.1
2.2
EPSS
0.7%
probability of exploitation in 30 days · percentile 49
Auth required
Yes
Published
Nov 6, 2024
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-668
SSVC (CISA)
Exploitation: none · Automatable: no · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Twig.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Packagist twig/twig < 3.11.2 3.11.2 composer require "twig/twig:^3.11.2"
Packagist twig/twig ≥ 3.12 < 3.14.1 3.14.1 composer require "twig/twig:^3.14.1"

Per OSV / GitHub Advisories (GHSA-6377-hfv9-hqf6). Check the version in your lockfile before upgrading.

Affected products

As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.

Official sources

References

Links published by the sources. Open them with care.