Skip to content

Harden updater integrity checks - #24

Merged
Finesssee merged 1 commit into
mainfrom
codex/propose-fix-for-update-vulnerability
Apr 4, 2026
Merged

Finesssee merged 1 commit into
mainfrom
codex/propose-fix-for-update-vulnerability

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Motivation

  • The existing auto-update path downloaded installer binaries and executed them without verifying integrity, enabling supply-chain or MITM tampering to result in code execution.
  • The change aims to prevent automatic download-and-run flows unless the release metadata supplies a verifiable SHA-256 digest, and to reduce exposure by making background downloads opt-in.

Description

  • Add an expected_sha256: Option<String> field to UpdateInfo and parse an optional digest property from GitHub asset metadata, validating sha256:<hex> values via parse_sha256_digest in rust/src/updater.rs.
  • Gate automatic download eligibility on the presence of a valid digest by changing supports_auto_download() to require expected_sha256.is_some().
  • After streaming the update to disk, compute the file SHA‑256 and compare it against the expected digest, deleting the file and returning an error on mismatch, before sending UpdateState::Ready in rust/src/updater.rs.
  • Make background auto-download opt-in by changing the auto_download_updates default to false in rust/src/settings.rs, and update updater tests to include digest metadata and assert the new auto-download contract.

Testing

  • Ran formatting: cd rust && cargo fmt --all, which completed successfully.
  • Attempted automated tests: cargo test / cargo test updater::tests were executed but the build/test run failed in this environment because the x86_64-pc-windows-msvc target (Windows toolchain) is not installed, so unit tests could not complete here.
  • The updater unit tests were updated to cover digest handling (fixtures adjusted to include digest), and they are expected to run successfully in a Windows-capable CI or local environment with the appropriate Rust target installed.

Codex Task

@Finesssee
Finesssee merged commit 17c65c0 into main Apr 4, 2026
8 checks passed
Finesssee added a commit that referenced this pull request Apr 4, 2026
Security fixes:
- Harden updater integrity checks (PR #24)
- Harden CLI binary resolution (PR #26)
- Harden Kiro CLI path resolution (PR #25)
- Verify VC++ runtime before packaging (PR #23)

New provider:
- Add Infini AI Coding Plan provider (PR #28)

Bug fixes:
- Fix Windows CLI visibility (Issue #22)
- Fix Claude .local/bin detection (Issue #22)
Finesssee added a commit that referenced this pull request Apr 7, 2026
Security fixes:
- Harden updater integrity checks (PR #24)
- Harden CLI binary resolution (PR #26)
- Harden Kiro CLI path resolution (PR #25)
- Verify VC++ runtime before packaging (PR #23)

New provider:
- Add Infini AI Coding Plan provider (PR #28)

Bug fixes:
- Fix Windows CLI visibility (Issue #22)
- Fix Claude .local/bin detection (Issue #22)
@Finesssee
Finesssee deleted the codex/propose-fix-for-update-vulnerability branch August 28, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant