Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain template authoring or injection access
-
DeliveryCraft `{include file="stream:php://filter/read=convert.base64-encode/resource=/path/to/sensitive/file"}`
-
ExploitSubmit template to Smarty-powered application
-
Execution`BasePlugin::load()` routes to `StreamPlugin` bypassing `isTrustedStream()` check
-
Persist`StreamPlugin::getContent()` calls `fopen()` on arbitrary local path
-
ImpactExfiltrate 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 |
| 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 |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Smarty before 3.1.21 allows remote attackers to bypass the secure mode restrictions and execute arbitrary PHP code as de
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insuff
Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in
Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring. Rated crit
PHP code injection in the Smarty templating engine allows remote code execution in applications running Smarty 4.x befor
Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Rate
Cross-site scripting (XSS) vulnerability in the smarty_function_html_options_optoutput function in distribution/libs/plu
Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode. Rated high
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
Symlink-based path traversal in Smarty's Security::_checkDir() allows an attacker who can place a symbolic link inside a
Smarty is a template engine for PHP. Rated medium severity (CVSS 6.1), this vulnerability is remotely exploitable, no au
Auth. Rated medium severity (CVSS 4.8), this vulnerability is remotely exploitable, low attack complexity. No vendor pat
EUVD-2026-54499
GHSA-rjhh-76wf-8xmw
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB