CVE-2026-62992

CVE-2026-62992 is a medium-severity path traversal vulnerability in smarty/smarty (composer), affecting versions >= 5.0.0, < 5.8.2. It is fixed in 5.8.2, 4.5.7.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

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).

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.

References

  • Fix commit: 99c048c
  • CWE-22

Impact

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.

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

Affected versions

smarty/smarty (>= 5.0.0, < 5.8.2) smarty/smarty (< 4.5.7)

Security releases

smarty/smarty → 5.8.2 (composer) smarty/smarty → 4.5.7 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Fixed in 5.8.2. Security::_checkDir() now resolves the requested file with native realpath() and re-validates the canonical, symlink-free path against the trusted directories (which are canonicalized the same way, so legitimate symlinked deployment paths such as a Capistrano current symlink or macOS /var → /private/var keep working). It falls back to string normalization only when the file does not yet exist on disk.

Frequently Asked Questions

  1. What is CVE-2026-62992? CVE-2026-62992 is a medium-severity path traversal vulnerability in smarty/smarty (composer), affecting versions >= 5.0.0, < 5.8.2. It is fixed in 5.8.2, 4.5.7. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
  2. Which versions of smarty/smarty are affected by CVE-2026-62992? smarty/smarty (composer) versions >= 5.0.0, < 5.8.2 is affected.
  3. Is there a fix for CVE-2026-62992? Yes. CVE-2026-62992 is fixed in 5.8.2, 4.5.7. Upgrade to this version or later.
  4. Is CVE-2026-62992 exploitable, and should I be worried? Whether CVE-2026-62992 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2026-62992 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2026-62992?
    • Upgrade smarty/smarty to 5.8.2 or later
    • Upgrade smarty/smarty to 4.5.7 or later

Other vulnerabilities in smarty/smarty

Stop the waste.
Protect your environment with Kodem.