Use of Incorrectly-Resolved Name or Referencestarlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Use of Incorrectly-Resolved Name or Reference in the reconstruction of request.url when the HTTP request path does not begin with /. An attacker can mislead the application into trusting an attacker-controlled hostname by sending a specially crafted request path that manipulates the authority component of the URL.
Note: This is only exploitable if the ASGI server forwards a request-target lacking a leading / into scope["path"], and the application uses request.url, request.url.netloc, or request.url.hostname for security-sensitive decisions before routing or in 404/exception handlers.
How to fix Use of Incorrectly-Resolved Name or Reference? Upgrade starlette to version 1.3.0 or higher.
| |
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')starlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') when dispatching HTTP requests to endpoint attributes via getattr. An attacker can invoke internal methods not intended as HTTP handlers by sending requests with non-standard HTTP methods whose names match internal attribute names, potentially bypassing authorization checks.
Note: This is only exploitable if an HTTPEndpoint subclass is registered through Route(...) without specifying the methods= argument and the subclass defines additional methods matching non-standard HTTP-method token shapes that accept a single request argument and return a response.
How to fix Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')? Upgrade starlette to version 1.1.0 or higher.
| |
Server-side Request Forgery (SSRF)starlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) in the StaticFiles file on Windows systems when handling UNC paths. An attacker can obtain NTLMv2 credentials of the service account by sending a specially crafted request that causes the server to initiate an outbound SMB connection to an attacker-controlled host, resulting in credential disclosure.
Note: This is only exploitable if the application is running on Windows and serving static files using the default configuration (follow_symlink=False).
How to fix Server-side Request Forgery (SSRF)? Upgrade starlette to version 1.1.0 or higher.
| |
HTTP Request Smugglingstarlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to HTTP Request Smuggling via the request.url reconstruction process. An attacker can bypass path-based security checks by supplying a malformed Host header that causes request.url.path to differ from the actual requested path.
Note:
This is only exploitable if the application relies on request.url (or request.url.path) for security-sensitive decisions. The most common case is middleware that gates access to certain path prefixes based on request.url.path. Deployments fronted by a proxy or load balancer are mitigated only if that proxy rejects or normalizes the malformed Host header before forwarding and the application does not trust attacker-controlled host headers (e.g. X-Forwarded-Host) elsewhere.
How to fix HTTP Request Smuggling? Upgrade starlette to version 1.0.1 or higher.
| |
Regular Expression Denial of Service (ReDoS)starlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the FileResponse._parse_range_header method. An attacker can exhaust server CPU resources by sending a specially crafted HTTP Range header containing numerous small, non-overlapping ranges, which triggers quadratic-time processing during range parsing and merging.
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade starlette to version 0.49.1 or higher.
| |
Allocation of Resources Without Limits or Throttlingstarlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the UploadFile.write method when handling multipart forms containing files larger than the default spool_max_size. An attacker can cause the application to block the main event thread by submitting a multipart form with a large file, preventing the application from accepting new connections.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade starlette to version 0.47.2 or higher.
| |
Allocation of Resources Without Limits or Throttlingstarlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via multipart/form-data requests, due to treating parts without a filename as text form fields and buffering those in byte strings with no size limit.
An attacker could cause Starlette to both slow down significantly due to excessive memory allocations and copy operations, and also consume more and more memory until the server starts swapping and grinds to a halt by uploading arbitrary large form fields.
Note:
This vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade starlette to version 0.40.0 or higher.
| |
Denial of Service (DoS)starlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Denial of Service (DoS) via the MultipartParser class, which accepts an unlimited number of fields and files when parsing multipart/form-data.
Exploiting this vulnerability is possible by sending too many small form fields with no content or too many empty files, which results in high CPU usage and high memory usage.
Note:
An affected application has to have all the following:
python-multipart installed.
calls request.form().
How to fix Denial of Service (DoS)? Upgrade starlette to version 0.25.0 or higher.
| |
Directory Traversalstarlette is a The little ASGI library that shines.
Affected versions of this package are vulnerable to Directory Traversal. Any file on the host machine can be read by passing an absolute path, formatted in a URL such as http://localhost:5000/staticmount/c%3a%5cwindows%5cwin.ini.
How to fix Directory Traversal? Upgrade starlette to version 0.13.5 or higher.
| |