T09 · Insecure Skill Coding Practices
- Location
scripts/git_hooks.py:496- Finding
Arbitrary File Deletion Through Unvalidated Hook Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Git hook manager, but it needs review because a removal command can delete files outside Git hooks and some templates automatically run package tools.
Review before installing. Use only in repositories where persistent Git hooks are desired, avoid the install-deps template unless you accept automatic package-manager execution after merges, and do not run the remove command with any value other than a normal Git hook name until the path validation issue is fixed.
scripts/git_hooks.py:496Arbitrary File Deletion Through Unvalidated Hook Path
scripts/git_hooks.py:42Unpinned Package Download and Execution Through npx
scripts/git_hooks.py:355Automatic Dependency Installation After Merge Executes Repository-Controlled Code
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
if [ $FOUND -eq 1 ]; then
echo ""
echo "Remove debug statements before committing."
echo "Use 'git commit --no-verify' to bypass this check."
exit 1
fi
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
if [ $FOUND -eq 1 ]; then
echo ""
echo "Remove debug statements before committing."
echo "Use 'git commit --no-verify' to bypass this check."
exit 1
fi
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
if [ $FOUND -eq 1 ]; then
echo ""
echo "Remove debug statements before committing."
echo "Use 'git commit --no-verify' to bypass this check."
exit 1
fi
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
if [ "$BRANCH" = "$b" ]; then
echo "⚠ Direct push to '$BRANCH' is not allowed!"
echo "Create a feature branch and open a pull request."
echo "Use 'git push --no-verify' to bypass (not recommended)."
exit 1
fi
done
The skill advertises actions that install and remove Git hooks via shell commands and write files into a repository, but it does not declare an explicit tool scope such as permissions or allowed-tools. That mismatch can cause the agent or user to authorize broader execution than intended, increasing the chance of unintended file modification or command execution in a local repo.
The listed templates include behaviors with side effects, such as auto-formatting code and auto-installing dependencies after merge, but the description does not clearly warn users that some templates will modify files or invoke package managers. In an agent setting, that omission can lead to surprising code changes or dependency execution in a repository the user did not expect to be altered.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
The post-merge template automatically runs package manager install commands after a merge when lockfiles change. This is risky because merging or pulling untrusted changes can immediately trigger execution paths in package managers, including lifecycle scripts, causing arbitrary code execution from repository-controlled dependency metadata without explicit user confirmation.