Repository navigation
updater: cap the release archive size before extraction - #2809
Merged
Merged
Conversation
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)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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.
4 of 5 tasks
davidtai
approved these changes
Dec 1, 2026
davidtai
left a comment
Collaborator
There was a problem hiding this comment.
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:
- 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 atUpdateArchiveLimit.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. - Low: the tests cover
UpdateArchiveLimitbut notdownloadAndVerify. Use the existingURLProtocolstub (as inSelfUpdaterReleaseCheckTests.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 was referenced Dec 2, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
UpdateArchiveLimitTests.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-botwith what you need.