CVEMETERBack to radar
OFFICIAL RECORD · PHP packages

CVE-2026-46640

PUBLISHEDOfficial status check: verifiedCVSS 4.0: 8.7 · high

Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation

Twig is a template language for PHP. From 3.15.0 until 3.26.0, _self.(<string>) and import-alias dynamic attribute syntax can concatenate an attacker-controlled string into a MacroReferenceExpression name without identifier validation, causing raw PHP to be emitted into the generated template source and executed at template-load time. This issue is fixed in version 3.26.0.

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

Severity and exploitation evidence

EPSS: 0.642% · 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-19T16:57:41.748Z. Public exploit availability is not used to set this status.

CVSS 4.0 · 8.7 · published by GitHub_M
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Assessment source · checked 2026-11-19T12:01:57.803Z

Verification by field

FieldStatusChecked at (UTC)Source
kevverified2026-11-19T16:57:41.748ZCISA KEV
cvssverified2026-11-19T12:01:57.803ZCVE Program
epssverified2026-11-19T16:04:50.912ZFIRST EPSS
patchesverified2026-11-19T12:52:00.377ZOSV
affectedverified2026-11-19T12:01:57.803ZCVE Program
lifecycleverified2026-11-19T12:01:57.803ZCVE Program

Affected versions and configuration

twigphp Twig; default status: unknown: >= 3.15.0, < 3.26.0 [affected; scheme: unspecified]

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

OSV · osv · full conditions
{
  "id": "GHSA-45vw-wh46-2vx8",
  "aliases": [
    "CVE-2026-46640"
  ],
  "affected": [
    {
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "3.15.0"
            },
            {
              "fixed": "3.26.0"
            }
          ]
        }
      ],
      "package": {
        "name": "twig/twig",
        "purl": "pkg:composer/twig/twig",
        "ecosystem": "Packagist"
      },
      "versions": [
        "v3.15.0",
        "v3.16.0",
        "v3.17.0",
        "v3.17.1",
        "v3.18.0",
        "v3.19.0",
        "v3.20.0",
        "v3.21.0",
        "v3.21.1",
        "v3.22.0",
        "v3.22.1",
        "v3.22.2",
        "v3.23.0",
        "v3.24.0",
        "v3.25.0"
      ],
      "database_specific": {
        "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-45vw-wh46-2vx8/GHSA-45vw-wh46-2vx8.json"
      }
    }
  ],
  "severity": [
    {
      "type": "CVSS_V4",
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
    }
  ],
  "upstream": [],
  "withdrawn": null,
  "references": [
    {
      "url": "https://github.com/twigphp/Twig/security/advisories/GHSA-45vw-wh46-2vx8",
      "type": "WEB"
    },
    {
      "url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46640.yaml",
      "type": "WEB"
    },
    {
      "url": "https://github.com/twigphp/Twig",
      "type": "PACKAGE"
    },
    {
      "url": "https://github.com/vladko312/extras/blob/main/CVE-2026-46640.py",
      "type": "WEB"
    },
    {
      "url": "https://symfony.com/cve-2026-46640",
      "type": "WEB"
    }
  ],
  "relatedGitRanges": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "nvd_published_at": null,
    "github_reviewed_at": "2026-05-21T21:31:08Z"
  }
}
Archived source JSON
CVE Program · cve-json · full conditions
{
  "affected": [
    {
      "vendor": "twigphp",
      "product": "Twig",
      "versions": [
        {
          "status": "affected",
          "version": ">= 3.15.0, < 3.26.0"
        }
      ]
    }
  ],
  "additionalContainers": [
    {
      "title": "CISA ADP Vulnrichment",
      "metrics": [
        {
          "other": {
            "type": "ssvc",
            "content": {
              "id": "CVE-2026-46640",
              "role": "CISA Coordinator",
              "options": [
                {
                  "Exploitation": "none"
                },
                {
                  "Automatable": "no"
                },
                {
                  "Technical Impact": "total"
                }
              ],
              "version": "2.0.3",
              "timestamp": "2026-07-15T00:00:00+00:00"
            }
          }
        }
      ],
      "providerMetadata": {
        "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "shortName": "CISA-ADP",
        "dateUpdated": "2026-07-16T03:55:34.985Z"
      }
    }
  ]
}
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.26.0Official record

Vendor notices and operational guidance

No connected vendor notice is available for this record.

Original sources and dates

Official status history