using-git-worktrees
Pass
Audited by Gen Agent Trust Hub on Oct 6, 2026
Risk Level: SAFEINDIRECT_PROMPT_INJECTIONCOMMAND_EXECUTION
Full Analysis
- [INDIRECT_PROMPT_INJECTION]: The skill's setup script parses
CLAUDE.mdto extract worktree directory preferences usinggrepandsed. This represents a vulnerability surface where a malicious repository could include a craftedCLAUDE.mdfile to influence file system operations. - Ingestion points:
CLAUDE.md(parsed inscripts/worktree-setup). - Boundary markers: None present; the script extracts content between quotes or backticks without validation.
- Capability inventory:
mkdir -p,git worktree add, and various package managers (npm,pip,cargo, etc.) inscripts/worktree-setup. - Sanitization: Absent. The script appends the extracted string to the repository root path without checking for directory traversal sequences (e.g.,
../). - [COMMAND_EXECUTION]: The
scripts/worktree-setupscript executes several commands that modify or interact with the host environment: - Automatic Git Commits: The script automatically adds entries to
.gitignoreand performs agit commitif the worktree directory is not already ignored. This modifies the repository's permanent history without explicit user confirmation for each commit. - External Test Runner: The script attempts to execute a file at
~/.agents/bin/run-tests. This introduces a dependency on an external, unmanaged binary in the user's home directory. - Package Managers: The script invokes
npm install,cargo build,pip install,poetry install, andgo mod download. While these are standard development tools, they are capable of executing arbitrary code via post-install scripts or build-time hooks if the repository contains malicious configuration files.
Audit Metadata