Twigphp Twig
Twig: PHP code injection via `{% use %}` template name
Twig is a template language for PHP. Starting in 1.15.1 and prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS9.8critical · 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
- >= 1.15.1, < 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/679447fa2908304…
- Patch github.com/twigphp/Twig/commit/a2c6db7ea7d2c90…
2 more
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.