Repository navigation
fix(v3/updater): validate payloads before replacing installed applications - #6360
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe updater now validates staged payloads before replacement and validates the installed application before removing its backup. Validation failures can trigger a relaunch of the original application or restoration of the backup. ChangesUpdater swap validation
Priority: Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant runHelperSwap
participant validatePayloadForTarget
participant replaceTarget
participant validateInstalled
participant Backup
runHelperSwap->>validatePayloadForTarget: Check staged payload after parent exits
runHelperSwap->>replaceTarget: Replace target with staged payload
replaceTarget->>validatePayloadForTarget: Recheck payload before replacement
runHelperSwap->>validateInstalled: Check installed application against backup
validateInstalled->>Backup: Read original application for signature comparison
runHelperSwap->>Backup: Restore backup if installed validation fails
Possibly related issues
Possibly related PRs
Suggested reviewers: Merge Risk:
|
Damaged staged updates could replace a working application and discard its backup. Validate the payload before every replacement attempt, then validate the installed result while rollback is still available.
Bundle validation follows the destination type even when the staged name lacks
.app. Malformed or unreadableInfo.plistfiles are rejected; a readable plist withoutCFBundleExecutableretains the executable-directory fallback. macOS signature verification and backup restoration retain the original implementation's compatibility with unsigned and linker-signed builds.Fixes #6351. Supersedes #6352 because neither maintainer account could push to its organisation-owned fork. This carries Julian Storer's implementation plus the fixes for both CodeRabbit findings, with Julian credited in the commit's
Co-authored-bytrailer.Validation:
go test -race ./pkg/updaterpasses on Linux, including the restart-ownership fix already merged as #6350. Windows amd64 and macOS arm64 cross-platform vet checks pass. Native macOS codesign and Windows execution were not rerun here.Summary by CodeRabbit