VDB

CVE-2024-51754

CVE-2024-51754 PUBLISHED CVSS 2.2 LOW

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

Reported by github_m · Published November 6, 2024

twig/twig is fixed in 3.14.1 and 3.11.2 (Packagist)

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
twig/twigPackagist3.14.1, 3.11.2

Risk scores

CVSS 3.1
2.2
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N

Affected products

VendorProductVersions
twigphpTwig< 3.11.2, >= 3.12.0, < 3.14.1
twigtwig0, 3.12
twigphpTwig0, 3.12.0

Timeline

  • Nov 6, 2024 CVE Published
  • Nov 6, 2024 Coalition ESS Score (16 in total, the first dated here)
  • Nov 7, 2024 EPSS Score (30 in total, the first dated here)
  • Jan 1, 2026 Security Advisory
  • Jun 17, 2026 CVE Updated

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-51754
vulnetix vdb fixes CVE-2024-51754

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-51754/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›