chore(deps): update dependency starlette to v1.3.1 [security] #32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/pypi-starlette-vulnerability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.1.0→1.3.1Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname
CVE-2026-54282 / GHSA-jp82-jpqv-5vv3
More information
Details
Summary
In affected versions, the HTTP request path is not validated before being used to reconstruct
request.url. Becauserequest.urlis rebuilt by concatenating{scheme}://{host}{path}and re-parsing the result, a path that does not begin with/(for example@google.com) moves the authority boundary during re-parsing, sorequest.url.hostnameandrequest.url.netlocbecome attacker-controlled. Code that readsrequest.url.hostname(rather than theHostheader orscope) can therefore be misled into trusting an attacker-supplied host.Details
When a client requests a path that does not start with
/:affected versions reconstruct the URL as
http://localhost@google.com. Per RFC 3986 §3.2.1, the substring before@in the authority isuserinfo, so re-parsing yieldsusername = "localhost"andhostname = "google.com", with an empty path:The root cause is that the path is concatenated directly after the host without a separating
/, and without validating that it begins with one. Only theHostheader was validated when constructingrequest.url; the path was not.This requires an ASGI server that forwards a request-target lacking a leading
/intoscope["path"].Impact
Any application running an affected version that uses
request.url,request.url.netloc, orrequest.url.hostnamefor a security-sensitive decision (host-based authorization, redirect/callback base, SSRF target, cache key, audit log) may be affected, when no fronting proxy or load balancer rejects the malformed request-target first.Note that this is less exploitable than GHSA-86qp-5c8j-p5mr: there, the poison is carried in the
Hostheader, so the real path still routes to a valid endpoint whilerequest.url.pathlies. Here, the poison must be carried in the path itself, and that path (@google.com) does not match any registered route, so routing returns404and no endpoint handler runs. The exposure is limited to code that readsrequest.urlbefore routing - notably middleware - or in 404/exception handlers.Mitigation
Upgrade to a patched version, which prevents the request path from crossing into the URL authority. The request above instead yields
http://localhost/@​google.comwithrequest.url.hostname == "localhost".Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Starlette: request.form() limits silently ignored for application/x-www-form-urlencoded enable DoS
CVE-2026-54283 / GHSA-82w8-qh3p-5jfq
More information
Details
Summary
request.form()acceptsmax_fieldsandmax_part_sizeto bound resource consumption while parsing form data. These limits are enforced formultipart/form-data, but silently ignored forapplication/x-www-form-urlencoded. An unauthenticated attacker can therefore send a urlencoded body with an arbitrarily large number of fields or an arbitrarily large field, even when the application configured limits it believed would apply.Details
request.form()dispatches to a different parser depending on theContent-Type. Formultipart/form-datathemax_files,max_fields, andmax_part_sizelimits are forwarded to the parser, but forapplication/x-www-form-urlencodedthe parser is constructed without them. It has nomax_fieldsormax_part_sizeparameter to receive them, and it appends every field with no count check and accumulates each field's name and value with no size check. The configured limits are therefore both unreachable and unenforced for url-encoded bodies.Because the url-encoded parser does its work synchronously between stream reads, the two attack shapes have different effects:
f0=v&f1=v&...) blocks the worker's event loop for several seconds while parsing, during which the worker serves no other request.FormData, forcing memory allocation proportional to the request body.The equivalent
multipart/form-datarequest is correctly rejected with400 Too many fields/400 Field exceeded maximum size.Impact
This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) that call
request.form()onapplication/x-www-form-urlencodedrequests. A single request with a very large number of fields blocks the event loop for several seconds, and a single request with a very large field forces unbounded memory allocation; in either case, parallel requests can render the service unusable. A reverse proxy that enforces a request body size limit reduces but does not eliminate the exposure, since a sub-10MB body is already enough to block the event loop.Mitigation
Upgrade to a patched version, which forwards
max_fieldsandmax_part_sizeto the url-encoded parser and enforces them while parsing, raising before the oversized field or excess fields are accumulated. The defaults matchmultipart/form-data(max_fields=1000,max_part_size=1MB) and can be customized viarequest.form(max_fields=..., max_part_size=...).Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
Kludex/starlette (starlette)
v1.3.1: Version 1.3.1Compare Source
What's Changed
StarletteDeprecationWarninginstead ofDeprecationWarningby @Kludex in #3119max_fieldsandmax_part_sizeinFormParserby @Kludex in #3329FormParserlimits in parser callbacks by @Kludex in #3331Full Changelog: https://github.com/Kludex/starlette/compare/1.3.0...1.3.1
v1.3.0: Version 1.3.0Compare Source
What's Changed
FileResponseby @jiyujie2006 in #3307OSErroralongsideMultiPartExceptionwhen closing temp files by @N3XT3R1337 in #3191httpx2to thefullextra by @Kludex in #3323removeprefixto strip weak ETag indicator inis_not_modifiedby @gnosyslambda in #3193request.urlfrom structured components by @Kludex in #3326New Contributors
Full Changelog: https://github.com/Kludex/starlette/compare/1.2.1...1.3.0
v1.2.1: Version 1.2.1Compare Source
What's Changed
httpx2for type checking in thetestclientmodule by @leifwar in #3304New Contributors
Full Changelog: https://github.com/Kludex/starlette/compare/1.2.0...1.2.1
v1.2.0: Version 1.2.0Compare Source
What's Changed
Full Changelog: https://github.com/Kludex/starlette/compare/1.1.0...1.2.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
9102f3e669to4395b353204395b35320to0b46c8edbf