Skip to content

Verify Windows installer archive checksums before extraction - #71

Draft
cloud9c wants to merge 2 commits into
mainfrom
fix/windows-installer-checksum
Draft

cloud9c wants to merge 2 commits into
mainfrom
fix/windows-installer-checksum

Conversation

@cloud9c

@cloud9c cloud9c commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

The generated Windows installer currently extracts downloaded ZIPs without checking the published checksum. This change embeds each release ZIP's SHA256 in the installer during CI and verifies the downloaded bytes before extraction or copying files. A mismatch stops installation and preserves an existing installation.

The build step computes the digest from the archive, checks its release checksum file, covers architecture aliases, and fails on missing artifacts, invalid checksums, or unsupported template structure. Runtime verification uses the embedded digest, so replacing both a download and its sidecar checksum is rejected. It adds no signing service and retains cargo-dist 0.30.2.

Related to WVDSH-2364. This is an integrity improvement, not a confirmed fix for the unreproduced Defender warning. It relies on trusted delivery of the installer and cannot protect against replacement of both installer and archive.

Validation: six tests pass on Windows PowerShell 5.1 and PowerShell 7. They run the actual generated installer with harmless local archives and isolated install directories, covering valid installs, changed archives and sidecars, missing downloads, invalid build inputs, and template rejection. Existing files remain unchanged and no executable is extracted on checksum mismatch. The same suite also passes against freshly generated cargo-dist 0.30.2 and 0.33.0 installers. Actionlint, release planning, the 0.30.2 PowerShell global-artifact build, and git diff --check pass.

release.yml now has a small maintained post-build step, documented in docs/windows-installer.md. The full release workflow has not been run on GitHub. This draft is independent of the Azure signing draft; when combining them, preserve checksum injection before installer signing and revalidate the merged workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants