Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-48818

CVE-2026-48818: Starlette ASGI Framework SSRF Vulnerability

CVE-2026-48818 is a server-side request forgery flaw in Starlette's StaticFiles on Windows that exposes NTLMv2 credentials via UNC paths. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-48818 Overview

CVE-2026-48818 is a Server-Side Request Forgery (SSRF) vulnerability in Starlette, a lightweight Asynchronous Server Gateway Interface (ASGI) framework. Versions 1.0.1 and earlier expose the StaticFiles component on Windows to attacker-controlled Universal Naming Convention (UNC) paths. A request containing a path such as \\attacker.com\share causes os.path.realpath to initiate an outbound Server Message Block (SMB) connection before the path is rejected. The outbound connection leaks the service account's NTLMv2 credentials for offline cracking or relay attacks, even though the HTTP response returns a 404. The flaw affects default follow_symlink=False deployments and downstream frameworks built on Starlette, including FastAPI. The issue is fixed in Starlette version 1.1.0.

Critical Impact

Remote unauthenticated attackers can coerce Windows-hosted Starlette and FastAPI services into leaking NTLMv2 credentials via outbound SMB authentication to attacker-controlled hosts.

Affected Products

  • Starlette versions 1.0.1 and earlier running on Windows
  • FastAPI and other ASGI frameworks built on vulnerable Starlette versions
  • Deployments using StaticFiles with the default follow_symlink=False setting

Discovery Timeline

  • 2026-06-17 - CVE-2026-48818 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2026-48818

Vulnerability Analysis

The vulnerability resides in Starlette's StaticFiles endpoint handling on Windows hosts. When a client requests a path that resolves to a UNC path, Starlette passes the value to os.path.realpath for canonicalization before validating that the resulting path remains inside the configured static directory. On Windows, os.path.realpath resolves UNC targets by contacting the remote host over SMB. That outbound SMB handshake includes NTLM authentication using the service account credentials of the process hosting Starlette. The classification under [CWE-918] (Server-Side Request Forgery) reflects the attacker's ability to coerce the server into making an outbound network request to an arbitrary host.

Root Cause

The root cause is unsafe path canonicalization order. StaticFiles calls os.path.realpath on attacker-influenced input before rejecting UNC prefixes such as \\ or //. Because the operating system resolves UNC paths during canonicalization, the outbound SMB connection occurs as a side effect of resolution. By the time Starlette returns a 404 to the HTTP client, the SMB authentication exchange has already completed and the NTLMv2 challenge response has been transmitted.

Attack Vector

An unauthenticated remote attacker sends a crafted HTTP request to a static file route hosted by a Windows-based Starlette or FastAPI deployment. The request URL encodes a UNC path pointing to an attacker-controlled SMB server. The target server resolves the path, connects to the attacker's SMB listener, and submits the service account's NTLMv2 hash. The attacker captures the hash using tooling such as Responder or impacket-smbserver and either cracks it offline or relays it to internal services. POSIX systems are not vulnerable because they do not interpret UNC syntax, and configurations using follow_symlink=True are unaffected.

No public proof-of-concept code is referenced in the advisory. See the GitHub Security Advisory GHSA-wqp7-x3pw-xc5r for technical details.

Detection Methods for CVE-2026-48818

Indicators of Compromise

  • Outbound SMB connections (TCP/445 or TCP/139) originating from Python web server processes such as uvicorn.exe, gunicorn, or python.exe
  • HTTP access logs on Windows hosts containing request paths beginning with \\, //, or URL-encoded variants such as %5C%5C directed at StaticFiles routes
  • DNS lookups for external hostnames generated by the application service account immediately preceding 404 responses

Detection Strategies

  • Inspect Starlette and FastAPI access logs for request paths containing UNC indicators followed by 404 status codes
  • Correlate web server process IDs with outbound SMB or NetBIOS traffic using endpoint telemetry
  • Hunt for NTLM authentication events (Windows Event ID 4624 Logon Type 3) originating from web service accounts to unexpected destinations

Monitoring Recommendations

  • Alert on any outbound TCP/445 traffic from servers hosting Python ASGI applications
  • Monitor Windows Security and Sysmon logs for NetworkConnect events from Python interpreters to non-domain hosts
  • Track the installed Starlette version across the Windows fleet and flag instances at or below 1.0.1

How to Mitigate CVE-2026-48818

Immediate Actions Required

  • Upgrade Starlette to version 1.1.0 or later on every Windows host running ASGI applications
  • Upgrade FastAPI and other downstream frameworks to releases that pin Starlette 1.1.0 or higher
  • Block outbound SMB (TCP/445 and TCP/139) at the host and perimeter firewall for application servers that do not require it
  • Rotate NTLM credentials for any service account that ran a vulnerable Starlette instance exposed to untrusted networks

Patch Information

The fix is committed in Starlette and released in version 1.1.0. The patch rejects UNC-style paths before invoking os.path.realpath. Refer to the GitHub commit, the pull request #3287, and the 1.1.0 release notes for details.

Workarounds

  • Host Starlette and FastAPI applications on Linux or other POSIX systems, which are not affected by the UNC resolution behavior
  • Place a reverse proxy in front of the application that strips or rejects request paths containing backslashes or leading double slashes
  • Apply Group Policy settings such as Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers to deny outbound NTLM authentication from application servers
bash
# Configuration example
pip install --upgrade 'starlette>=1.1.0'
# For FastAPI deployments, verify the resolved Starlette version
pip show starlette | findstr Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.