Back to skill

Security audit

Finishing a Development Branch

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a normal Git branch-finishing workflow, but conflicting cleanup instructions could remove a local worktree after creating a pull request when the user expected it to be kept.

Review the cleanup behavior before installing. In particular, treat Option 2 as unsafe until the skill is fixed so PR creation clearly preserves the worktree or asks for explicit confirmation before removing it. Avoid using it on repositories with valuable local-only files or setup in worktrees unless you verify the exact path and branch before cleanup.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:89
Finding

Contradictory cleanup instructions may unexpectedly remove a pull-request worktree

Content
View full analysis
# Create PR gh pr create --title "" --body "$(cat <<'EOF' ## Summary <2-3 bullets of what changed> ## Test Plan - [ ] <verification steps> EOF )" ``` Then: Cleanup worktree (Step 5) ``` The cleanup step explicitly includes Option 2: ```markdown ### Step 5: Cleanup Worktree **For Options 1, 2, 4:** Check if in worktree: ```bash git worktree list | grep $(git branch --show-current) ``` If yes: ```bash git worktree remove <worktree-path> ``` **For Option 3:** Keep worktree. ``` This conflicts with the later safety guidance: ```markdown **Automatic worktree cleanup** - **Problem:** Remove worktree when might need it (Option 2, 3) - **Fix:** Only cleanup for Options 1 and 4 ``` ### Technical Analysis The workflow gives mutually incompatible instructions for Option 2. The executable procedure directs the agent to perform Step 5 after pushing the branch and creating a pull request, while Step 5 explicitly includes Option 2 among the cases requiring worktree removal. However, the quick-reference and common-mistakes guidance state that a pull-request worktree must be preserved. An agent following the procedural instructions sequentially may treat the earlier operational steps as authoritative and execute `git worktree remove <worktree-path>`. This is an unsafe coding and configuration defect because a user selecting “Push and Create PR” did not select local worktree deletion. The check is also fragile because: ```bash git worktree list | grep $(git branch --show-current) ``` uses unquoted command substitution and matches unstructured human-readable output. Branch names containing pattern characters, spaces, ...[truncated 1697 chars]
Remediation
View remediation
. No local branch or worktree cleanup was performed. ``` 3. Require explicit confirmation immediately before any worktree removal, even when cleanup follows a previously selected workflow option. 4. Resolve and validate the exact worktree path using structured Git output rather than matching `git worktree list` with `grep`. For example, parse `git worktree list --porcelain` and verify that the selected path and branch correspond exactly. 5. Quote all shell-expanded values and use end-of-options delimiters where supported: ```bash git worktree remove -- "$worktree_path" ``` 6. Before removal, verify that: - the path is a registered linked worktree; - it corresponds to the intended feature branch; - it is not the current or base worktree; - it contains no uncommitted or untracked work; - the user has confirmed the exact displayed path. 7. Add workflow tests or review checks covering all four options so that Option 2 is guaranteed to preserve both its branch and worktree. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The procedure says Option 2 should create a PR and then proceed to Step 5, where cleanup applies to Options 1, 2, and 4, but elsewhere the skill says Option 2 should preserve the worktree. This inconsistency can cause unintended deletion of a developer's active worktree after PR creation, disrupting workflows and potentially losing uncommitted local context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The quick reference table says Option 2 keeps the worktree, but the step-by-step procedure later removes it. In a branch-finishing skill that performs git cleanup, this mismatch increases the chance of destructive actions because users and agents may rely on the summary table while execution follows the conflicting procedural text.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The 'Common Mistakes' and 'Always' sections state cleanup should occur only for Options 1 and 4, while the actual Step 5 instructions include Option 2. Conflicting operational guidance in an automation skill is dangerous because an agent may follow the procedural step over the prose, leading to unintended worktree removal despite documented expectations.

Content

No source excerpt is available for this finding.

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 175)May include surrounding context.

md
- **Problem:** Remove worktree when might need it (Option 2, 3)
- **Fix:** Only cleanup for Options 1 and 4

**No confirmation for discard**
- **Problem:** Accidentally delete work
- **Fix:** Require typed "discard" confirmation

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 184)May include surrounding context.

md
**Never:**
- Proceed with failing tests
- Merge without verifying tests on result
- Delete work without confirmation
- Force-push without explicit request

**Always:**

Static analysis

No suspicious patterns detected.