chore(deps): update dependency starlette to v0.47.2 [security] #1787
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
Mend has cancelled the proposed renaming of the Renovate GitHub app being renamed to
mend[bot].This notice will be removed on 2025-10-07.
This PR contains the following updates:
==0.40.0->==0.47.2GitHub Vulnerability Alerts
CVE-2025-54121
Summary
When parsing a multi-part form with large files (greater than the default max spool size)
starlettewill block the main thread to roll the file over to disk. This blocks the event thread which means we can't accept new connections.Details
Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from here) has a minor bug. Instead of just checking for
self._in_memorywe should also check if the additional bytes will cause a rollover.I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962
PoC
See the discussion here for steps on how to reproduce.
Impact
To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down
starlettethat much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact.Starlette has possible denial-of-service vector when parsing large files in multipart forms
CVE-2025-54121 / GHSA-2c2j-9gv5-cj73
More information
Details
Summary
When parsing a multi-part form with large files (greater than the default max spool size)
starlettewill block the main thread to roll the file over to disk. This blocks the event thread which means we can't accept new connections.Details
Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from here) has a minor bug. Instead of just checking for
self._in_memorywe should also check if the additional bytes will cause a rollover.I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962
PoC
See the discussion here for steps on how to reproduce.
Impact
To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down
starlettethat much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
Kludex/starlette (starlette)
v0.47.2Compare Source
Fixed
UploadFilecheck for future rollover #2962.New Contributors
Full Changelog: Kludex/starlette@0.47.1...0.47.2
v0.47.1: Version 0.47.1Compare Source
Fixed
SelfinTestClient.__enter__#2951Full Changelog: Kludex/starlette@0.47.0...0.47.1
v0.47.0: Version 0.47.0Compare Source
Added
pathsendextension #2671.partitionedattribute toResponse.set_cookie#2501.Changed
methodsparameter type fromlist[str]toCollection[str]#2903.import typingbyfrom typing import ...in the whole codebase #2867.Fixed
ExceptionMiddleware.http_exceptionas async to prevent thread creation #2922.New Contributors
Full Changelog: Kludex/starlette@0.46.2...0.47.0
v0.46.2: Version 0.46.2Compare Source
What's Changed
TemplateResponseby @alex-oleshkevich in encode#2909BaseHTTPMiddlewareby @ramannanda9 in encode#2911New Contributors
Full Changelog: Kludex/starlette@0.46.1...0.46.2
v0.46.1: Version 0.46.1Compare Source
Fixed
follow_symlinks=True#2896.Full Changelog: Kludex/starlette@0.46.0...0.46.1
v0.46.0: Version 0.46.0Compare Source
Added
GZipMiddleware: Make sureVaryheader is always added if a response can be compressed #2865.Fixed
GZipMiddleware: Don't compress on server sent events #2871.Changed
MultiPartParser: Renamemax_file_sizetospool_max_size#2780.Deprecated
TestClient(timeout=...)#2840.New Contributors
Full Changelog: Kludex/starlette@0.45.3...0.46.0
v0.45.3: Version 0.45.3Compare Source
Fixed
lookup_pathon commonpath comparison by @Kludex in encode#2851Full Changelog: Kludex/starlette@0.45.2...0.45.3
v0.45.2: Version 0.45.2Compare Source
Fixed
create_memory_object_streamcompatible with old anyio versions once again, and bump anyio minimum version to 3.6.2 by @graingert in #2833.Full Changelog: Kludex/starlette@0.45.1...0.45.2
v0.45.1: Version 0.45.1Compare Source
Fixed
MemoryObjectReceiveStreamupon exception inBaseHTTPMiddlewarechildren by @Kludex in encode#2813Refactor
Full Changelog: Kludex/starlette@0.45.0...0.45.1
v0.45.0: Version 0.45.0Compare Source
Removed
ExceptionMiddlewareimport proxy fromstarlette.exceptionsmodule by @Kludex in encode#2826WS_1004_NO_STATUS_RCVDandWS_1005_ABNORMAL_CLOSUREby @Kludex in encode#2827Full Changelog: Kludex/starlette@0.44.0...0.45.0
v0.44.0: Version 0.44.0Compare Source
Added
max_part_sizeparameter toRequest.form()by @iudeen in encode#2815clientparameter toTestClientby @iudeen in encode#2810New Contributors
Full Changelog: Kludex/starlette@0.43.0...0.44.0
v0.43.0: Version 0.43.0Compare Source
Removed
allow_redirectsargument fromTestClient#2808.Added
New Contributors
Full Changelog: Kludex/starlette@0.42.0...0.43.0
v0.42.0: Version 0.42.0Compare Source
Added
ClientDisconnectonStreamingResponse#2732.Fixed
StaticFileswhenfollow_symlinks=True#2711.python-multipartversion to0.0.180ba8395.httpxversion to0.27.0#2773.New Contributors
Full Changelog: Kludex/starlette@0.41.3...0.42.0
v0.41.3: Version 0.41.3Compare Source
Fixed
scope[raw_path]on theTestClient#2716.dictbyMappingonHTTPException.headers#2749.Full Changelog: Kludex/starlette@0.41.2...0.41.3
v0.41.2: Version 0.41.2Compare Source
What's Changed
python-multipartby @Kludex in encode#2737Full Changelog: Kludex/starlette@0.41.1...0.41.2
v0.41.1: Version 0.41.1Compare Source
What's Changed
python-multipartimport topython_multipartby @Kludex in encode#2733python-multipartversion to 0.0.13 by @Kludex in encode#2734Full Changelog: Kludex/starlette@0.41.0...0.41.1
v0.41.0: Version 0.41.0Compare Source
Added
HTTPExceptionbeforewebsocket.accept()encode#2725Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.