Skip to content

fix: bound fallback response read in preset download (import of github/spec-kit#3777) - #108

Open
one-kash wants to merge 3 commits into
mainfrom
import/pr-3777
Open

fix: bound fallback response read in preset download (import of github/spec-kit#3777)#108
one-kash wants to merge 3 commits into
mainfrom
import/pr-3777

Conversation

@one-kash

Copy link
Copy Markdown

Imported from upstream PR github#3777
Original author: @Quratulain-bilal
Original head branch: fix/unbounded-preset-download-fallback


Summary

Replace unbounded
esponse.read()\ fallback in \presets/_commands.py\ with
ead_response_limited()\ to prevent DoS via oversized preset archive downloads.

Changes

  • Added \MAX_DOWNLOAD_BYTES\ and
    ead_response_limited\ to the existing _download_security\ import
  • Replaced \output.write(response.read())\ with \output.write(read_response_limited(response, max_bytes=MAX_DOWNLOAD_BYTES))\ in the \TypeError\ fallback path at line 172

Replace unbounded response.read() fallback in presets/_commands.py
with read_response_limited() to prevent DoS via oversized preset
archive downloads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants