{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "cpe": "cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*",
            "extracted_events": [
              {
                "introduced": "3.15.0"
              },
              {
                "fixed": "3.26.0"
              }
            ],
            "source": [
              "CPE_RANGE",
              "REFERENCES"
            ]
          },
          "events": [
            {
              "introduced": "2d5b3964cc21d0188633d7ddce732dc8e874db02"
            },
            {
              "fixed": "1fcae487b180d78e6351f4e0afa91f9eab96a2bc"
            },
            {
              "fixed": "324fa60545694fa6abe85ded9befcb82e1066bc2"
            }
          ],
          "repo": "https://github.com/twigphp/twig",
          "type": "GIT"
        }
      ]
    }
  ],
  "aliases": [
    "GHSA-45vw-wh46-2vx8"
  ],
  "database_specific": {
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
      "CWE-94"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46640.json"
  },
  "details": "Twig is a template language for PHP. From 3.15.0 until 3.26.0, _self.(\u003cstring\u003e) 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.",
  "id": "CVE-2026-46640",
  "modified": "2026-07-17T03:41:44.688712244Z",
  "published": "2026-07-14T21:22:57.332Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/twigphp/Twig/releases/tag/v3.26.0"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46640.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/twigphp/Twig/security/advisories/GHSA-45vw-wh46-2vx8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-46640"
    },
    {
      "type": "FIX",
      "url": "https://github.com/twigphp/Twig/commit/324fa60545694fa6abe85ded9befcb82e1066bc2"
    }
  ],
  "schema_version": "1.8.0",
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Twig: Arbitrary PHP code execution via `_self.(\u003cstring\u003e)` macro-reference compilation"
}