Back to skill

Security audit

Worktree

Security checks for vulnerabilities and agentic risk

Overview

This skill promises to protect your current code branch but can modify it and continue working there when isolation fails.

Before installing, require approval for changes or commits on your original branch and for continuing there if isolation fails. An external worktree directory or local Git exclusion can avoid the automatic .gitignore commit. Setup also installs project dependencies and runs build/test code.

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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • 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 (4)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Step 1: get consent, then create

If the user's instructions already declare a worktree preference, honor it without asking. Otherwise ask once: "Want me to set up an isolated worktree so your current branch stays untouched?" If they decline, work in place and skip to Step 2.

**1a. Native tool first (preferred).** If the harness gives you a worktree mechanism, a tool named something like `EnterWorktree` or `WorktreeCreate`, a `/worktree` command, or a `--worktree` flag, use it and skip to Step 2. Native tools own directory placement, branch creation, and cleanup; a hand-rolled `git worktree add` on top of them leaves phantom state the harness cannot see.

The git fallback instructs the agent to modify and commit on the original branch before creating isolation.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The fallback explicitly directs the agent to modify .gitignore and commit before creating the worktree, changing the original branch despite the skill's isolation promise. Consent to isolated work does not authorize modifying the branch the user wants left untouched.

Content

No source excerpt is available for this finding.

The fallback workflow commits a .gitignore change on the current branch without warning that worktree setup will modify that branch.

Medium
Category
Output Handling
Confidence
98% confidence
Finding

The skill presents worktree creation as preserving the current branch but includes an unapproved commit to that branch as a prerequisite. This is the same underlying issue as finding-07e3d50e352b4efe88b6b28c458321a7, not an additional independent vulnerability.

Content

No source excerpt is available for this finding.

Worktree creation failure silently falls back to setup in the original checkout.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

Although the skill says to report the failure rather than conceal it, it then instructs the agent to work and run setup in the current directory without renewed consent. This fails open when isolation cannot be established, allowing dependency installation, builds, tests, and subsequent edits to affect the checkout the user intended to protect.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.