CVE-2026-82531 Smarty before 4.5.8 and 5.x before 5.8.5 PHP Code Injection via extends: Inheritance Cache
Attackers can execute arbitrary PHP code by injecting forged nocache markers into template inheritance caches, affecting applications using the Smarty library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-82531?
CVE-2026-82531 is a critical code injection vulnerability in smarty-php smarty, published on 6 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-94
Which versions are affected by CVE-2026-82531?
How do I fix CVE-2026-82531?
No fix has been published for CVE-2026-82531 yet. Limit exposure of the affected software until one is available.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-82531 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-82531 exists.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as DEBIAN-CVE-2026-82531, GHSA-3w63-v7pm-cq9x, UBUNTU-CVE-2026-82531.