smarty/smarty security advisory
CVE-2026-62992: Smarty: Symlink path traversal out of trusted directories
CVE-2026-62992 is a medium-severity path traversal vulnerability in the PHP package smarty/smarty (CVSS 6.9), published 7 August 2026. It is fixed in 4.5.7 and 5.8.2, one per release line; earlier versions on each line are affected. Exploiting it needs an admin-level account.
medium 6.9 published 2026-08-07 · updated 2026-10-24
- Affected versions
- < 4.5.7
>= 5.0.0, < 5.8.2 - Fixed in
- 4.5.7, 5.8.2
- Newest release
- 5.8.5
- Severity
- Medium · CVSS 6.9
- Type
- Path traversal / file read
CWE-22, CWE-61 - 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-62992
- 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-62992 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 the fixed version for your release line (4.5.7 and 5.8.2). - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"smarty/smarty": "^5.8.2"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-62992. - 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-62992 advisory
Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to 5.8.2 (and 4.5.7 on the 4.x line), Security::_checkDir() does not fully resolve symbolic links before validating that a requested path lies within a configured secure directory. An attacker able to place or reference a symlink within a directory Smarty treats as trusted (e.g., a template or config directory) could use it to point outside the intended secure directory, bypassing the containment check and reading arbitrary files accessible to the PHP process. This issue is fixed in versions 5.8.2 and 4.5.7.
References
- GitHub advisory GHSA-f6wf-28g6-769x github.com
- Fix commit 99c048c github.com
- Fix commit a1ccdb0 github.com
- Release v4.5.7 github.com
- Release v5.8.2 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-62996: Smarty Security stream restriction bypass through stream: resource 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.