Twigphp Twig
Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation
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.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS8.8high · scored by NVD · CWE-94
CISA KEV
Not listednot known exploited
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
twigphp Twig
- >= 3.15.0, < 3.26.0
Fixed in 3.26.0
Mitigation
Upgrade Twig to 3.26.0 or later.
References
- Vendor advisory github.com/twigphp/Twig/security/advisories/GH…
- Patch github.com/twigphp/Twig/commit/324fa60545694fa…
- Release notes github.com/twigphp/Twig/releases/tag/v3.26.0
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.1 suspicious or fake
Suspicious or fake 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| vladko312/extras | 14 Oct 2024 −1.7 y | 18 | Fake |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.