
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-62996 is a security stream restriction bypass vulnerability in the Smarty PHP template engine, allowing an attacker with template authoring privileges to read arbitrary local files accessible to the PHP process by abusing the built-in stream: resource type. It affects Smarty versions >= 5.0.0 and < 5.8.4 (Composer package smarty/smarty). The vulnerability was published on July 20, 2026, and formally disclosed to the GitHub Advisory Database on August 7, 2026. It carries a CVSS v4.0 base score of 6.9 (Medium) (Github Advisory).
The root cause is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-66 (Improper Handling of File Names that Identify Virtual Resources). In Smarty\Resource\BasePlugin::load(), the built-in stream resource name is mapped directly to StreamPlugin before the code path that invokes stream_get_wrappers() and Security::isTrustedStream(), meaning the nested PHP stream wrapper (e.g., php://filter/...) is never validated against the security policy. StreamPlugin::getContent() then calls fopen($filepath, 'r+') on the nested URI directly, bypassing Security::$streams = null and the trusted-directory boundary. A malicious template payload such as {include file="stream:php://filter/read=convert.base64-encode/resource=/etc/passwd"} demonstrates the bypass; a PoC was included in the advisory (Github Advisory, Smarty PR #1195).
Successful exploitation allows a template author to read the contents of any local file readable by the PHP process, including application configuration files, credentials, and other sensitive data, by base64-encoding the output through php://filter and rendering it back in the template response. This bypasses both the Security::$streams = null restriction and the trusted-template-directory boundary that normally blocks path traversal. There is no integrity or availability impact; the vulnerability is limited to confidentiality of the vulnerable system (Github Advisory).
A proof-of-concept (PoC) was included in the original advisory and is publicly available, demonstrating successful file disclosure on Smarty 5.8.0 with Smarty Security enabled and all streams disabled. Exploitation requires high privileges — specifically, the ability to author or influence a template's resource reference — making mass exploitation less likely. The EPSS score is approximately 0.0035 (low probability of exploitation in the wild), and there is no current evidence of active in-the-wild exploitation or CISA KEV catalog listing (Github Advisory, Feedly).
$smarty->enableSecurity() and $smarty->security_policy->streams = null configured, and that an attacker can influence template content or resource references.stream: resource type to wrap a php://filter URI targeting a sensitive file:{include file="stream:php://filter/read=convert.base64-encode/resource=/etc/passwd"}base64 -d) to recover the plaintext file contents.stream:php://filter or stream:php:// in template file parameters or rendered template content.php://filter URIs.stream: resource types with nested :// URIs./etc/passwd, application .env or config files) via fopen() calls originating from StreamPlugin::getContent() in the Smarty stack (Github Advisory).Upgrade to Smarty version 5.8.4 or later, which fixes the issue by parsing the nested stream wrapper scheme in StreamPlugin::getContent() and validating it against Security::isTrustedStream() before calling fopen(), giving the stream: resource the same security check as direct wrapper paths (Smarty Release v5.8.4, Smarty PR #1195). As a workaround for environments that cannot immediately upgrade, restrict template authoring to fully trusted users and audit all templates for use of the stream: resource type with nested :// URIs. No configuration-only workaround fully mitigates the bypass in affected versions.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."