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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| smarty-php | smarty | < 4.5.8, 5.0.0 – < 5.8.5 | 4.5.8 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | smarty3 | No fix yet | — |
| Debian 14 | smarty4 | 4.5.8-1 | — |
| Debian 13 | smarty3 +1 | No fix yet | — |
| Debian 12 | smarty3 +1 | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | smarty3 +1 | No fix yet | — |
| Ubuntu 26.04 LTS | smarty3 +1 | No fix yet | — |
| Ubuntu 24.04 LTS | smarty3 +1 | No fix yet | — |
| Ubuntu 22.04 LTS | smarty3 | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | smarty3 | No fix yet | — |
| Ubuntu Pro 18.04 LTS | smarty3 | No fix yet | — |
| Ubuntu Pro 16.04 LTS | smarty3 | No fix yet | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
murrez/CVE-2026-82531 ★ 2 · Oct 7, 2026
Smarty is vulnerable to code injection through template inheritance. Crafted assigned data can inject a forged SmartyNocache marker into regenerated PHP cache files, potentially allowing attackers to…
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
References
- GitHub Security Advisory (GHSA-3w63-v7pm-cq9x) vendor-advisory
- https://github.com/smarty-php/smarty/commit/c0fdd4824aca4f67e814b50703cfee1dfde41414 patch
- https://github.com/smarty-php/smarty/commit/1cba51cb813563eb61d963c83d28cd59f26b858d patch
- smarty v5.8.5 Release Notes release-notes
- smarty v4.5.8 Release Notes release-notes
- VulnCheck Advisory: Smarty before 4.5.8 and 5.x before 5.8.5 PHP Code Injection via extends: Inheritance Cache third-party-advisory