Repository navigation
Validate single-file contract on github-release updates (#74) - #80
Merged
Merged
Conversation
The github-release update channel swapped in a downloaded release asset without verifying it was a single self-contained file, unlike the source and NuGet install paths. A release could ship a multi-file or framework-dependent payload and bypass the single-file contract. Extract the asset into a dedicated subdirectory (so the archive itself isn't counted) and validate it via the shared IsSingleFile check before replacing the installed binary. Adds ValidateReleasePayload helper and ReleasePayloadValidationTests. Co-authored-by: Copilot <[email protected]> Copilot-Session: 93b4a21a-2d53-4208-9078-2643c540666a
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.
Fixes #74.
Problem
UpdateGitHubReleaseAsyncdownloaded a release asset, extracted it, and copied the binary over the installed one without verifying the payload is a single self-contained file — unlike the source-build and NuGet install paths, which enforce the single-file/self-contained contract. A release could ship a multi-file or framework-dependent payload and silently bypass the "no .NET required" contract.Fix
extract/) so the downloaded archive file itself isn't mistaken for payload.Installer.IsSingleFilecheck (the same one the install path uses) before replacing the installed binary. Multi-file / framework-dependent payloads are rejected withrelease asset is not a single-file executable; refusing to update.ValidateReleasePayloadhelper returningOk/NotSingleFile/BinaryNotFound.The NuGet update path already routes through
Installer.InstallPackageAsync(full validation), so this closes the last channel that skipped it.Tests
Adds
ReleasePayloadValidationTests(5 cases): single binary OK, extra dependency rejected, nested payload rejected, debug symbols ignored, name mismatch → not found. Full suite: 82 passed.