HighGHSA-wqp7-x3pw-xc5rCVE-2026-48818PYSEC-2026-2281

Starlette: SSRF and NTLM credential theft via UNC paths in StaticFiles on Windows

Published 15 Jun 2026 · Updated 10 Sept 2026

Is your project on an affected starlette?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<1.1.0
Fixed in
1.1.0
Update to the fixed version for your release line, for example:pip install 'starlette>=1.1.0'

Details

Summary

When serving static files on Windows, StaticFiles resolves the requested path with `os.path.realpath`. If a UNC path (such as \\attacker.com\share) reaches the resolver, realpath causes the process to open a connection to the remote host over SMB (port 445). This is a server-side request forgery (SSRF) that leaks the service account's NTLMv2 credentials to the attacker-controlled host, which can then be cracked offline or relayed to other hosts.

Details

StaticFiles.lookup_path() joins the requested path onto the served directory and calls `os.path.realpath` on the result before checking containment with `os.path.commonpath`. On Windows, a UNC path is absolute, so `os.path.join` discards the served directory and realpath resolves the bare UNC path, triggering the outbound SMB connection and NTLM authentication before the containment check rejects the path. The HTTP response is a benign 404, but the credential disclosure has already happened. POSIX systems are not affected.

This only affects the default configuration (follow_symlink=False), which uses `os.path.realpath`. The follow_symlink=True branch uses `os.path.abspath`, which performs no I/O.

Impact

Applications running on Windows that serve files with StaticFiles (directly, or via a framework built on Starlette such as FastAPI) in the default configuration are affected. StaticFiles is typically unauthenticated, so any client can trigger the SMB connection and leak the service account's NTLMv2 hash. A secondary impact is discovering internal hosts reachable over SMB by timing responses for valid versus invalid addresses.

Mitigation

Applications not running on Windows are not affected. On Windows, serving static files through a dedicated web server (such as nginx or IIS) instead of StaticFiles avoids the issue. Blocking outbound SMB (port 445) from the application host prevents the credential disclosure even if a UNC path is resolved.

Is GHSA-wqp7-x3pw-xc5r in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected starlette, and gives you the command that fixes it.

More advisories for starlette

  • HighCVE-2026-54283Starlette: request.form() limits silently ignored for application/x-www-form-urlencoded enable DoS · 15 Jun 2026
  • LowCVE-2026-54282Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname · 15 Jun 2026
  • MediumCVE-2026-48817Starlette: Arbitrary HTTP method dispatched to `HTTPEndpoint` attributes via `getattr` · 15 Jun 2026
  • MediumCVE-2026-48710Starlette has missing Host header validation that poisons request.url.path, bypassing path-based security checks · 4 Jun 2026
  • HighCVE-2025-62727Starlette vulnerable to O(n^2) DoS via Range header merging in ``starlette.responses.FileResponse`` · 28 Oct 2025
  • MediumCVE-2025-54121Starlette has possible denial-of-service vector when parsing large files in multipart forms · 21 Jul 2025
All 10 advisories for starlette

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.