CVEMETERBack to radar
OFFICIAL RECORD · PHP packages

CVE-2024-51754

PUBLISHEDOfficial status check: verifiedCVSS 3.1: 2.2 · low

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

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.

Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.

Severity and exploitation evidence

EPSS: 0.431% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.

CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T18:36:01.564Z. Public exploit availability is not used to set this status.

CVSS 3.1 · 2.2 · published by GitHub_M
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
Assessment source · checked 2026-11-19T12:57:20.046Z

Verification by field

FieldStatusChecked at (UTC)Source
kevverified2026-11-19T18:36:01.564ZCISA KEV
cvssverified2026-11-19T12:57:20.046ZCVE Program
epssverified2026-11-19T18:27:11.132ZFIRST EPSS
patchesverified2026-11-19T12:52:00.377ZOSV
affectedverified2026-11-19T12:57:20.046ZCVE Program
lifecycleverified2026-11-19T12:57:20.046ZCVE Program

Affected versions and configuration

twigphp Twig; default status: unknown: < 3.11.2 [affected; scheme: unspecified]; >= 3.12.0, < 3.14.1 [affected; scheme: unspecified]

Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.

CVE Program · cve-json · full conditions
{
  "affected": [
    {
      "vendor": "twigphp",
      "product": "Twig",
      "versions": [
        {
          "status": "affected",
          "version": "< 3.11.2"
        },
        {
          "status": "affected",
          "version": ">= 3.12.0, < 3.14.1"
        }
      ]
    }
  ],
  "additionalContainers": [
    {
      "title": "CISA ADP Vulnrichment",
      "metrics": [
        {
          "other": {
            "type": "ssvc",
            "content": {
              "id": "CVE-2024-51754",
              "role": "CISA Coordinator",
              "options": [
                {
                  "Exploitation": "none"
                },
                {
                  "Automatable": "no"
                },
                {
                  "Technical Impact": "partial"
                }
              ],
              "version": "2.0.3",
              "timestamp": "2024-11-06T19:40:22.129936Z"
            }
          }
        }
      ],
      "providerMetadata": {
        "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "shortName": "CISA-ADP",
        "dateUpdated": "2024-11-06T19:44:28.082Z"
      }
    },
    {
      "title": "CVE Program Container",
      "references": [
        {
          "url": "https://lists.debian.org/debian-lts-announce/2025/05/msg00039.html"
        }
      ],
      "providerMetadata": {
        "orgId": "af854a3a-2127-422b-91ae-364da2661108",
        "shortName": "CVE",
        "dateUpdated": "2025-05-29T09:03:17.579Z"
      }
    }
  ]
}
Archived source JSON
OSV · osv · full conditions
{
  "id": "GHSA-6377-hfv9-hqf6",
  "aliases": [
    "CVE-2024-51754"
  ],
  "affected": [
    {
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.11.2"
            }
          ]
        }
      ],
      "package": {
        "name": "twig/twig",
        "purl": "pkg:composer/twig/twig",
        "ecosystem": "Packagist"
      },
      "versions": [
        "1.3.0",
        "1.4.0",
        "1.5.0",
        "1.5.1",
        "1.6.0",
        "1.6.1",
        "1.6.2",
        "1.6.3",
        "1.6.4",
        "1.6.5",
        "v1.10.0",
        "v1.10.1",
        "v1.10.2",
        "v1.10.3",
        "v1.11.0",
        "v1.11.1",
        "v1.12.0",
        "v1.12.0-RC1",
        "v1.12.1",
        "v1.12.2",
        "v1.12.3",
        "v1.13.0",
        "v1.13.1",
        "v1.13.2",
        "v1.14.0",
        "v1.14.1",
        "v1.14.2",
        "v1.15.0",
        "v1.15.1",
        "v1.16.0",
        "v1.16.1",
        "v1.16.2",
        "v1.16.3",
        "v1.17.0",
        "v1.18.0",
        "v1.18.1",
        "v1.18.2",
        "v1.19.0",
        "v1.20.0",
        "v1.21.0",
        "v1.21.1",
        "v1.21.2",
        "v1.22.0",
        "v1.22.1",
        "v1.22.2",
        "v1.22.3",
        "v1.23.0",
        "v1.23.1",
        "v1.23.2",
        "v1.23.3",
        "v1.24.0",
        "v1.24.1",
        "v1.24.2",
        "v1.25.0",
        "v1.26.0",
        "v1.26.1",
        "v1.27.0",
        "v1.28.0",
        "v1.28.1",
        "v1.28.2",
        "v1.29.0",
        "v1.30.0",
        "v1.31.0",
        "v1.32.0",
        "v1.33.0",
        "v1.33.1",
        "v1.33.2",
        "v1.34.0",
        "v1.34.1",
        "v1.34.2",
        "v1.34.3",
        "v1.34.4",
        "v1.35.0",
        "v1.35.1",
        "v1.35.2",
        "v1.35.3",
        "v1.35.4",
        "v1.36.0",
        "v1.37.0",
        "v1.37.1",
        "v1.38.0",
        "v1.38.1",
        "v1.38.2",
        "v1.38.3",
        "v1.38.4",
        "v1.39.0",
        "v1.39.1",
        "v1.40.0",
        "v1.40.1",
        "v1.41.0",
        "v1.42.0",
        "v1.42.1",
        "v1.42.2",
        "v1.42.3",
        "v1.42.4",
        "v1.42.5",
        "v1.43.0",
        "v1.43.1",
        "v1.44.0",
        "v1.44.1",
        "v1.44.2",
        "v1.44.3",
        "v1.44.4",
        "v1.44.5",
        "v1.44.6",
        "v1.44.7",
        "v1.44.8",
        "v1.7.0",
        "v1.8.0",
        "v1.8.1",
        "v1.8.2",
        "v1.8.3",
        "v1.9.0",
        "v1.9.1",
        "v1.9.2",
        "v2.0.0",
        "v2.1.0",
        "v2.10.0",
        "v2.11.0",
        "v2.11.1",
        "v2.11.2",
        "v2.11.3",
        "v2.12.0",
        "v2.12.1",
        "v2.12.2",
        "v2.12.3",
        "v2.12.4",
        "v2.12.5",
        "v2.13.0",
        "v2.13.1",
        "v2.14.0",
        "v2.14.1",
        "v2.14.10",
        "v2.14.11",
        "v2.14.12",
        "v2.14.13",
        "v2.14.2",
        "v2.14.3",
        "v2.14.4",
        "v2.14.5",
        "v2.14.6",
        "v2.14.7",
        "v2.14.8",
        "v2.14.9",
        "v2.15.0",
        "v2.15.1",
        "v2.15.2",
        "v2.15.3",
        "v2.15.4",
        "v2.15.5",
        "v2.15.6",
        "v2.16.0",
        "v2.16.1",
        "v2.2.0",
        "v2.3.0",
        "v2.3.1",
        "v2.3.2",
        "v2.4.0",
        "v2.4.1",
        "v2.4.2",
        "v2.4.3",
        "v2.4.4",
        "v2.4.5",
        "v2.4.6",
        "v2.4.7",
        "v2.4.8",
        "v2.5.0",
        "v2.6.0",
        "v2.6.1",
        "v2.6.2",
        "v2.7.0",
        "v2.7.1",
        "v2.7.2",
        "v2.7.3",
        "v2.7.4",
        "v2.8.0",
        "v2.8.1",
        "v2.9.0",
        "v3.0.0",
        "v3.0.0-BETA1",
        "v3.0.1",
        "v3.0.2",
        "v3.0.3",
        "v3.0.4",
        "v3.0.5",
        "v3.1.0",
        "v3.1.1",
        "v3.10.0",
        "v3.10.1",
        "v3.10.2",
        "v3.10.3",
        "v3.11.0",
        "v3.11.1",
        "v3.2.1",
        "v3.3.0",
        "v3.3.1",
        "v3.3.10",
        "v3.3.2",
        "v3.3.3",
        "v3.3.4",
        "v3.3.5",
        "v3.3.6",
        "v3.3.7",
        "v3.3.8",
        "v3.3.9",
        "v3.4.0",
        "v3.4.1",
        "v3.4.2",
        "v3.4.3",
        "v3.5.0",
        "v3.5.1",
        "v3.6.0",
        "v3.6.1",
        "v3.7.0",
        "v3.7.1",
        "v3.8.0",
        "v3.9.0",
        "v3.9.1",
        "v3.9.2",
        "v3.9.3"
      ],
      "database_specific": {
        "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/11/GHSA-6377-hfv9-hqf6/GHSA-6377-hfv9-hqf6.json"
      }
    },
    {
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "3.12"
            },
            {
              "fixed": "3.14.1"
            }
          ]
        }
      ],
      "package": {
        "name": "twig/twig",
        "purl": "pkg:composer/twig/twig",
        "ecosystem": "Packagist"
      },
      "versions": [
        "v3.12.0",
        "v3.13.0",
        "v3.14.0"
      ],
      "database_specific": {
        "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/11/GHSA-6377-hfv9-hqf6/GHSA-6377-hfv9-hqf6.json"
      }
    }
  ],
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N"
    },
    {
      "type": "CVSS_V4",
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
    }
  ],
  "upstream": [],
  "withdrawn": null,
  "references": [
    {
      "url": "https://github.com/twigphp/Twig/security/advisories/GHSA-6377-hfv9-hqf6",
      "type": "WEB"
    },
    {
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51754",
      "type": "ADVISORY"
    },
    {
      "url": "https://github.com/twigphp/Twig/commit/2bb8c2460a2c519c498df9b643d5277117155a73",
      "type": "WEB"
    },
    {
      "url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2024-51754.yaml",
      "type": "WEB"
    },
    {
      "url": "https://github.com/twigphp/Twig",
      "type": "PACKAGE"
    },
    {
      "url": "https://lists.debian.org/debian-lts-announce/2025/05/msg00039.html",
      "type": "WEB"
    },
    {
      "url": "https://symfony.com/blog/unguarded-calls-to-__tostring-when-nesting-an-object-into-an-array",
      "type": "WEB"
    }
  ],
  "relatedGitRanges": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-668"
    ],
    "severity": "LOW",
    "github_reviewed": true,
    "nvd_published_at": "2024-11-06T20:15:05Z",
    "github_reviewed_at": "2024-11-06T19:52:31Z"
  }
}
Archived source JSON

Correction evidence

Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.

Evidence typeDistribution / releasePackageChannelVersion or source noteSource
ecosystem-boundaryPackagist / packagetwig/twigNot a distribution channel3.11.2Official record
ecosystem-boundaryPackagist / packagetwig/twigNot a distribution channel3.14.1Official record

Vendor notices and operational guidance

No connected vendor notice is available for this record.

Original sources and dates

Official status history