CVE-2026-46640

high

Description

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.

References

https://github.com/twigphp/Twig/security/advisories/GHSA-45vw-wh46-2vx8

https://github.com/twigphp/Twig/releases/tag/v3.26.0

https://github.com/twigphp/Twig/commit/324fa60545694fa6abe85ded9befcb82e1066bc2

Details

Source: Mitre, NVD

Published: 2026-07-14

Updated: 2026-07-16

Risk Information

CVSS v2

Base Score: 9

Vector: CVSS2#AV:N/AC:L/Au:S/C:C/I:C/A:C

Severity: High

CVSS v3

Base Score: 8.8

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Severity: High

CVSS v4

Base Score: 8.7

Vector: 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

Severity: High

EPSS

EPSS: 0.00056