Severity by source
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
High complexity (AC:H) because a specific deployment overlap between upload paths and trusted template directories is required; PR:H and C:H match the official assessment.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
3DescriptionCVE.org
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.
AnalysisAI
Symlink-based path traversal in Smarty's Security::_checkDir() allows an attacker who can place a symbolic link inside a trusted directory (such as a template or upload path) to read arbitrary files accessible to the PHP process, bypassing the configured secure_dir sandbox entirely. Affected are Smarty 5.x versions prior to 5.8.2 and all 4.x releases prior to 4.5.7, when Smarty's Security policy is enabled. The root cause is that _checkDir() resolves paths via string normalization only, while the underlying file_get_contents() call faithfully follows symlinks to their targets outside the sandbox. No public exploit code or CISA KEV listing has been identified at time of analysis.
Technical ContextAI
Smarty (cpe:2.3:a:smarty-php:smarty:*:*:*:*:*:*:*:*) is a PHP template engine that exposes {include} and {fetch} directives for reading local files. When its Security policy is active, Security::_checkDir() gates every file-read by verifying the requested path falls within a configured set of secure_dir or template directories. The flaw (CWE-22, Path Traversal) is that _checkDir() canonicalized paths using Smarty::_realpath(), a custom method that only normalizes dot-segments and separators as a string operation - it never calls the native PHP realpath() and therefore never resolves symbolic links to their on-disk targets. Because the subsequent file read (file_get_contents()) does follow symlinks, a symlink placed inside a trusted directory passed the trust check while pointing outside the sandbox. The fix in commits 99c048c and a1ccdb0 replaces the string-only normalization with native realpath() for files that exist on disk, and also canonicalizes trusted-directory entries the same way, preserving legitimate deployment symlinks such as Capistrano current or macOS /var → /private/var.
RemediationAI
The primary fix is to upgrade to Smarty 5.8.2 (5.x users) or Smarty 4.5.7 (4.x users); both releases are available via Composer (composer update smarty/smarty) and as tagged GitHub releases at https://github.com/smarty-php/smarty/releases/tag/v5.8.2 and https://github.com/smarty-php/smarty/releases/tag/v4.5.7. For deployments that cannot patch immediately, the recommended workaround per the GHSA advisory (https://github.com/smarty-php/smarty/security/advisories/GHSA-f6wf-28g6-769x) is to ensure that no untrusted process or user can create files or symlinks within any directory listed in secure_dir or the configured template directories - concretely, restrict filesystem write permissions on those directories to the application's own deployment user only and remove any user-upload paths from the set of Smarty-trusted directories. The trade-off of the workaround is operational complexity: it may require restructuring upload handling so that user-writable paths are fully separate from Smarty-trusted paths.
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-54498
GHSA-f6wf-28g6-769x