Back to skill

Security audit

ia-git-worktree

Security checks for vulnerabilities and agentic risk

Overview

The scanners rate this skill suspicious because it manages Git worktrees but also copies potentially sensitive .env files and has other reported activity that does not clearly match its stated purpose.

Consider the verdict's Review warning carefully before installing. In particular, determine whether you need automatic .env copying and are comfortable with the separate copy-env command's reported trust-check gap. The scan is partial: two local references could not be resolved, and the behavior of referenced external tools is not shown.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (15)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The chunk performs conditional repository indexing rather than worktree management. Nothing in the supplied code connects this indexing operation to creating, listing, switching, or cleaning up worktrees, so it represents an undeclared capability rather than an evident supporting implementation detail. The internal behavior of my-tool index is not shown.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The visible code invokes evaluation and diagnostic tooling rather than performing the declared worktree operations. Naming a worktree-related target does not make those activities worktree management. The implementation of the invoked script is not supplied, so additional behavior cannot be determined.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Environment copying is explicitly documented, so it is not inherently a description-behavior mismatch. However, the identified copy-env command lacks the creation-time trust check and can place main-checkout secrets into an untrusted review tree if invoked mistakenly or through adversarial prompting; the prose prohibition reduces but does not enforce this boundary.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
| `create [--no-env] <branch> [from]` | Create worktree + branch (default: from main) | `...worktree-manager.sh create feature-login` |
| `list` / `ls` | List all worktrees with status | `...worktree-manager.sh list` |
| `switch <name>` / `go` | Print the registered worktree's absolute path; the caller applies it as workdir | `target=$(...worktree-manager.sh switch feature-login)` |
| `copy-env <name>` | Copy .env files to existing worktree | `...worktree-manager.sh copy-env feature-login` |
| `cleanup <name> [...]` / `clean` | Confirm removal of named, session-owned, clean worktrees | `...worktree-manager.sh cleanup feature-login` |

Run commands with `env -C "$target" <command>` or the harness workdir argument. A child script cannot change the caller's working directory. Listing and name resolution work from any main or linked checkout, including subdirectories.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/troubleshooting.md (reported line 25)May include surrounding context.

bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh list

text

### .env files missing in worktree?

If a worktree was created without .env files (e.g., via raw `git worktree add`, `--no-env`, or a base that is not a local or `origin` branch), copy them only when the tree holds no third-party code; never copy into a PR or fork review tree. Existing files and symlinks in the worktree are skipped, not overwritten; remove a stale copy first to refresh it:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/troubleshooting.md (reported line 27)May include surrounding context.

.env files missing in worktree?

If a worktree was created without .env files (e.g., via raw git worktree add, --no-env, or a base that is not a local or origin branch), copy them only when the tree holds no third-party code; never copy into a PR or fork review tree. Existing files and symlinks in the worktree are skipped, not overwritten; remove a stale copy first to refresh it:

bash
bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh copy-env feature-name

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/workflow-examples.md (reported line 42)May include surrounding context.

Parallel Feature Development

bash
# For first feature (copies .env files; main is the default branch):
export WORKTREE_SESSION_ID="$(python3 -I -c 'import uuid; print(uuid.uuid4())')"
bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh create feature-login

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/workflow-examples.md (reported line 46)May include surrounding context.

md
export WORKTREE_SESSION_ID="$(python3 -I -c 'import uuid; print(uuid.uuid4())')"
bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh create feature-login

# Later, start second feature (also copies .env files):
bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh create feature-notifications

# List what you have:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/worktree-manager.sh (reported line 142)May include surrounding context.

sh
done

  if [[ $((copied + skipped)) -eq 0 ]]; then
    echo -e "  ${YELLOW}ℹ️  No .env files found in main repository${NC}"
    return
  fi
  echo -e "  ${GREEN}✓ Copied $copied environment file(s), skipped $skipped${NC}"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/worktree-manager.sh (reported line 294)May include surrounding context.

sh
fi

  if [[ "${COMMON_BARE}" == true ]]; then
    echo -e "${YELLOW}Skipped .env copy: bare repository has no main checkout${NC}"
  elif [[ "${copy_env}" == 0 ]]; then
    echo -e "${YELLOW}Skipped .env copy (--no-env)${NC}"
  elif [[ "${checkout_trusted}" == 1 ]]; then

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/worktree-manager.sh (reported line 296)May include surrounding context.

sh
if [[ "${COMMON_BARE}" == true ]]; then
    echo -e "${YELLOW}Skipped .env copy: bare repository has no main checkout${NC}"
  elif [[ "${copy_env}" == 0 ]]; then
    echo -e "${YELLOW}Skipped .env copy (--no-env)${NC}"
  elif [[ "${checkout_trusted}" == 1 ]]; then
    copy_env_files "$worktree_path"
  else

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/worktree-manager.sh (reported line 300)May include surrounding context.

sh
elif [[ "${checkout_trusted}" == 1 ]]; then
    copy_env_files "$worktree_path"
  else
    echo -e "${YELLOW}Skipped .env copy: $from_branch is not the default branch or a local branch containing this commit.${NC}"
    echo "  Treat this tree as untrusted: no credentials, no dependency lifecycle scripts."
  fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/worktree-manager.sh (reported line 435)May include surrounding context.

sh
Create new worktree (from-branch defaults to main)
  list | ls                           List all worktrees
  switch | go [name]                  Print registered worktree path for caller workdir
  copy-env | env [name]               Copy .env files from main repo to worktree
                                      (if name omitted, uses current worktree)
  cleanup | clean <name> [...]        Remove named clean worktrees owned by WORKTREE_SESSION_ID
  help                                Show this help message

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Worktree creation copies potentially sensitive .env files by default, beyond the manifest's stated Git worktree management operations.

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The script reads .env* files from the main checkout and duplicates their contents into another checkout. This happens automatically for qualifying branches because environment copying defaults to enabled (L189, L293–L298), although the manifest does not disclose credential or environment-file propagation. Branch trust checks and restrictive destination permissions reduce risk but do not make copying potentially sensitive configuration necessary for managing Git worktrees.

Content

No source excerpt is available for this finding.