CVE-2026-62992

Smarty: Symlink path traversal out of trusted directories

Published Aug 7, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

This vulnerability arises from the Security::_checkDir() method in Smarty, which fails to normalize symbolic links before verifying that a requested path resides inside a secure directory. An attacker who can create or reference a symlink inside a directory that Smarty treats as trusted—such as a template or configuration folder—can redirect the lookup to arbitrary files readable by the PHP process, thereby bypassing containment checks. The flaw manifests as a classic path traversal violation, identified as CWE‑22 and CWE‑61.

Affected Systems

The issue affects the Smarty PHP template engine before version 5.8.2 on the 5.x line and before version 4.5.7 on the 4.x line. These versions are identified under the vendor/product pair smarty‑php:smarty. The fix was included in releases 5.8.2 and 4.5.7, and the corresponding commits are logged in the project's GitHub repository.

Risk and Exploitability

The CVSS score of 6.9 indicates moderate severity, and the vulnerability is not listed in the CISA KEV catalog. No EPSS value is reported, so the current exploitation probability cannot be quantified from the available data. The likely attack vector is local or remote, contingent upon the ability for an attacker to create or reference a symbolic link within a Smarty‑trusted directory. If the application exposes write or file‑selection capabilities in those directories, the risk is higher; otherwise, the exposure is limited to systems that can influence the file system structure.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Smarty to version 5.8.2 or later on the 5.x line, or to version 4.5.7 or later on the 4.x line to apply the security fix.
  • If an upgrade is not immediately possible, apply the patch from the official GitHub commit 99c048ce7a590c519b79fbd38ad0143a08183a1f or commit a1ccdb0518021a559b4066c37b76a42c86bbce90 that addresses the symlink resolution bug.
  • Configure the file system so that Smarty’s trusted directories are not writable by the web application and disable symbolic link creation in those locations, for example by setting strict directory permissions or disabling PHP’s symlink support if it is not required.

Generated by OpenCVE AI on August 7, 2026 at 16:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-f6wf-28g6-769x Smarty: Symlink path traversal out of trusted directories
History
Type Values Removed Values Added
First Time appeared Smarty-php
Smarty-php smarty
Vendors & Products Smarty-php
Smarty-php smarty
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Smarty: Symlink path traversal out of trusted directories
Weaknesses CWE-22
CWE-61
References
Metrics cvssV4_0

{'score': 6.9, 'vector': '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'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-61

    UNIX Symbolic Link (Symlink) Following

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 7, 2026, 4:00 PM
Reserved
Jul 14, 2026, 11:10 PM
Status
Deferred
Published
Aug 7, 2026, 4:17 PM
Modified
Oct 24, 2026, 4:10 PM