Skip to content

fix: bound response read in extension download command - #3776

Closed
Quratulain-bilal wants to merge 3 commits into
github:mainfrom
Quratulain-bilal:fix/unbounded-extension-download
Closed

fix: bound response read in extension download command#3776
Quratulain-bilal wants to merge 3 commits into
github:mainfrom
Quratulain-bilal:fix/unbounded-extension-download

Conversation

@Quratulain-bilal

@Quratulain-bilal Quratulain-bilal commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace unbounded
esponse.read()\ with
ead_response_limited()\ in \extensions/_commands.py\ to prevent DoS via oversized ZIP downloads from user-supplied URLs.

Changes

  • Added \ rom .._download_security import MAX_DOWNLOAD_BYTES, read_response_limited\ import
  • Replaced \zip_data = response.read()\ with \zip_data = read_response_limited(response, max_bytes=MAX_DOWNLOAD_BYTES)\ at line 536

Replace unbounded response.read() with read_response_limited() in
extensions/_commands.py to prevent DoS via oversized ZIP downloads
from user-supplied URLs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bounds ZIP downloads from custom extension URLs to mitigate memory-exhaustion attacks.

Changes:

  • Imports the shared download-size limiter.
  • Caps downloaded ZIP responses at 50 MiB.
Show a summary per file
File Description
src/specify_cli/extensions/_commands.py Applies bounded reads to custom extension downloads.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/specify_cli/extensions/_commands.py Outdated
@mnriem
mnriem requested a review from Copilot July 29, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@mnriem
mnriem requested a review from Copilot August 3, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@mnriem
mnriem requested a balanced review from Copilot August 4, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@mnriem

mnriem commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded by #3141, which merged the same bounded-download protection as part of a broader security hardening change with test coverage. After this branch incorporated current main, PR #3776 had no remaining diff (0 changed files), so Copilot had no files available to review.

Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol).

@mnriem mnriem closed this Aug 4, 2026
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.

3 participants