All vulnerabilities

Servers and applications

CVE-2026-62992

Symlink path traversal out of trusted directories

Severity
Medium
Published
20 Jul 2026
Last changed
20 Jul 2026
Added to UpHeron
3 Nov 2026
Fixed in
4.5.7, 5.8.2
Exploit chance
0.5% in the next 30 daysHigher than 45% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Path traversal (CWE-22)
Also known as
GHSA-f6wf-28g6-769x
Sources
Project advisories (GitHub)

Description

When Smarty's Security policy is enabled, secure_dir (and the configured template/trusted directories) restrict which local files a template may read via {include} and {fetch}. The trust check in Security::_checkDir() resolved the requested path with Smarty::_realpath(), which normalizes the path as a string only and does not follow symbolic links. A symlink placed inside a trusted directory therefore passed the trust check, while the underlying file_get_contents() followed it to an arbitrary file outside the sandbox (e.g. /etc/passwd).

An attacker able to (a) cause a symlink to exist inside a trusted directory (e.g. a user-upload area located within the template path) and (b) cause a template to reference that path can read arbitrary files readable by the PHP process, escaping the secure_dir boundary. Confidentiality impact only.

From smarty-php/smarty's security advisory.

Workarounds

Ensure no untrusted symlinks can be created within any directory listed in secure_dir/the trusted template directories; restrict write access to those directories to trusted processes only.

Workarounds as given by smarty-php/smarty's security advisory.

Affected software

SoftwareAffected versions
SmartyServers and applications · github:smarty-php/smarty
  • Every version before 4.5.7
  • From 5.0.0 before 5.8.2

About Smarty

Web template system in PHP

From Wikidata, CC0 1.0.
Monthly downloads (Packagist)
1,171,375Packagist, 15 Nov 2026
Total downloads (Packagist)
46,435,268Packagist, 15 Nov 2026
GitHub stars
2,351GitHub, 15 Nov 2026
Forks
703GitHub, 15 Nov 2026
Latest release
v5.8.5GitHub, 15 Nov 2026
Released
4 Oct 2026GitHub
License
GNU Lesser General Public LicenseWikidata
Written in
PHPWikidata
First released
2001Wikidata
First published on GitHub
30 Oct 2014GitHub

References