Commit Graph

1 Commits

Author SHA1 Message Date
Alexander Whitestone
ee1c7ab279 fix: #1430 - Prevent shell injection in commit messages
Some checks failed
CI / test (pull_request) Failing after 1m11s
CI / validate (pull_request) Failing after 1m5s
Review Approval Gate / verify-review (pull_request) Successful in 11s
- Add safe_commit.py tool for safe commit message handling
- Add commit-msg hook to warn about dangerous patterns
- Add documentation for safe commit practices
- Prevent shell injection from backticks and other special chars

Addresses issue #1430: [IMPROVEMENT] memory_mine.py ran during git commit

Problem: Commit messages containing backticks can trigger shell execution.
Solution: Use git commit -F <file> or escape special characters.

Tools added:
- bin/safe_commit.py: Safe commit tool with escaping and file-based commits
- .githooks/commit-msg: Hook to warn about dangerous patterns
- docs/safe-commit-practices.md: Documentation for safe commit practices

Example safe usage:
  python3 bin/safe_commit.py -m "Message with backticks: \`code\`"
  git commit -F <file>  # Safest method
  git commit -m "Message with escaped backticks: \`code\`"

This prevents unintended code execution during git operations.
2026-04-15 00:50:54 -04:00