Smarty
Smarty before 4.5.8 and 5.x before 5.8.5 PHP Code Injection via extends: Inheritance Cache
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 4.5.8
- >= 5.0.0, < 5.8.5
Fixed in 4.5.8, 5.8.5
Mitigation
Upgrade smarty to 4.5.8 or 5.8.5 or later.
References
- Vendor advisory github.com/smarty-php/smarty/security/advisori…
- Patch github.com/smarty-php/smarty/commit/c0fdd4824a…
- Patch github.com/smarty-php/smarty/commit/1cba51cb81…
2 more
- Release notes github.com/smarty-php/smarty/releases/tag/v5.8…
- Release notes github.com/smarty-php/smarty/releases/tag/v4.5…
Timeline
Days relative to CVE publicationFirst public PoC 17 h after publication; not in CISA KEV. First PoC: murrez/CVE-2026-82531 (created 7 Oct 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| murrez/CVE-2026-82531 | 7 Oct 2026 +17 h | 2 | PoC |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.