Skip to main content

Smarty CVE-2026-62996

| EUVDEUVD-2026-54499 MEDIUM
Path Traversal (CWE-22)
2026-08-07 GitHub_M GHSA-rjhh-76wf-8xmw
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
    Obtain template authoring or injection access
  2. Delivery
    Craft `{include file="stream:php://filter/read=convert.base64-encode/resource=/path/to/sensitive/file"}`
  3. Exploit
    Submit template to Smarty-powered application
  4. Execution
    `BasePlugin::load()` routes to `StreamPlugin` bypassing `isTrustedStream()` check
  5. Persist
    `StreamPlugin::getContent()` calls `fopen()` on arbitrary local path
  6. Impact
    Exfiltrate base64-encoded file contents

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

Exploitation requires two simultaneous conditions: (1) the attacker must be able to author or inject a value for the file parameter of an {include} tag or equivalent template resource directive in a Smarty-rendered template; and (2) the application must have Smarty Security enabled ($smarty->enableSecurity()) with Security::$streams set to null or a restricted allowlist, meaning the operator believed stream-wrapper access was blocked. Without Smarty Security enabled, all PHP stream wrappers are accessible by design and no security boundary exists to bypass. The stream: built-in resource type must be available (it is always present in Smarty 5.x). Exploitation is limited to reading files accessible to the PHP process user account - no code execution, write, or availability impact is possible through this vector (VC:H, VI:N, VA:N). The primary limiting factor is the PR:H requirement: an attacker must already hold template authoring privileges, which substantially narrows the attack surface to insider threats, compromised operator accounts, or applications that expose template authoring to semi-trusted users.

Impact

The CVSS 4.0 score of 6.9 accurately reflects the attack profile: network-reachable (AV:N), low complexity (AC:L), but gated behind high-privilege template authoring (PR:H) with confidentiality-only impact (VC:H/VI:N/VA:N). Real-world risk is highest for multi-tenant platforms, SaaS applications, or CMS deployments where end users or operators can specify template includes while the application relies on Smarty Security as an enforcement boundary. A public PoC exists per the GHSA advisory, lowering the bar for exploitation once access conditions are met. EPSS data was not provided. No CISA KEV listing exists, indicating no confirmed widespread active exploitation at time of analysis. The PR:H requirement meaningfully limits the attacker population - this is not an unauthenticated mass-exploitation scenario but a targeted privilege-escalation-to-data-disclosure path within applications that expose template authoring to semi-trusted users.

Exploit ScenarioDerived

An attacker with template authoring access - such as a CMS contributor, a low-privileged operator, or an attacker who has compromised template storage - submits a template containing {include file="stream:php://filter/read=convert.base64-encode/resource=/etc/passwd"}. Smarty's stream: resource routes the request through StreamPlugin before the security policy's stream restriction is evaluated, allowing fopen() to open the target file and return its base64-encoded contents to the attacker. A public PoC demonstrating this exact technique was included in GHSA-rjhh-76wf-8xmw.

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

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

Alert me

AnalysisAIv1 – Aug 07, 2026

Smarty PHP template engine versions 5.0.0 through 5.8.3 expose a security policy bypass allowing file disclosure via the built-in stream: resource type. When Smarty Security is enabled and Security::$streams is set to null or a restricted allowlist, an attacker able to author or influence a template resource reference can use stream:php://filter/... to read arbitrary local files accessible to the PHP process - bypassing the very control intended to block such access. A public proof-of-concept was disclosed in GHSA-rjhh-76wf-8xmw; no active exploitation is confirmed in CISA KEV. The issue is fixed in v5.8.4.

RemediationAI

Upgrade smarty/smarty to version 5.8.4 or later via Composer (composer require smarty/smarty:^5.8.4 or composer update smarty/smarty). The fix was implemented in commit 3c9f77a2e06ce319ae0092496af32cc8f3adc52e (PR #1195) and released at https://github.com/smarty-php/smarty/releases/tag/v5.8.4. The patch adds an explicit stream-wrapper validation step inside StreamPlugin::getContent() that parses the nested URI scheme and calls isTrustedStream() before fopen(). If an immediate upgrade is blocked, the most effective compensating control is to eliminate all untrusted influence over template resource references - specifically, never pass user-controlled strings as the file parameter of {include} directives. Note that relying solely on Security::$streams = null is not a compensating control for this CVE, as that is precisely the policy being bypassed. Auditing template storage and render pipelines for user-controlled include paths is advisable regardless of patching status.

Affected VersionsENISA

smarty 5.0.0, < 5.8.4

Affected Packages

composer smarty/smarty fix: 5.8.4
euvd smarty_5_0_0 fix: 5.8.4

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's resource-loading pipeline in BasePlugin::load() maps the built-in sysplugin name stream directly to StreamPlugin before the code path that validates PHP stream wrappers via stream_get_wrappers() and Security::isTrustedStream(). As a result, StreamPlugin::getContent() receives the nested URI (e.g., php://filter/read=convert.base64-encode/resource=/etc/passwd) and calls fopen() on it without the security policy having vetted the underlying php wrapper. The root cause is CWE-22 (Path Traversal) compounded by CWE-441 (Unintended Proxy/Intermediary), where the stream: resource acts as an unvalidated intermediary routing around the Security::$streams enforcement boundary. Affected package is smarty/smarty on Packagist, CPE cpe:2.3:a:smarty-php:smarty:*:*:*:*:*:*:*:*, versions 5.0.0 through 5.8.3.

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.9 MEDIUM

Template authoring privileges required (PR:H); network-reachable but scoped to file read only (C:H/I:N/A:N); no scope change beyond PHP process.

3.1 AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/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

2
Patch available
Aug 07, 2026 - 16:02 EUVD
CVE Published
Aug 07, 2026 - 15:04 cve.org
MEDIUM 6.9

DescriptionCVE.org

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. From 5.0.0 until 5.8.4, Smarty's stream: resource-name handling does not adequately restrict which PHP stream wrappers and filter chains can be referenced from a template, allowing a php://filter-wrapped resource name to be used to read the contents of arbitrary local files accessible to the PHP process. An attacker able to author or influence a template's resource reference could exploit this to disclose sensitive file contents outside the intended template/config scope. This issue is fixed in version 5.8.4.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
High
41M Packagist downloads; widely used PHP template engine
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA CIRCL 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 Yes
EPSS 0.3%
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
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

54
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: +20
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-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-2026-62992 MEDIUM
6.9 Aug 07

Symlink-based path traversal in Smarty's Security::_checkDir() allows an attacker who can place a symbolic link inside a

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