Description
Smarty before 4.5.8 and 5.x before 5.8.5 contains a code injection vulnerability where the top-level nocache_hash is never restored during extends:/multi-component template inheritance, leaving it null. Attackers can supply assigned data containing a forged SmartyNocache marker that is copied verbatim into the regenerated PHP cache file, executing arbitrary PHP on include for remote code execution.
Severity (CVSS)
| Base score | 9.2 |
|---|---|
| Severity | Critical |
| Version | CVSS 4.0 |
| Vector | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| Provided by | CNA |
Weaknesses
- CWE-94 — Improper Control of Generation of Code ('Code Injection')
Affected products
| Vendor | Product | Versions |
|---|---|---|
| smarty-php | smarty | 0 to <4.5.8; 5.0.0 to <5.8.5; 4.5.8; 5.8.5 |
References
- https://github.com/smarty-php/smarty/security/advisories/GHSA-3w63-v7pm-cq9x (vendor-advisory)
- https://github.com/smarty-php/smarty/commit/c0fdd4824aca4f67e814b50703cfee1dfde41414 (patch)
- https://github.com/smarty-php/smarty/commit/1cba51cb813563eb61d963c83d28cd59f26b858d (patch)
- https://github.com/smarty-php/smarty/releases/tag/v5.8.5 (release-notes)
- https://github.com/smarty-php/smarty/releases/tag/v4.5.8 (release-notes)
- https://www.vulncheck.com/advisories/smarty-before-4.5.8-and-5-x-before-5.8.5-php-code-injection-via-extends-inheritance-cache (third-party-advisory)
Generated from the official CVE List on 07 Oct 2026 10:16 UTC.