Skip to content

Conversation

renovate-bot
Copy link
Contributor

@renovate-bot renovate-bot commented Jul 21, 2025

This PR contains the following updates:

Package Change Age Confidence
starlette (changelog) ==0.41.2 -> ==0.47.2 age confidence

GitHub Vulnerability Alerts

CVE-2025-54121

Summary

When parsing a multi-part form with large files (greater than the default max spool size) starlette will 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_memory we should also check if the additional bytes will cause a rollover.

    @​property
    def _in_memory(self) -> bool:
        # check for SpooledTemporaryFile._rolled
        rolled_to_disk = getattr(self.file, "_rolled", True)
        return not rolled_to_disk

    async def write(self, data: bytes) -> None:
        if self.size is not None:
            self.size += len(data)

        if self._in_memory:
            self.file.write(data)
        else:
            await run_in_threadpool(self.file.write, data)

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 starlette that much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact.


Release Notes

encode/starlette (starlette)

v0.47.2

Compare Source

Fixed

  • Make UploadFile check for future rollover #​2962.

New Contributors

Full Changelog: Kludex/starlette@0.47.1...0.47.2

v0.47.1: Version 0.47.1

Compare Source

Fixed

  • Use Self in TestClient.__enter__ #​2951
  • Allow async exception handlers to type-check #​2949

Full Changelog: Kludex/starlette@0.47.0...0.47.1

v0.47.0: Version 0.47.0

Compare Source

Added

  • Add support for ASGI pathsend extension #​2671.
  • Add partitioned attribute to Response.set_cookie #​2501.

Changed

  • Change methods parameter type from list[str] to Collection[str] #​2903.
  • Replace import typing by from typing import ... in the whole codebase #​2867.

Fixed

  • Mark ExceptionMiddleware.http_exception as async to prevent thread creation #​2922.

New Contributors

Full Changelog: Kludex/starlette@0.46.2...0.47.0

v0.46.2: Version 0.46.2

Compare Source

What's Changed

New Contributors

Full Changelog: Kludex/starlette@0.46.1...0.46.2

v0.46.1: Version 0.46.1

Compare Source

Fixed

  • Allow relative directory path when follow_symlinks=True #​2896.

Full Changelog: Kludex/starlette@0.46.0...0.46.1

v0.46.0: Version 0.46.0

Compare Source

Added

  • GZipMiddleware: Make sure Vary header is always added if a response can be compressed #​2865.

Fixed

  • Raise exception from background task on BaseHTTPMiddleware #​2812.
  • GZipMiddleware: Don't compress on server sent events #​2871.

Changed

  • MultiPartParser: Rename max_file_size to spool_max_size #​2780.

Deprecated

  • Add deprecated warning to TestClient(timeout=...) #​2840.

New Contributors

Full Changelog: Kludex/starlette@0.45.3...0.46.0

v0.45.3: Version 0.45.3

Compare Source

Fixed

Full Changelog: Kludex/starlette@0.45.2...0.45.3

v0.45.2: Version 0.45.2

Compare Source

Fixed
  • Make create_memory_object_stream compatible 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.1

Compare Source

Fixed
Refactor

Full Changelog: Kludex/starlette@0.45.0...0.45.1

v0.45.0: Version 0.45.0

Compare Source

Removed


Full Changelog: Kludex/starlette@0.44.0...0.45.0

v0.44.0: Version 0.44.0

Compare Source

Added
New Contributors

Full Changelog: Kludex/starlette@0.43.0...0.44.0

v0.43.0: Version 0.43.0

Compare Source

Removed

  • Remove deprecated allow_redirects argument from TestClient #​2808.

Added

  • Make UUID path parameter conversion more flexible #​2806.

New Contributors

Full Changelog: Kludex/starlette@0.42.0...0.43.0

v0.42.0: Version 0.42.0

Compare Source

Added
  • Raise ClientDisconnect on StreamingResponse #​2732.
Fixed
  • Use ETag from headers when parsing If-Range in FileResponse #​2761.
  • Follow directory symlinks in StaticFiles when follow_symlinks=True #​2711.
  • Bump minimum python-multipart version to 0.0.18 0ba8395.
  • Bump minimum httpx version to 0.27.0 #​2773.

New Contributors

Full Changelog: Kludex/starlette@0.41.3...0.42.0

v0.41.3: Version 0.41.3

Compare Source

