Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply trusted-host URL with open redirect param
-
DeliveryPass isTrustedUri() allowlist check
-
Exploitfile_get_contents() follows HTTP redirect
-
ExecutionRedirect resolves to internal endpoint
-
PersistServer fetches internal resource
-
ImpactAttacker receives internal data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Credential Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Three conditions must all be satisfied simultaneously: (1) Smarty's security policy must be active - the redirect-following bug is only reachable in the code path that checks isTrustedUri(), which is invoked only when $template->smarty->security_policy is set; applications that do not enable a Smarty security policy are not affected by this specific bypass but may have broader template injection exposure. (2) The attacker must be able to supply or influence the URL argument passed to the {fetch} tag - this requires that user-controlled input reaches template rendering with an attacker-influenced fetch target, a configuration that is itself a design risk. (3) At least one host in the trusted_uri allowlist must host an exploitable open redirect - without this, the initial isTrustedUri() check blocks the malicious destination directly. The CVSS 4.0 AT:P metric captures requirement (3). Exploitation is limited to the 4.x and 5.x lines prior to the patched versions; no exploitation path exists against the subsequent-system scope without reachable internal services. |
| Impact | The CVSS 4.0 score of 6.9 (Medium) accurately reflects the chained-exploit nature of this vulnerability. The AT:P (Attack Requirements: Present) metric captures the critical prerequisite: an open redirect must independently exist on one of the trusted_uri hosts, making this a two-vulnerability chain rather than a standalone issue. The SC:H (Subsequent System Confidentiality: High) impact metric is appropriate because successful SSRF can expose sensitive internal services - cloud instance metadata (AWS IMDSv1, GCP metadata), internal APIs, or private network services - to the attacker. The VC:N/VI:N/VA:N metrics correctly reflect that the Smarty application server itself is not directly compromised. Real-world priority is moderate: exploitation requires (1) attacker influence over {fetch} target URLs, (2) an open redirect on a trusted domain, and (3) reachable internal services from the server. Environments using Smarty with a strict security policy AND having no open redirects on trusted hosts are not exploitable. EPSS data is not present in the provided intelligence; no KEV listing and no POC code are available, further supporting a non-urgent but genuine remediation priority for affected deployments. |
| Exploit ScenarioDerived | An attacker identifies that a PHP application uses Smarty with a security policy allowing fetch requests to https://trusted-partner.example.com and discovers an open redirect at https://trusted-partner.example.com/redirect?url=. The attacker submits a template or request parameter that causes {fetch} to request https://trusted-partner.example.com/redirect?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/, passing the isTrustedUri() check; file_get_contents() then silently follows the redirect to the AWS instance metadata service, returning IAM credential data that the attacker can exfiltrate. No public proof-of-concept code exists for this specific CVE, but the technique is a well-understood SSRF pattern requiring no special tooling beyond HTTP request construction. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 31, 2026
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 the 5.x line) allows network-accessible attackers to bypass the trusted_uri allowlist and reach arbitrary internal endpoints by exploiting PHP's default redirect-following behavior. The security policy's isTrustedUri() check validates only the initial URL; when file_get_contents() silently follows an HTTP redirect placed on a trusted host, the request lands on an attacker-chosen internal target, enabling SSRF to services such as cloud metadata endpoints or internal APIs. No public exploit has been identified at time of analysis, and the vulnerability is not listed in the CISA KEV catalog.
RemediationAI
Upgrade Smarty to version 4.5.7 (4.x line) or 5.8.2 (5.x line); these are the vendor-released patched versions confirmed by GitHub tagged releases at https://github.com/smarty-php/smarty/releases/tag/v4.5.7 and https://github.com/smarty-php/smarty/releases/tag/v5.8.2. If immediate upgrade is not possible, the following compensating controls reduce risk: disable or restrict use of the {fetch} template tag entirely by removing it from the allowed function list in the Smarty security policy - this eliminates the attack surface at the cost of losing remote content fetching capability in templates. Alternatively, audit and remediate any open redirects on all hosts listed in trusted_uri, as the attack chain requires a working open redirect on a trusted host; eliminating that prerequisite prevents exploitation even without patching. Restricting outbound HTTP from the PHP application server to explicitly whitelisted IPs (network egress filtering) limits the SSRF blast radius even if the vulnerability is triggered. The security advisory is at https://github.com/smarty-php/smarty/security/advisories/GHSA-cq55-c7wv-pxmq.
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 (cpe:2.3:a:smarty-php:smarty) is a PHP template engine that separates presentation from application logic. Its {fetch} plugin - implemented in libs/plugins/function.fetch.php (4.x) and src/FunctionHandler/Fetch.php (5.x) - fetches remote content using PHP's file_get_contents(). When a Smarty security policy is active, Security::isTrustedUri() validates the initial fetch URL against a trusted_uri allowlist (CWE-918). However, PHP's file_get_contents() follows HTTP redirects by default via its internal follow_location stream handling, meaning the validation occurs before the redirect chain resolves. An attacker who can influence the fetch target can provide a URL pointing to a trusted host that hosts an open redirect, causing the server-side HTTP client to be transparently forwarded to an attacker-chosen internal resource. The fix (PR #1194) introduces a stream context with follow_location => 0 and max_redirects => 1 whenever a security policy is in effect, preventing redirect-following entirely for remote fetches under policy.
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:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N
Attack requires open redirect on trusted host (AC:H); SSRF reads subsequent-system internal resources with high confidentiality impact (S:C, C:H); no integrity or availability impact.
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. Prior to 4.5.7 and 5.8.2, depending on the release line, Smarty's {fetch} handling in libs/plugins/function.fetch.php and src/FunctionHandler/Fetch.php used Security::isTrustedUri() to validate only the initial remote URL against trusted_uri when a security policy was active. For resources handled by file_get_contents(), including HTTPS URLs, PHP followed HTTP redirects by default. An attacker who could supply or influence a fetch target and had an open redirect on a trusted host could redirect the request to an attacker-chosen internal endpoint, bypass the trusted_uri allowlist, and perform server-side request forgery. This issue is fixed in versions 4.5.7 and 5.8.2.
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
Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.
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 PHP template engine versions 5.0.0 through 5.8.3 expose a security policy bypass allowing file disclosure via the
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
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-68814
GHSA-cq55-c7wv-pxmq
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB