Skip to main content

Smarty CVE-2026-62992

| EUVDEUVD-2026-54498 MEDIUM
Path Traversal (CWE-22)
2026-08-07 GitHub_M GHSA-f6wf-28g6-769x
6.9
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify upload dir inside Smarty secure_dir
  2. Delivery
    Place symlink targeting sensitive file
  3. Exploit
    Trigger template render referencing symlink
  4. Execution
    _checkDir() approves symlink path
  5. Persist
    file_get_contents() follows symlink
  6. Impact
    Arbitrary file contents returned to attacker

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Smarty's Security policy must be explicitly instantiated and assigned to the Smarty object - this is not the default configuration. The attacker must be able to cause a symbolic link to exist inside a directory that Smarty lists as a trusted secure_dir or template directory (e.g., an upload area co-located with the template path). The attacker must additionally be able to cause a template to reference that symlink path via an {include} or {fetch} directive. Limiting factors: PR:H per the CVSS 4.0 vector - the attacker needs privileged write access to a trusted directory; the target file must be readable by the PHP process user; and the specific deployment must have a symlink-writable path that overlaps with Smarty's trust boundary, which is not a default or common setup.

Impact

The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N) yields a score of 6.9, reflecting high-privilege requirements but no user interaction and full confidentiality impact. The PR:H rating is critical context: exploitation requires the attacker to already possess sufficient access to create or place a symlink inside a directory that Smarty treats as trusted - a non-trivial prerequisite that substantially limits real-world exposure. The AC:L/AT:N pairing in the official vector appears slightly optimistic; a realistic assessment would assign AT:P because the attack depends on a specific deployment condition (a writable upload area co-located with the template path) that is not a default configuration. No EPSS score was provided in the input, but given the high-privilege prerequisite and the absence of any KEV listing or known POC, mass exploitation is implausible. Risk is highest for multi-tenant PHP applications (e.g., CMSes, web hosting panels) where lower-privileged users can write files to directories that a higher-privileged Smarty installation treats as trusted. The confidentiality-only impact (C:H, I:N, A:N) bounds the blast radius to information disclosure - sensitive files readable by the PHP process such as credentials, config files, or application source code.

Exploit ScenarioDerived

An attacker with write access to a web application's user-upload area - which an administrator has inadvertently placed inside a Smarty secure_dir - uploads or causes the creation of a symbolic link named (for example) config.php pointing to /etc/passwd or the application's database credentials file. The attacker then triggers a template render (via a normal application request) that causes Smarty to {include} or {fetch} that symlink path; _checkDir() validates the symlink's path (which lies inside the trusted directory) and approves it, while the subsequent file read follows the symlink to the sensitive target file, returning its contents to the attacker. No public exploit code is known at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 07, 2026

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.

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.

Affected VersionsENISA

smarty 5.0.0, < 5.8.2
smarty < 4.5.7

Affected Packages

composer smarty/smarty fix: 4.5.7, 5.8.2
euvd smarty fix: 4.5.7, 5.8.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Smarty gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 6.9 MEDIUM
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
vuln.today AI 4.4 MEDIUM

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.

3.1 AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 07, 2026 - 16:02 EUVD

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

Threat Intelligence Overview

EPSS Score
0.4%
Top 71% exploitable
Prevalence
Medium
widely used PHP template engine, common in legacy and mid-size PHP applications
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Smarty

View all
CVE-2014-8350 HIGH POC
7.5 Nov 03

Smarty before 3.1.21 allows remote attackers to bypass the secure mode restrictions and execute arbitrary PHP code as de

CVE-2018-13982 HIGH POC
7.5 Sep 18

Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insuff

CVE-2026-62996 MEDIUM POC
6.9 Aug 07

Smarty PHP template engine versions 5.0.0 through 5.8.3 expose a security policy bypass allowing file disclosure via the

CVE-2018-16831 MEDIUM POC
5.9 Sep 11

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in

CVE-2021-26120 CRITICAL
9.8 Feb 22

Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring. Rated crit

CVE-2026-82531 CRITICAL
9.2 Oct 06

PHP code injection in the Smarty templating engine allows remote code execution in applications running Smarty 4.x befor

CVE-2022-29221 HIGH
8.8 May 24

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Rate

CVE-2012-4277 MEDIUM POC
4.3 Aug 13

Cross-site scripting (XSS) vulnerability in the smarty_function_html_options_optoutput function in distribution/libs/plu

CVE-2021-26119 HIGH
7.5 Feb 22

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode. Rated high

CVE-2026-62993 MEDIUM
6.9 Aug 31

Server-side request forgery in Smarty's {fetch} template function (versions prior to 4.5.7 on the 4.x line and 5.8.2 on

CVE-2023-28447 MEDIUM
6.1 Mar 28

Smarty is a template engine for PHP. Rated medium severity (CVSS 6.1), this vulnerability is remotely exploitable, no au

CVE-2023-41661 MEDIUM
4.8 Sep 29

Auth. Rated medium severity (CVSS 4.8), this vulnerability is remotely exploitable, low attack complexity. No vendor pat

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy