Fix RCE, data exfiltration, and supply chain vulnerabilities#6
Closed
Fix RCE, data exfiltration, and supply chain vulnerabilities#6
Conversation
…iles and configurations
… disclaimer in readme.md
…adme.md, and include quick_start.md in package.json
…EADME with AI provider details
Copilot
AI
changed the title
[WIP] Fix RCE and data exfiltration vulnerabilities in hooks
Fix RCE, data exfiltration, and supply chain vulnerabilities
Nov 11, 2025
d96ca6c to
b76f1e2
Compare
…o update existing hooks. - Updated AI commit message hook setup instructions to include the option to update existing hooks instantly with `npx git-rewrite-commits --install-hooks` - Added a note that existing hooks will be updated to the latest version and non-git-rewrite-commits hooks will be backed up before replacement # ✨ AI-improved commit message (replaced your original message) # Original was: fix
b76f1e2 to
dd0b487
Compare
|
👍🏻 |
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.
Critical security issues: shell injection in hooks via
eval, unconditional transmission of diffs/files to remote APIs without consent, automatic history rewrites without backups, and unversioned package execution.Changes
Shell injection (hooks/prepare-commit-msg)
eval "$CMD"with secure argument arrays:set -- npx git-rewrite-commits --provider "$PROVIDER"Data exfiltration (src/index.ts)
checkRemoteAPIConsent()- explicit prompt before remote API calls (skipped for local Ollama)redactSensitivePatterns()- strips API keys, passwords, private keys, AWS credentials from diffs--skip-remote-consentflag for non-interactive contextsUnsafe rewrites (hooks/)*
git config hooks.prepareCommitMsg true)--skip-backupfrom post-commit and pre-push hooksSupply chain (SECURITY.md)
npx git-rewrite-commits@0.4.0Breaking Change
Hooks disabled by default. Users must explicitly enable:
Example
Before (vulnerable):
After (secure):
CodeQL scan: 0 alerts.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.