Skip to content

updater: cap the release archive size before extraction - #2809

Merged
jonathan308 merged 2 commits into
devfrom
fix/update-archive-cap-dev
Dec 2, 2026
Merged

jonathan308 merged 2 commits into
devfrom
fix/update-archive-cap-dev

Conversation

@jonathan308

@jonathan308 jonathan308 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator
  • A release archive larger than 4 GiB is deleted and refused before it is hashed or extracted.
  • Tests: UpdateArchiveLimitTests.
  • Cherry-picked from f5421cf.

Part of landing the 0.10.20 release content on dev before the release is cut, as the release review on #2800 asked.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Refuse a downloaded release archive larger than 4 GiB before it is
hashed or extracted. Release archives are about 450 MB, so the cap
never stops a real release.

(cherry picked from commit f5421cf)
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Dec 1, 2026
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Dec 1, 2026 10:24pm UTC
darkbloom-status Ready Ready Preview Dec 1, 2026 10:24pm UTC
eigen-homepages-darkbloom Ready Ready Preview Dec 1, 2026 10:24pm UTC

Request Review

@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Dec 1, 2026
…ed length first

The archive-size cap now fails closed when the downloaded file's size can't be read. An archive whose server declares a Content-Length above the cap is refused: in the answer to a HEAD request before the download, and in the download's own response before the hash. Tests: UpdateArchiveLimitTests.

@davidtai davidtai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved by David. The fail-open on an unreadable size is fixed: UpdateArchiveLimit.fits returns false (UpdateArchiveLimit.swift:24), and a test covers it. The HEAD check refuses an archive whose declared size is over the cap (SelfUpdater.swift:536-546).

Requests:

  1. Medium, optional: the download itself (SelfUpdater.swift:548) is still unbounded when the HEAD fails, declares no length, or declares a false one. The gap is documented at UpdateArchiveLimit.swift:17-19. Either stop the download once it has written more than the cap (for example, a download delegate that cancels), which also removes the HEAD fail-open, or accept the gap as documented.
  2. Low: the tests cover UpdateArchiveLimit but not downloadAndVerify. Use the existing URLProtocol stub (as in SelfUpdaterReleaseCheckTests.swift) to test that a HEAD over the cap is refused before any download, and that a download over the cap is deleted before the hash.

This branch was successfully deployed

3 active deployments
Preview – d-inference-landing — a9f52dba Deployed Dec 1, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — a9f52dba Deployed Dec 1, 2026 by vercel[bot]
Preview – darkbloom-status — a9f52dba Deployed Dec 1, 2026 by vercel[bot]
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