T06 · System Persistence
- Location
SKILL.md:151- Finding
Persistent Git Post-Commit Hook Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 151–171
Vulnerability Type: Persistent executable Git hook
Risk Level: HighVulnerable Code
bash Write `.argus/commit-hook.sh`: #!/bin/bash # Argus post-commit hook # Enriches insufficient commit messages and runs incremental tests COMMIT_MSG=$(git log -1 --format="%s%n%b") CHANGED_FILES=$(git diff HEAD~1 HEAD --name-only 2>/dev/null || echo "") # Pass to argus for analysis echo "[Argus] Analyzing commit..." # Claude will be invoked here via: claude -p "argus post-commit" # For now, log for manual review echo "[Argus] Changed files: $CHANGED_FILES" >> .argus/commit-log.txt echo "[Argus] Message: $COMMIT_MSG" >> .argus/commit-log.txt cp .argus/commit-hook.sh .git/hooks/post-commit chmod +x .git/hooks/post-commitTechnical Analysis
The initialization procedure creates an executable script and installs it as
.git/hooks/post-commit. Git automatically executes this hook after every subsequent commit in the repository, including after the original Argus operation has ended.This establishes cross-session persistence. The installation also uses
cpwithout checking whether apost-commithook already exists, so it can overwrite legitimate repository automation. The installed hook records changed filenames and complete commit messages in.argus/commit-log.txt. Commit bodies can contain internal issue details, repository paths, or other sensitive development metadata.Although the documented version of the hook only writes local logs, its persistent execution position is security-sensitive: later modification of
.argus/commit-hook.shdoes not update the copied hook, but any direct modification of.git/hooks/post-commitwould execute on every commit under the developer's account.Attack Path
- A user installs the Skill and runs
/argus init. - The Skill writes
.argus/commit-hook.sh. - It copies the scri ...[truncated 973 chars]
- A user installs the Skill and runs
- Remediation
View remediation
Remediation Suggestions
- Do not install a Git hook automatically during initialization.
- Make hook installation a separate, explicit, opt-in operation with a clear description of its persistence and data collection.
- Check whether
.git/hooks/post-commitalready exists. Never overwrite it without informed user confirmation. - Prefer a managed hook framework that can safely chain multiple hooks.
- Back up any existing hook before installation and provide a documented uninstall command.
- Minimize logged data. Avoid storing full commit bodies by default and provide configurable retention.
- Apply restrictive permissions to generated log files and exclude them from version control.
- Display the exact hook content before installation and verify its integrity before each update.
