fix(hooks): use strings for binary file scanning in pre-push#1196
Open
John-David Dalton (jdalton) wants to merge 2 commits intomainfrom
Open
fix(hooks): use strings for binary file scanning in pre-push#1196John-David Dalton (jdalton) wants to merge 2 commits intomainfrom
John-David Dalton (jdalton) wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2f037d9. Configure here.
2f037d9 to
25ef7d0
Compare
Add || echo "" fallback to strings and cat command substitutions, matching the existing pattern at line 137. Without this, if strings is not installed (e.g. minimal Docker/CI images), set -e silently aborts the script with exit 127, blocking the push with no message.
Bill Li (billxinli)
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Use strings command for binary files (WASM, .lockb, etc) instead of raw grep to properly detect embedded paths and secrets.
Note
Medium Risk
Changes the pre-push secret scanning logic to treat binary files differently, which can affect detection accuracy and may alter what gets blocked during pushes. Low code footprint, but it gates all pushes and could introduce new false positives/negatives if
strings/binary detection behaves unexpectedly.Overview
Improves
.git-hooks/pre-pushfile-content security checks by detecting binary files and scanning them viastringsoutput instead of grepping raw bytes.All existing detectors (personal paths,
sktsec_keys, AWS/GitHub creds, private keys) now operate on a normalizedfile_textstream, including for WASM and other binary artifacts, with matching lines printed from that extracted text when blocking a push.Reviewed by Cursor Bugbot for commit 2f037d9. Configure here.