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.
Published: 2026-08-07
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Fri, 07 Aug 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Smarty-php
Smarty-php smarty
Vendors & Products Smarty-php
Smarty-php smarty

Fri, 07 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 07 Aug 2026 15:30:00 +0000

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'}


Subscriptions

Smarty-php Smarty
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-07T16:00:28.634Z

Reserved: 2026-07-14T23:10:57.031Z

Link: CVE-2026-62992

cve-icon Vulnrichment

Updated: 2026-08-07T16:00:24.911Z

cve-icon NVD

Status : Received

Published: 2026-08-07T16:17:25.833

Modified: 2026-08-07T16:17:25.833

Link: CVE-2026-62992

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T17:00:13Z

Weaknesses
  • CWE-22

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

  • CWE-61

    UNIX Symbolic Link (Symlink) Following