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
- 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?
Who can exploit CVE-2026-62996
- Access: A high-privilege account in the app, such as an admin.
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
How to fix CVE-2026-62996 in smarty/smarty
- Find the installed version:
composer show smarty/smarty. If you never required it yourself,composer why smarty/smartyshows which package pulls it in. - Update it:
composer update smarty/smarty --with-all-dependencies. You need 5.8.4 or newer. - 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. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-62996. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Validate file names against an allow-list and reject paths containing ../ or absolute paths.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
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.
References
- GitHub advisory GHSA-rjhh-76wf-8xmw github.com
- Fix commit 3c9f77a github.com
- Pull request #1195 github.com
- Release v5.8.4 github.com
Other smarty/smarty advisories
- medium CVE-2026-62993: Smarty: SSRF via redirect bypass of trusted_uri using {fetch} 2026-09-01
- medium CVE-2026-62992: Smarty: Symlink path traversal out of trusted directories 2026-08-07
- high CVE-2024-35226: Smarty vulnerable to PHP Code Injection by malicious attribute in extends-tag 2024-05-29
- high CVE-2023-28447: Cross site scripting vulnerability in Javascript escaping 2023-03-28
- medium CVE-2018-25047: Smarty_function_mailto - JavaScript injection in eval function 2022-09-14
- high CVE-2022-29221: PHP Code Injection by malicious block or filename 2022-05-17
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 fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.