Skip to content
Laskyr

smarty/smarty security advisory

CVE-2026-62996: Smarty Security stream restriction bypass through stream: resource

CVE-2026-62996 is a medium-severity path traversal vulnerability in the PHP package smarty/smarty (CVSS 6.9), published 7 August 2026. It is fixed in 5.8.4; earlier versions are affected. Exploiting it needs an admin-level account.

medium 6.9 published 2026-08-07 · updated 2026-10-24

Fixed in smarty/smarty 5.8.4

This path traversal issue affects smarty/smarty versions >= 5.0.0, < 5.8.4. Upgrade to the fixed version for your release line (5.8.4). The newest release, 5.8.5, is not affected.

Affected versions
>= 5.0.0, < 5.8.4
Fixed in
5.8.4
Newest release
5.8.5
Severity
Medium · CVSS 6.9
Type
Path traversal / file read
CWE-22
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-04

Is your smarty/smarty version affected?

Run composer show smarty/smarty in your project, then enter the version. We check it against this and every other known smarty/smarty advisory.

Who can exploit CVE-2026-62996

CVSS vector (scored by GitHub): CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Your app is only exposed if it uses the affected part of smarty/smarty. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-62996 in smarty/smarty

  1. Find the installed version: composer show smarty/smarty. If you never required it yourself, composer why smarty/smarty shows which package pulls it in.
  2. Update it: composer update smarty/smarty --with-all-dependencies. You need 5.8.4 or newer.
  3. If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example "smarty/smarty": "^5.8.4" if you can take that version), or upgrade the package that requires it.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-62996.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for path traversal issues while the upgrade waits. None of it replaces the fix.

The CVE-2026-62996 advisory

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. From 5.0.0 until 5.8.4, Smarty's stream: resource-name handling does not adequately restrict which PHP stream wrappers and filter chains can be referenced from a template, allowing a php://filter-wrapped resource name to be used to read the contents of arbitrary local files accessible to the PHP process. An attacker able to author or influence a template's resource reference could exploit this to disclose sensitive file contents outside the intended template/config scope. This issue is fixed in version 5.8.4.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-62996. Advisory title: “Smarty Security stream restriction bypass through stream: resource”.

References

Other smarty/smarty advisories

Related

Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.

Ask about a fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit