Smarty, the PHP template engine sitting under a lot of storefronts and control panels you did not choose on purpose, shipped a quiet code-injection fix over the weekend. The CVE identifier arrived Tuesday. If caching is on and attacker-controlled text is rendered unescaped through multi-component template inheritance, that text can forge a cache marker and run as PHP the next time the cache is included.
The cyber stories that matter, explained in 5 minutes. Free, every weekday. Join 1,600+ readers.
Plus get our free Scam Survival Kit (PDF).
Most teams did not pick Smarty. It arrived under a vendor app. Check the lockfile anyway.
The incident
CVE-2026-82531 covers Smarty before 4.5.8 and 5.x before 5.8.5. VulnCheck published the CVE on October 6, 2026; Smarty 5.8.5 and the project advisory GHSA-3w63-v7pm-cq9x landed October 4, with 4.5.8 on the 4.x line. The CVSS 4.0 score on the CVE record is 9.2. The project advisory labels it High.
Reading an older article? Use the brief to stay current.
Plain-English security news
Scams, breaches and what to do about them. Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
The mechanism: during extends: / multi-component inheritance the top-level nocache_hash is left null. That null collapses into an empty alternative in Smarty’s own cache-marker regex, so attacker-controlled page output can forge a SmartyNocache marker whose raw content is copied into the regenerated PHP cache file. Skipping the usual PHP-tag neutralization. And executed on the next include. Credit: MegaManSec.
What’s at stake
Packagist shows tens of millions of installs and hundreds of dependent packages. Direct users can composer update today. Downstream users wait for a vendor release that bumps the pin, and many of those vendors will never publish their own advisory for a dependency bump. The five preconditions (caching on, escaping off, multi-component extends, unescaped attacker data, cache regeneration) are real constraints. And they are also the exact shape of a high-traffic PHP app.
What to do first
- Update
smarty/smartyto 5.8.5 (5.x) or 4.5.8 (4.x). - Clear compiled-template and cache directories after the update. A patched binary can still include a poisoned cache file written before the fix.
- If you cannot update yet: turn off template caching, or enable HTML escaping on assigned output, or stop rendering attacker-controlled values unescaped into
extends:templates. Any one breaks the chain. - Ask every PHP vendor whose product embeds Smarty whether their next build includes 4.5.8 / 5.8.5. Do not wait for a customer-facing advisory that may never come.
Forward this
Reading an older article? Use the brief to stay current.
Plain-English security news
Scams, breaches and what to do about them. Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
If you own a PHP app or a vendor product that renders templates: Smarty needs 4.5.8 or 5.8.5. A cache-marker bug can turn ordinary assigned data into executable PHP under the right settings. Please check our composer.lock (and our vendors’) this week, update plus clear the template cache afterward.
Details
- CVE: CVE-2026-82531. CWE-94 code injection via forged nocache marker. CVE CVSS 4.0: 9.2. Project advisory: High (GHSA-3w63-v7pm-cq9x).
- Fixed: Smarty 4.5.8 and 5.8.5 (released October 4, 2026). CVE published October 6.
- Preconditions (all required): caching enabled; HTML escaping disabled; multi-component
extends:inheritance; attacker-controlled assigned data output unescaped; cache regeneration after compiled files exist. - Exploitation: Not reported by the project or VulnCheck at disclosure.
- Reporter: MegaManSec.
Hunt / verify
- Check
composer.lockforsmarty/smartybelow 4.5.8 / 5.8.5. - After updating, delete the compiled and cache directories so old poisoned files cannot be included.
- Grep cache directories for
SmartyNocachemarkers with an empty hash, and for unexpected<?php/<?=inside cache files that should only hold rendered content. - Confirm vendor release notes for any bundled Smarty bump; escalate if silent.
Smarty CVE-2026-82531 (code injection via nocache marker): update to 4.5.8 or 5.8.5, then clear template/cache dirs. Check composer.lock and every PHP vendor that embeds Smarty. Fix landed Oct 4; CVE Oct 6. Not reported exploited.
Sources
- Https://github.com/smarty-php/smarty/security/advisories/GHSA-3w63-v7pm-cq9x
- Https://www.vulncheck.com/advisories/smarty-before-4.5.8-and-5-x-before-5.8.5-php-code-injection-via-extends-inheritance-cache
- Https://severitydaily.com/smarty-cve-2026-82531-null-nocache-hash-empty-regex-alternative-4-5-8-5-8-5/
- Https://www.cve.org/CVERecord?id=CVE-2026-82531
- Https://packagist.org/packages/smarty/smarty
Newer CyberExperts coverage on this topic
This article still works as background. If you want the current picture, start with the freshest related coverage below and today's brief.
Holiday Shopping Scams 2026: How to Spot a Fake Store in 30 Seconds
Black Friday is Nov. 27. Here is how to spot a fake store in 30 seconds, skip scam ads and fake delivery...
Breaking Cyber and Physical Security Silos to Enhance Corporate Security
Corporate security spans digital systems and physical spaces, but the teams responsible for each often work apart. Breaking down those silos —...
How to Lower Your Cyber Insurance Premiums in 2027
A costly cyber insurance renewal doesn't have to mean cutting coverage. These strategies give insurers clear evidence of lower risk, from ISO...
Tuesday’s brief: CrowdStrike buys Zscaler, then a Cisco Expressway flaw under attack, stolen Azure keys and Cleverbridge card data
The fastest way to catch up on what changed after this article was published.
Start your morning with the signal that matters.
Get the biggest cybersecurity developments, why they matter, and where to go deeper on CyberExperts.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.