CVE-2026-46640

Source
https://cve.org/CVERecord?id=CVE-2026-46640
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46640.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-46640
Aliases
Downstream
Related
Published
2026-07-14T21:22:57.332Z
Modified
2026-07-17T03:45:29.112074258Z
Severity
  • 8.7 (High) CVSS_V4 - 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 CVSS Calculator
Summary
Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation
Details

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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46640.json",
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
        "CWE-94"
    ]
}
References

Affected packages

Git / github.com/twigphp/twig

Affected ranges

Type
GIT
Repo
https://github.com/twigphp/twig
Events
Database specific
{
    "cpe": "cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*",
    "source": [
        "CPE_RANGE",
        "REFERENCES"
    ],
    "extracted_events": [
        {
            "introduced": "3.15.0"
        },
        {
            "fixed": "3.26.0"
        }
    ]
}

Affected versions

v3.*
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://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46640.json"