Repository navigation
fix(updater): a macOS update must be signed by the same team as the installed app (#1588) - #1704
Merged
Merged
Conversation
…app, not just an intact seal (#1588)
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.
Closes #1588.
MacosSparkleInstaller._verifyCodesignrancodesign --verify --deep --stricton the downloaded bundle. That proves the seal is intact, not who signed it: any validly signed bundle, even ad-hoc, passed and replaced the installed app.codesign -dv --verbose=4,TeamIdentifier=), and refuses the update when they differ or when the update has none.SHA256SUMS.txtbefore this step, stays the check; that guards the transfer, not a compromised release, which the issue already notes.codesignruns through an injectable process runner (defaultProcess.run), and the parsing and the decision are pure functions:parseCodesignTeamId,signerMismatchProblem.Not verified on a Mac: the output format is
codesign's documented one (TeamIdentifier=XXXXXXXXXX/not set, printed to stderr). Ifcodesign -dvfailed on a signed installed app for some other reason, the check would treat it as unsigned and let the update through, as before this PR.Tests: Team ID parsing for a Developer ID signature, an ad-hoc one and no signature; the decision for the same team, another team, an unsigned update over a signed app, and an unsigned installed app.