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.pyscript contains a command injection vulnerability in therun_linterfunction. It constructs shell commands by joining filenames into a single string wrapped in single quotes and executes them usingbash -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.pyscript identifies modified files usinggit diffandgit ls-filesin 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.runto 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.mdreferenceshttps://github.com/astral-sh/ruff-pre-commitandhttps://github.com/pre-commit/mirrors-mypyfor pre-commit hook definitions.
Audit Metadata