CVE Catalog

CVE-2026-46640

HighCVSS 8.8
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.41%

33th percentile - higher than 33% of all known CVEs

Summary

A vulnerability in the Twig template library for PHP (versions 3.15.0 through 3.26.0) allows an attacker to inject PHP code via the _self.(<string>) and import-alias dynamic attribute syntax. Lack of identifier validation causes attacker-controlled strings to be emitted as raw PHP into the generated template source and executed at template-load time.

Risk Assessment

An attacker can remotely execute arbitrary PHP code on the server, leading to full application compromise, data theft, or further attacks on the infrastructure.

Recommendation

Immediately update Twig to version 3.26.0 or later. If an update is not possible, restrict access to templates and do not trust user input used in dynamic attribute syntax.

Other vulnerabilities in Twig

See all
Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS