{
  "id": "CVE-2026-46640",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-46640",
  "published_at": "2026-07-14T21:22:57.332Z",
  "title": "Twig: Arbitrary PHP code execution via `_self.(\u003cstring\u003e)` macro-reference compilation",
  "vendor": "twigphp",
  "product": "Twig",
  "cvss": {
    "score": 8.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "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.",
  "cwe": "CWE-94",
  "cpes": [
    "cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 8.7,
    "nvd": 8.8
  },
  "repos": [
    {
      "repo": "vladko312/extras",
      "url": "https://github.com/vladko312/extras",
      "created_at": "2024-10-14T17:47:19Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 18,
      "is_poc": "fake",
      "kind": "fake",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2018-03-15T15:04:46Z"
    }
  ],
  "remediation": {
    "affected": [
      {
        "vendor": "twigphp",
        "product": "Twig",
        "ranges": [
          "\u003e= 3.15.0, \u003c 3.26.0"
        ],
        "fixed_in": [
          "3.26.0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Twig to 3.26.0 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/twigphp/Twig/security/advisories/GHSA-45vw-wh46-2vx8"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/twigphp/Twig/commit/324fa60545694fa6abe85ded9befcb82e1066bc2"
      },
      {
        "kind": "Release notes",
        "url": "https://github.com/twigphp/Twig/releases/tag/v3.26.0"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
