Skip to content

Verify the gitleaks binary before CI runs it (#885) - #888

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/885-verify-gitleaks-download
Oct 13, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/885-verify-gitleaks-download

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #885

The security workflow installed gitleaks with curl | tar and executed it with nothing checked — the scanner that decides whether secrets are present was itself unverified.

Fix: the expected SHA-256 is pinned in the workflow and checked with sha256sum -c before extraction. Pinned in the step rather than read from the release's checksums.txt, because a file fetched alongside the download can be replaced alongside it. Cross-checked when pinned: the published checksum and a locally computed hash of the tarball agree (5bc41815…e3ba).

Run locally, the exact step accepts the genuine tarball and refuses a one-byte-modified one before tar runs.

Gate: TestWorkflowsVerifyWhatTheyDownload — no workflow may pipe a download into tar or a shell, and any curl -o download must be checked with sha256sum -c in the same step. Its first version read physical lines and passed the original step, whose | tar sat after a \ continuation; it now joins continuations, and fails both on the original step and on the new step with the check removed. No other workflow currently downloads anything this way.

The comment on the step records that upgrading gitleaks changes .gitleaks.toml's allowlist semantics (see #881).

🤖 Generated with Claude Code

The security workflow installed gitleaks with curl | tar and executed it
unchecked. The expected SHA-256 is now pinned in the workflow and checked with
sha256sum -c before extraction; a tampered tarball is refused before tar runs.

TestWorkflowsVerifyWhatTheyDownload forbids piping downloads into tar or a shell
and requires curl -o downloads to be checked in the same step. Its first version
missed the original step because the pipe sat after a line continuation.

Closes #885
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit ef13201 into main Oct 13, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/885-verify-gitleaks-download branch October 13, 2026 19:08
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.

Security workflow downloads the gitleaks binary with no checksum

1 participant