{"id":"CVE-2026-62993","aliases":["CVE-2026-62993","GHSA-cq55-c7wv-pxmq"],"related":[],"kind":"vulnerability","state":"published","title":"Smarty: SSRF via redirect bypass of trusted_uri using {fetch}","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2026-08-31T20:58:03.616Z","modified":"2026-09-08T21:11:31.703Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":">= 5.0.0, < 5.8.2","status":"affected"},{"version":"< 4.5.7","status":"affected"}],"vendor":"smarty-php","product":"smarty","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.8.2"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.7"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"}],"references":[{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-cq55-c7wv-pxmq","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/pull/1194","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/commit/31e06fc087a8b5a9b236c1e5dacc1c2850a2c115","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/commit/a1ccdb0518021a559b4066c37b76a42c86bbce90","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.5.7","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v5.8.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62993","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/smarty-php/smarty","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-09-02T17:36:17.333Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-62993","url":"https://www.cve.org/CVERecord?id=CVE-2026-62993","licence":"CVE Terms of Use","modified":"2026-09-02T17:36:30.257Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cq55-c7wv-pxmq","url":"https://github.com/advisories/GHSA-cq55-c7wv-pxmq","licence":"CC-BY-4.0","modified":"2026-09-01T16:45:03.888Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-62993","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62993","licence":"Public domain","modified":"2026-09-08T21:11:31.703Z"}],"updatedAt":"2026-11-25T22:59:35.874Z","epss":{"score":0.00421,"percentile":0.3837,"date":"2026-12-01T12:00:22.000Z"}}