CVE-2026-62992: Smarty: Symlink path traversal out of trusted directories
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).
References
- github.com/advisories/GHSA-f6wf-28g6-769x
- github.com/smarty-php/smarty/commit/99c048ce7a590c519b79fbd38ad0143a08183a1f
- github.com/smarty-php/smarty/commit/a1ccdb0518021a559b4066c37b76a42c86bbce90
- github.com/smarty-php/smarty/releases/tag/v4.5.7
- github.com/smarty-php/smarty/releases/tag/v5.8.2
- github.com/smarty-php/smarty/security/advisories/GHSA-f6wf-28g6-769x
- nvd.nist.gov/vuln/detail/CVE-2026-62992
Code Behaviors & Features
Detect and mitigate CVE-2026-62992 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →