T07 · Tool Hijacking and Spoofing
- Location
scripts/commit-msg-hook.sh:8- Finding
Repository-Controlled Validator Allows Arbitrary Code Execution During Git Commits
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi ``` 4. If the validator must be loaded from another directory, canonicalize the path and verify that it remains under an administrator- or user-controlled trusted directory. 5. Pin and verify the validator's integrity with a trusted cryptographic digest or signed release before execution. 6. Ensure the trusted validator and its parent directories are not writable by untrusted users or modified through repository branch checkouts. 7. Add integration tests that install the hook in a temporary repository and verify that repository-provided validators are never selected. 8. Document the trust boundary and provide an installation script that atomically installs both the hook and its trusted validator. ]]>
