/

CVE-2026-48818

Severity:

HIGH RISK

(7.5)

SSRF via UNC Paths (CWE-918) in Starlette StaticFiles

CVE-2026-48818

Modified

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Credential Exposure and NTLM Relay via SSRF

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A server-side request forgery flaw in Starlette's StaticFiles on Windows allows outbound SMB connections to attacker-controlled UNC paths during path resolution.

If an attacker can make the application resolve a UNC path, the server may leak the service account's NTLMv2 credentials for offline cracking or relay, even though the HTTP response is only a 404.

Affected context

This vulnerability appears in Starlette-based applications (including frameworks like FastAPI) running on Windows where StaticFiles is used with the default follow_symlink=False setting.

It is triggered when user-controlled paths are interpreted as UNC locations (e.g., \\attacker.com\share) and passed through os.path.realpath, which attempts to resolve the network location.

POSIX deployments and configurations explicitly using follow_symlink=True are not impacted in the same way, but Windows default scenarios remain at risk whenever untrusted paths can reach StaticFiles.

Exploit preconditions

  • Attack surface: HTTP endpoints served through Starlette's StaticFiles (or wrappers in dependent frameworks) on Windows.
  • Required access: Ability to send HTTP requests that cause StaticFiles to resolve a filesystem path (including crafted UNC paths).
  • Trigger point: Path normalization via os.path.realpath on a UNC-style input such as \\attacker.com\share.
  • Why exploitation is possible: On Windows, resolving UNC paths implicitly initiates an outbound SMB connection prior to StaticFiles rejecting the path and returning a 404, exposing NTLMv2 credentials despite the failure response.

Why this happens

The underlying issue is that the file-serving component performs path normalization using OS-level filesystem APIs (os.path.realpath) on attacker-controlled input without considering side effects on network paths.

On Windows, UNC paths are treated as network locations, so resolving them can automatically trigger outbound SMB connections as part of the OS path resolution process.

This maps to CWE-918: Server-Side Request Forgery, where internal or external network requests are implicitly made on behalf of the server due to unvalidated, attacker-supplied resource identifiers (in this case, filesystem-like paths interpreted as network resources).

Potential impact

  • Exposure of the service account's NTLMv2 hash for offline cracking.
  • Use of leaked NTLMv2 credentials in relay attacks against other internal services.
  • Lateral movement within a Windows domain environment if the compromised account has elevated privileges.
  • Increased risk of broader compromise when combined with other weaknesses (e.g., weak passwords, lack of SMB signing).

General mitigation guidance

Mitigation efforts should focus on preventing untrusted paths from triggering network-based path resolution and reducing the power of any account that could be exposed.

Consider these general defensive patterns:

  • Avoid calling filesystem APIs that implicitly resolve network locations on untrusted input, especially on Windows.
  • Introduce strict allowlists for StaticFiles roots and reject any paths that resemble UNC or network paths before invoking OS-level path resolution.
  • Run application services under minimally privileged accounts that have limited access to network resources and domain assets.
  • Where possible, disable or tightly control outbound SMB traffic from application hosts using host-based firewalls or network segmentation.
  • Apply defense-in-depth by logging and monitoring unexpected outbound SMB connections from application servers.

How teams detect issues like this

High-level detection and assurance strategies include:

  • Static analysis rules to flag usage of path resolution functions (e.g., os.path.realpath) on untrusted inputs, particularly in file-serving code on Windows.
  • Code reviews focusing on StaticFiles configuration, ensuring that path sanitization, UNC path rejection, and trust boundaries around file paths are clearly documented and enforced.
  • Runtime monitoring for unusual outbound SMB traffic originating from web application hosts, especially connections to untrusted or internet-accessible hosts.
  • Integration of security linters and automated review tools in CI pipelines to identify SSRF-like patterns involving filesystem and network APIs.

Sources

SourceLink
github.comgithub.com/Kludex/starlette/commit/fd53168a7767b6b55ba5af787fd88f49e33cabc5
github.comgithub.com/Kludex/starlette/pull/3287
github.comgithub.com/Kludex/starlette/releases/tag/1.1.0
github.comgithub.com/Kludex/starlette/security/advisories/GHSA-wqp7-x3pw-xc5r
github.comgithub.com/pypa/advisory-database/tree/main/vulns/starlette/PYSEC-2026-2281.yaml
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30087
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30088
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30089
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-48818
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2490020
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-48818.json

Frequently asked

questions

Yes, if an attacker can cause your application to resolve a path via StaticFiles on Windows, they can supply a UNC path that triggers an outbound SMB connection without needing local access.

The attacker needs the ability to send HTTP requests to any endpoint backed by StaticFiles (directly or via a framework like FastAPI) that will attempt to resolve the supplied path.

The safest pattern is to ensure that any file-serving logic rejects UNC-style or network paths before calling OS-level resolution functions, and to avoid using APIs that implicitly resolve network locations on untrusted input.

Treat all user-controlled resource identifiers (paths, URLs, hostnames) as untrusted, enforce strict validation and allowlists before invoking OS or network APIs, and include SSRF-focused checks in both code reviews and automated security tooling—especially for platform-specific behaviors like Windows UNC handling.

Find out what's already
exploitable in your codebase.