Skip to content

[sec-check] fix: verify SHA-256 before installing cosign release asset in install-cosign action - #434

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
sec/fix-install-cosign-sha
Open

[sec-check] fix: verify SHA-256 before installing cosign release asset in install-cosign action#434
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
sec/fix-install-cosign-sha

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Security Fix

Cluster: .github/actions/install-cosign/action.yml (only file touched)

The composite action downloaded the cosign release binary and installed it executable (optionally via sudo) with no integrity verification — cosign handles image-signing key material, so an unverified install is a supply-chain weak point. The action has no current callers (in-repo signing uses SHA-pinned sigstore/cosign-installer), but it is public on the v1 tag and callable by any consumer.

What changes:

  1. SHA-256 verification before install — the install step now verifies the downloaded asset against a checksum before install -m 0755.
  2. Pinned checksums for the default release — v3.0.6 (linux-amd64/arm64, darwin-amd64/arm64) pinned in the action; values cross-checked against upstream cosign_checksums.txt from the sigstore/cosign release.
  3. expected-sha256 input — required for any non-default cosign-release; the step fails closed when no checksum is available.
  4. Cross-version cache fallback removed — the restore-keys prefix (cosign-${os}-${arch}-) could restore a binary from a different cosign release than requested; cache is now exact-key only.

No behavior change for the default path beyond the verification gate (hashes match upstream, so legitimate installs proceed identically).

Refs #433


Filed by sec-check agent (ACMM L4/L5 — hold-gated mode). Hold-gated: human review required. Hold label must remain until human merge.

— hive: agent=sec-check backend=copilot model=kimi-k3

install-cosign downloaded the cosign binary and installed it
executable (optionally via sudo) with no integrity check. Now the
install step verifies the asset against a SHA-256 pinned in the
action for the default v3.0.6 release (values cross-checked against
upstream cosign_checksums.txt), requires an expected-sha256 input for
any other release, and fails closed when no checksum is available.
The cross-version cache restore-keys fallback is removed so a prefix
match cannot restore a binary from a different release.

Refs #433

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@kubestellar-hive
kubestellar-hive Bot requested review from castrojo and p5 as code owners August 28, 2026 14:09
@kubestellar-hive kubestellar-hive Bot added the hold Work is intentionally paused. label Aug 28, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sec-check fix: adds SHA-256 verification before installing the cosign release asset. Independently fetched the real cosign_checksums.txt from the v3.0.6 GitHub release and all 4 pinned hashes matched exactly. Fails closed on a missing/mismatched checksum, and the restore-keys cache-poisoning vector is correctly removed. CI green (5/5).


Generated by Claude Code

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

Labels

agent/security Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-projectbluefin-knuckle-gjvq Approved by a Hive merger/owner for auto-merge on green CI hold Work is intentionally paused. security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant