Back to skill

Security audit

Clean Closed Issue Worktrees

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed worktree cleanup tool with strong user-confirmation and safety checks around deletion.

Install only if you want an agent to audit and clean local Git worktrees. Review the proposed exact paths carefully, keep branches unless you intentionally choose deletion, and do not approve cleanup for worktrees with unknown sensitive ignored files or uncertain issue/task state.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
his file from the skill directory. Before invoking the bundled script, resolve `scripts/worktree_cleanup.py` to an absolute path so the command does not depend

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_cleanup.py (reported line 48)May include surrounding context.

python
"vendor",
}
SENSITIVE_IGNORED_GLOBS = (
    ".env",
    ".env.*",
    "*.db",
    "*.db3",

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/worktree_cleanup.py (reported line 93)May include surrounding context.

python
check: bool = True,
    cwd: Optional[Path] = None,
) -> subprocess.CompletedProcess[str]:
    env = os.environ.copy()
    env.setdefault("LC_ALL", "C")
    result = subprocess.run(
        list(command),

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell commands, reads reference files, and writes temporary artifacts, but it does not declare a restrictive tool scope such as permissions or allowed-tools. In an agent environment, this can lead to over-broad tool access and increases the blast radius if the skill is misused, modified, or combined with prompt injection from untrusted issue content or repository data.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/worktree_cleanup.py (reported line 95)May include surrounding context.

python
) -> subprocess.CompletedProcess[str]:
    env = os.environ.copy()
    env.setdefault("LC_ALL", "C")
    result = subprocess.run(
        list(command),
        cwd=str(cwd) if cwd else None,
        env=env,

Static analysis

No suspicious patterns detected.