CVE-2026-62993: Smarty SSRF Vulnerability

MODERATE
Advisory Identifier: GHSA-cq55-c7wv-pxmq
CWE-918
Published
Advisory Summary

CVE-2026-62993 is a MODERATE ssrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Smarty libraries in the Packagist ecosystem. The issue involves ssrf via redirect bypass of trusted_uri using {fetch}. Remediation is available by upgrading affected packages to version 5.8.2, 4.5.7.

CVE-2026-62993 at a Glance

CVE Identifier CVE-2026-62993
GHSA Identifier GHSA-cq55-c7wv-pxmq
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Smarty
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-62993

To remediate this vulnerability, upgrade all affected Smarty dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

smarty/smarty fixed: 5.8.2
Upgrade smarty/smarty to 5.8.2
smarty/smarty fixed: 4.5.7
Upgrade smarty/smarty to 4.5.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for smarty/smarty

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-62993, inspect your project dependencies for Smarty:

inspect dependencies for smarty/smarty

Analyze the terminal output to locate any version of Smarty in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.8.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Smarty, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

When a Security policy is active, {fetch} validates the requested remote URL against the trusted_uri allowlist via Security::isTrustedUri(). For non-http:// schemes (e.g. https://) the resource was then read with file_get_contents(), which follows HTTP redirects by default. Because isTrustedUri() only validates the initial URL, an open redirect on an otherwise-trusted host could be used to redirect the request to a non-trusted, internal target — bypassing the trusted_uri policy. ## Impact An attacker who can supply a fetch target (or influence one) and who has an open redirect available on a trusted host can cause the server to issue requests to attacker-chosen internal endpoints, defeating the trusted_uri allowlist (server-side request forgery). ## Patches Fixed in 5.8.2. When a security policy is active, {fetch} now passes a stream context that disables redirect following (follow_location => 0, max_redirects => 1) to file_get_contents() for remote resources. Behavior is unchanged when no security policy is set, since there is no trusted_uri to bypass. ## Workarounds Avoid fetching remote resources from within templates under untrusted control; ensure hosts listed in trusted_uri do not expose open redirects.

CVE-2026-62993 Affected Smarty Versions

2 component(s)
Fixed Versions:
5.8.24.5.7
Product / Package Ecosystem Affected Versions Fixed Version
smarty/smarty
Packagist
≥ 5.0.0
< 5.8.2
5.8.2
smarty/smarty
Packagist
< 4.5.7
4.5.7

References

Frequently Asked Questions

What is CVE-2026-62993?
CVE-2026-62993 is a security vulnerability in Smarty involving SSRF via redirect bypass of trusted_uri using {fetch} under CWE-918: Server-Side Request Forgery (SSRF).
Which Smarty versions are affected?
Affected versions include releases prior to 5.8.2, 4.5.7 across affected packages: smarty/smarty.
What version fixes CVE-2026-62993?
Upgrading to 5.8.2, 4.5.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is smarty/smarty affected?
Yes, smarty/smarty is affected in releases prior to 5.8.2, 4.5.7. Upgrade your dependency to 5.8.2, 4.5.7 or later.
What CWE is associated with CVE-2026-62993?
CVE-2026-62993 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Packagist dependencies for CVE-2026-62993?
Run the dependency tree command: 'inspect dependencies for smarty/smarty'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cq55-c7wv-pxmq",
  "modified" : "2026-09-01T16:38:23Z",
  "published" : "2026-09-01T16:38:22Z",
  "aliases" : [ "CVE-2026-62993" ],
  "summary" : "Smarty: SSRF via redirect bypass of trusted_uri using {fetch}",
  "details" : "When a Security policy is active, {fetch} validates the requested remote URL against the trusted_uri allowlist via Security::isTrustedUri(). For non-http:// schemes (e.g. https://) the resource was then read with file_get_contents(), which follows HTTP redirects by default. Because isTrustedUri() only validates the initial URL, an open redirect on an otherwise-trusted host could be used to redirect the request to a non-trusted, internal target — bypassing the trusted_uri policy.\n\n## Impact\n\nAn attacker who can supply a fetch target (or influence one) and who has an open redirect available on a trusted host can cause the server to issue requests to attacker-chosen internal endpoints, defeating the trusted_uri allowlist (server-side request forgery).\n\n## Patches\n\nFixed in 5.8.2. When a security policy is active, {fetch} now passes a stream context that disables redirect following (follow_location => 0, max_redirects => 1) to file_get_contents() for remote resources. Behavior is unchanged when no security policy is set, since there is no trusted_uri to bypass.\n\n## Workarounds\n\nAvoid fetching remote resources from within templates under untrusted control; ensure hosts listed in trusted_uri do not expose open redirects.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "smarty/smarty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.8.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "smarty/smarty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/smarty-php/smarty/security/advisories/GHSA-cq55-c7wv-pxmq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-62993"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/smarty-php/smarty/pull/1194"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/smarty-php/smarty/commit/31e06fc087a8b5a9b236c1e5dacc1c2850a2c115"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/smarty-php/smarty/commit/a1ccdb0518021a559b4066c37b76a42c86bbce90"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/smarty-php/smarty"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/smarty-php/smarty/releases/tag/v4.5.7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/smarty-php/smarty/releases/tag/v5.8.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-01T16:38:22Z",
    "nvd_published_at" : "2026-08-31T21:17:33Z"
  }
}