py-git-hooks

Warn

Audited by Gen Agent Trust Hub on Sep 20, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONEXTERNAL_DOWNLOADS
Full Analysis
  • [COMMAND_EXECUTION]: The lint-gate.py script contains a command injection vulnerability in the run_linter function. It constructs shell commands by joining filenames into a single string wrapped in single quotes and executes them using bash -c. However, it fails to escape single quotes within the filenames themselves. If a repository contains a file with a name designed to break out of shell quoting (e.g., '; touch exploit ; '.py), the script will execute the injected commands when the hook is triggered.\n- [INDIRECT_PROMPT_INJECTION]: The skill is susceptible to indirect injection via the repository's file structure.\n
  • Ingestion points: The lint-gate.py script identifies modified files using git diff and git ls-files in the current working directory.\n
  • Boundary markers: Absent. The filenames are treated as trusted inputs to the command construction logic.\n
  • Capability inventory: The script has the capability to execute shell commands via subprocess.run to invoke linters.\n
  • Sanitization: Inadequate. The script attempts to quote filenames but does not perform proper shell escaping for special characters like single quotes.\n- [EXTERNAL_DOWNLOADS]: The setup instructions fetch configuration and hooks from established external sources.\n
  • Evidence: SKILL.md references https://github.com/astral-sh/ruff-pre-commit and https://github.com/pre-commit/mirrors-mypy for pre-commit hook definitions.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 20, 2026, 03:56 PM