fix(upgrade): authenticate Swift release downloads#18
Merged
bob-codedaptive merged 1 commit intoJul 14, 2026
Merged
Conversation
Contributor
|
All contributors have signed the CLA. Thank you. |
Member
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Motivation
upgradepath downloaded a tarball and an unauthenticatedchecksums.txt, then trusted that file to verify the asset, which allowed an attacker who could tamper with release assets to publish a malicious tarball plus matching checksum and have it installed.Description
checksums.txt.minisigand validatingchecksums.txtwith the embedded minisign public key before archive validation or extraction; implemented inReleaseDownloader.downloadandverifyMinisignSignatureinapps/mootx01/Sources/MootInstallerCore/ReleaseDownloader.swift.signatureVerificationFailedtoUpgradeErrorand wire it where minisign checks can fail.com.apple.quarantineon remotely installed binaries in the upgrade flow so Gatekeeper assesses Developer ID/notarization on first run; implemented inapplyGatekeeperQuarantineand invoked for remote downloads inapps/mootx01/Sources/mootx01/Commands/UpgradeCommand.swift.downloadRequiresMinisignSignatureWhenChecksumMatchesinapps/mootx01/Tests/MootInstallerCoreTests/ReleaseDownloaderTests.swiftthat ensures a tarball with a matching SHA-256 is rejected if the detached minisign signature is absent, and adjust test setup to compute shasum with the systemshasumhelper to avoid depending on test-side CryptoKit.Testing
git diff --checkwhich reported no whitespace problems and committed the changes successfully.swift test --package-path apps/mootx01 --filter ReleaseDownloaderTestsbut it was blocked by the environment (SwiftPM failed to fetch external package dependencies withCONNECT tunnel failed, response 403), so the test suite could not be executed here.swiftc -typecheck apps/mootx01/Sources/MootInstallerCore/*.swiftbut it failed in this environment due to the runtime/toolchain not exposing theCryptoKitmodule, so an in-repo typecheck could not be completed here.Codex Task