Fixed
  • Exclude the query parameters from the scope[raw_path] on the TestClient #​2716.
  • Replace dict by Mapping on HTTPException.headers #​2749.
  • Correct middleware argument passing and improve factory pattern #​2752.

Full Changelog: Kludex/starlette@0.41.2...0.41.3


Configuration

📅 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@dpebot
Copy link
Collaborator

dpebot commented Jul 21, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 2bff933 to 0e28230 Compare July 22, 2025 00:39
@dpebot
Copy link
Collaborator

dpebot commented Jul 22, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 0e28230 to 521d1f2 Compare July 23, 2025 16:28
@dpebot
Copy link
Collaborator

dpebot commented Jul 23, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 521d1f2 to efd765f Compare August 5, 2025 18:32
@dpebot
Copy link
Collaborator

dpebot commented Aug 5, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from efd765f to 31bbacd Compare August 21, 2025 14:05
@dpebot
Copy link
Collaborator

dpebot commented Aug 21, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 31bbacd to f8b265e Compare August 22, 2025 17:22
@dpebot
Copy link
Collaborator

dpebot commented Aug 22, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from f8b265e to 0f8de45 Compare August 22, 2025 17:35
@dpebot
Copy link
Collaborator

dpebot commented Aug 22, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 0f8de45 to 84459f0 Compare August 25, 2025 16:53
@dpebot
Copy link
Collaborator

dpebot commented Aug 25, 2025

/gcbrun

1 similar comment
@amandakarina
Copy link
Collaborator

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 84459f0 to 3d10344 Compare August 27, 2025 17:25
@dpebot
Copy link
Collaborator

dpebot commented Aug 27, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 3d10344 to c31852b Compare August 28, 2025 14:52
@dpebot
Copy link
Collaborator

dpebot commented Aug 28, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from c31852b to 4c364d9 Compare September 1, 2025 22:23
@dpebot
Copy link
Collaborator

dpebot commented Sep 1, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 4c364d9 to c2221a4 Compare September 3, 2025 20:35
@dpebot
Copy link
Collaborator

dpebot commented Sep 3, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from c2221a4 to 4c4024a Compare September 5, 2025 20:51
@dpebot
Copy link
Collaborator

dpebot commented Sep 5, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 4c4024a to f1f02be Compare September 9, 2025 19:11
@dpebot
Copy link
Collaborator

dpebot commented Sep 9, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from f1f02be to d068e8a Compare September 13, 2025 15:16
@dpebot
Copy link
Collaborator

dpebot commented Sep 13, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from d068e8a to 5d0998c Compare September 15, 2025 17:56
@dpebot
Copy link
Collaborator

dpebot commented Sep 15, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 5d0998c to 7b20fe0 Compare September 15, 2025 18:36
@dpebot
Copy link
Collaborator

dpebot commented Sep 15, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 7b20fe0 to a85d68c Compare September 19, 2025 17:34
@dpebot
Copy link
Collaborator

dpebot commented Sep 19, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from a85d68c to 47820f5 Compare September 23, 2025 21:56
@dpebot
Copy link
Collaborator

dpebot commented Sep 23, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 47820f5 to 506d6e8 Compare September 25, 2025 18:19
@dpebot
Copy link
Collaborator

dpebot commented Sep 25, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 506d6e8 to c6145de Compare September 26, 2025 17:09
@dpebot
Copy link
Collaborator

dpebot commented Sep 26, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from c6145de to b6304de Compare October 1, 2025 22:55
@dpebot
Copy link
Collaborator

dpebot commented Oct 1, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from b6304de to 4865d1e Compare October 8, 2025 00:54
@dpebot
Copy link
Collaborator

dpebot commented Oct 8, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 4865d1e to 95e0a2e Compare October 10, 2025 02:08
@dpebot
Copy link
Collaborator

dpebot commented Oct 10, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from 95e0a2e to b18296b Compare October 10, 2025 18:09
@dpebot
Copy link
Collaborator

dpebot commented Oct 10, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from b18296b to ed7d706 Compare October 15, 2025 01:12
@dpebot
Copy link
Collaborator

dpebot commented Oct 15, 2025

/gcbrun

@renovate-bot renovate-bot force-pushed the renovate/pypi-starlette-vulnerability branch from ed7d706 to 87e5053 Compare October 15, 2025 17:12
@dpebot
Copy link
Collaborator

dpebot commented Oct 15, 2025

/gcbrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants