Skip to content

The staged secret scan refuses a token with the git shim on PATH: the shim stops warning on gitleaks's diff argv, and a gitleaks that logged an error is no longer a pass - #413

Merged
HackingGate merged 2 commits into
mainfrom
fix/410-staged-scan-fails-open
Oct 22, 2026
Merged

HackingGate merged 2 commits into
mainfrom
fix/410-staged-scan-fails-open

Conversation

@HackingGate

Copy link
Copy Markdown
Owner

Carries #412's commit underneath, because the pre-push cargo-deny refuses any push from main without it. Rebase onto main once #412 lands.

Two defects met in uphold supply-chain --staged on any host where git
is the uphold shim.

The shim called git diff -U0 --no-ext-diff --staged . unclear and wrote
that to stderr. Both readings of the unknown options find diff; only the
noun moved, and no match entry names diff with any noun, so the noun
could not decide anything. reading now answers Absent there. A verb an
entry does pair with a noun keeps the doubt.

gitleaks 8.30.1 treats any git stderr as a failed diff: it logs
ERR error="stderr is not empty", scans nothing, and exits 0. uphold read
the 0 as a pass. An ERR line under exit 0 is now could-not-look, exit 2,
naming the line, so a warning from any git on PATH no longer blinds the
scan in silence.

The CLI test stages a token with uphold linked in front of git and a
gitleaks stub that reads the index through the real argv and answers as
gitleaks does; it fails with either fix reverted. Checked live against
gitleaks 8.30.1 as well: 1.35.0 passes the staged token, this refuses it.

Closes #410.

https://claude.ai/code/session_01HM96sKSAyDhLk9smu82u5V

…e_json 1.0.154

serde_json 1.0.154 (#404) depends on foldhash 0.2.0, licensed Zlib, which
the allow list did not name. CI does not run cargo-deny, so main stayed
green while the pre-push `uphold supply-chain` refused every push from it.

Zlib is permissive and OSI approved, with no copyleft and no attribution
required in the binary.

Claude-Session: https://claude.ai/code/session_01HM96sKSAyDhLk9smu82u5V
… shim stops warning on gitleaks's diff argv, and a gitleaks that logged an error is no longer a pass

Two defects met in `uphold supply-chain --staged` on any host where `git`
is the uphold shim.

The shim called `git diff -U0 --no-ext-diff --staged .` unclear and wrote
that to stderr. Both readings of the unknown options find `diff`; only the
noun moved, and no `match` entry names `diff` with any noun, so the noun
could not decide anything. `reading` now answers `Absent` there. A verb an
entry does pair with a noun keeps the doubt.

gitleaks 8.30.1 treats any git stderr as a failed diff: it logs
`ERR error="stderr is not empty"`, scans nothing, and exits 0. uphold read
the 0 as a pass. An `ERR` line under exit 0 is now could-not-look, exit 2,
naming the line, so a warning from any git on PATH no longer blinds the
scan in silence.

The CLI test stages a token with uphold linked in front of git and a
gitleaks stub that reads the index through the real argv and answers as
gitleaks does; it fails with either fix reverted. Checked live against
gitleaks 8.30.1 as well: 1.35.0 passes the staged token, this refuses it.

Closes #410.

Claude-Session: https://claude.ai/code/session_01HM96sKSAyDhLk9smu82u5V
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 833cd6f5-33bb-4f05-ab3e-8e873dddc94a
📥 Commits

Reviewing files that changed from the base of the PR and between 0051e77 and 1a9adaf.

📒 Files selected for processing: 4
  • deny.toml
  • src/shim.rs
  • src/supply.rs
  • tests/supply_chain_cli.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.85%. Comparing base (0051e77) to head (1a9adaf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #413   +/-   ##
=======================================
  Coverage   94.84%   94.85%           
=======================================
  Files          52       52           
  Lines       27217    27259   +42     
=======================================
+ Hits        25815    25857   +42     
  Misses       1402     1402           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HackingGate
HackingGate merged commit eb27d8e into main Oct 22, 2026
12 checks passed
@HackingGate
HackingGate deleted the fix/410-staged-scan-fails-open branch October 22, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants