Repository navigation
Desktop updater: simpler signing gate and .sig check before download (#3705 follow-up) - #3720
Open
holmesworcester wants to merge 3 commits into
Open
holmesworcester wants to merge 3 commits into
holmesworcester wants to merge 3 commits into
Conversation
… downloading (#3705 follow-up) Build side: sign whenever QUIET_UPDATE_SIGNING_KEY is set (a key the app does not accept still stops the build), and require a key only when QUIET_REQUIRE_UPDATE_SIGNING=1, which the Linux and Windows release jobs set. This replaces the argv/yargs detection of `--publish never`, which depended on electron-builder internals, and JS-API callers no longer need to null the hooks. A test checks that every publishing Windows/Linux step in desktop-build.yml sets the requirement and is followed by verifyUpdateSignatures. Runtime: fetch and verify the .sig against the feed's announced version, file name and sha512 before downloading the installer, so a bad or missing signature is refused without a ~150 MB download on every check. The finished file is re-hashed against the signed sha512 (covering every download route), and the install-time copy, re-hash and re-verify are unchanged. Docs: update-signing.md, the JS-API build commands, a one-sentence CHANGELOG entry; buildEnv.cjs renamed to buildEnv.test-helper.cjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…als are present Codex review: with only the opt-in flag, a build with publishing credentials but no flag (implicit tag publish, a new workflow, a developer's -p always) would upload unsigned installers. Treat AWS credentials in the environment or in the AWS credential/config files as requiring the key, still without reading any electron-builder internals, and check every workflow step that can publish. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lisher Codex review round 2: electron-builder's S3 signer also accepts the legacy AWS_ACCESS_KEY/AWS_SECRET_KEY, and electron-publish reads ~/.aws/credentials from the default location whatever AWS_SHARED_CREDENTIALS_FILE says. Detect both, test the detector against the locked publisher's own credential lookup, and check workflow steps that hand electron-builder to an action as with: command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
Follow-up to #3705 (desktop update signature verification, squash 0efc96d). It makes the changes an Opus review of #3705 asked for: a simpler update-signing gate that no longer depends on electron-builder internals, and a
.sigchecked before the installer is downloaded. Security is not weaker. Every #3705 guarantee is kept and still tested: elevation refusal, installing from a verified private copy, downgrade/prerelease refusal, sign-before-upload, no reuse of a cache from an earlier launch, and a signed statement that binds version, file name and sha512.Build-side gate (packages/desktop/scripts)
isBuilderCli/explicitlyUnpublished, which canonicalisedargv[1]and re-parsed argv with electron-builder's internal yargs. An electron-builder upgrade that moved those internals would have broken every keyless local/PR build.artifactBuildCompleted, before upload, and verified. A key that is not pinned inupdate-signing-keys.jsonstill stops the build.QUIET_REQUIRE_UPDATE_SIGNING=1, which is now set on the Linux and Windows release steps indesktop-build.yml. Any other non-empty value is an error.AWS_ACCESS_KEY/AWS_SECRET_KEYand theAWS_PROFILE/AWS_*_FILEoverrides, and~/.aws/credentialsor~/.aws/configin the default location. electron-builder reads that location whatever the override says.-p always) is still refused without a key. Only the environment is read. This part came out of the Codex review, rounds 1 and 2.verifyUpdateSignatures.cjsstill runs after the release builds.mobile-notification-e2e.ymland the two e2e READMEs.Signature checked before download (src/main/updaterSecurity.ts)
<file>.sigand verifies it against the feed's announced version, file name and sha512 before downloading the installer. Before this change, every hardened client re-downloaded the ~150 MB installer every 15 minutes and on every launch whenever a feed had a bad or missing.sig. Now that costs one ≤4 KB request.spawnLogwrapper, explaining what it does on Linux (nothing; it is the Windows installer start).Docs and nits
update-signing.md: rewritten for the new gate and the pre-download check. The staleafterAllArtifactBuildsigning bullet is gone. The Authenticode limit now says the installers are no longer Authenticode-signed (chore(desktop): stop Authenticode-signing the Windows installer (expired certificate) #3716).scripts/buildEnv.cjs→scripts/buildEnv.test-helper.cjs.Tests
updaterSecurity.test.ts: 118/118.packaged-appimageagainst a real built AppImage..sig, the installer is never requested over three consecutive checks; only the.sigis. The control fetches the.sigbefore the installer.resolveAwsCredentialsplus aws4's fallback).run:or as an action'swith: command:, must set the flag, have the key, and be followed byverifyUpdateSignatures..sigafter the download (16 failures)update-loop.test.cjs, real NsisUpdater/AppImageUpdater, feed served by another process): it now also asserts whether the installer was fetched. Linux: pass. Windows 11 VM (Node 20.20.1): 10/10. The installer is never fetched for tampered, wrong-signer, unsigned, garbage, replayed or prerelease cases, and is fetched for the control and the feed-hash mismatch.--publish never: builds, no.sigdirbuild with no hook-nulling: buildsQUIET_REQUIRE_UPDATE_SIGNING=true;-p alwayswith dummyAWS_ACCESS_KEY_IDor legacyAWS_ACCESS_KEYand no keyverifyUpdateSignaturespassed. The same.sigis correctly rejected against the real pinned keys.Residual
🤖 Generated with Claude Code