The PHP template engine under your storefront needs a quiet update

By George Bailey   Published: 10/07/26   Updated: 10/10/26   4 min read

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.

Most teams did not pick Smarty. It arrived under a vendor app. Check the lockfile anyway.

What happened

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.

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.

Why it matters

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

Forward this

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, and clear the template cache afterward.

Details

Hunt / verify

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

George Bailey

George Bailey is the byline of the CyberExperts editorial desk, the team behind the CyberExperts Daily Brief. The desk covers vulnerabilities, breaches and security news from vendor advisories, CISA alerts and other primary sources, and links those sources in every story. Questions or corrections: [email protected].