git-worktree
Warn
Audited by Gen Agent Trust Hub on Oct 4, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONCREDENTIALS_UNSAFEDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The
worktree-manager.shscript uses the user-providedbranch_nameargument to construct file system paths (worktree_path="$WORKTREE_DIR/$branch_name"). Without sanitization, this allows for path traversal, potentially enabling the skill to create or manipulate directories outside of the intended.worktrees/scope. - [CREDENTIALS_UNSAFE]: The
copy_env_filesfunction automatically searches for and copies all files matching.env*from the repository root to new worktree directories. This behavior results in the duplication and movement of sensitive credentials, increasing the risk of exposure if worktree directories are not properly managed or if they are excluded from security scans. - [DYNAMIC_EXECUTION]: The
trust_dev_toolsfunction automates the execution ofmise trustanddirenv allow. While the script attempts to verify file integrity usinggit hash-objectagainst a trusted base branch, this functionality is specifically designed to bypass the manual security approval prompts inherent to those tools, which are meant to prevent the automatic execution of potentially malicious configuration files. - [INDIRECT_PROMPT_INJECTION]: The skill presents an attack surface for indirect prompt injection. If an AI agent processes a malicious Pull Request or branch name containing shell metacharacters or path traversal sequences, and then passes that input to the
worktree-manager.shscript, it could lead to unintended command execution. - Ingestion points: Command-line arguments
branch_nameandfrom_branchinworktree-manager.sh(sourced from the agent's interaction with the user or PR data). - Boundary markers: None present; the script does not validate the structure of branch names before using them in path construction.
- Capability inventory: The script performs file copying (
cp), directory creation (mkdir), directory removal (rmdir), Git operations (git worktree), and tool authorization (mise trust,direnv allow). - Sanitization: There is no sanitization or validation of the branch name input to prevent path traversal or character injection.
Audit Metadata