Back to skill

Security audit

Parallel Coding

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent worktree workflow guide, but it recommends running coding agents with permission safeguards disabled and inheriting the user's full shell environment.

Install only if you are comfortable adapting the workflow. Do not use the bypassPermissions examples as a default; run agents with normal approvals or inside a sandbox/container, pass only the environment variables needed for the task, and review any pushes or PRs before merging.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:64
Finding

Unrestricted Coding-Agent Execution with Exposure of the User Environment

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 64–71; the unrestricted permission option is also used at line 29
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation
Risk Level: High

Vulnerable Code

bash
# Non-interactive mode recommended for parallel tasks
cd /path/to/worktree
claude --permission-mode bypassPermissions --print 'Task description'

# Note: source the shell configuration first to load environment variables
source ~/.zshrc && claude --permission-mode bypassPermissions --print 'Task description'

A duplicate unrestricted launch pattern appears earlier:

bash
cd ../project-feature-a && claude --permission-mode bypassPermissions --print 'Implement user login functionality'

Technical Analysis

The documented --permission-mode bypassPermissions option disables the coding agent's normal permission and approval boundary. This gives agent-generated operations broader authority than is necessary to perform development inside a Git worktree. Git worktrees provide source-tree separation, but they do not sandbox processes or prevent access to the user's other files, credentials, network resources, or commands.

The second command compounds this exposure by sourcing ~/.zshrc before starting the unrestricted agent. A shell configuration can export API keys, cloud credentials, repository tokens, database connection strings, and other sensitive values. It can also execute startup commands or define wrappers and aliases. Consequently, the agent may inherit sensitive credentials and the user's full ambient authority while operating without normal approval prompts.

This becomes exploitable if the agent processes malicious repository instructions, adversarial task content, compromised build scripts, or prompt-injection material embedded in source files. No malicious payload is embedded in this project itself; the risk arises from the unsafe execution procedure it explicitly recommends.

Attac

...[truncated 1896 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove --permission-mode bypassPermissions from every example, including the command at line 29 and the Claude Code examples at lines 67 and 70.
  2. Use the agent's default interactive approval mode or a narrowly scoped allowlist permitting only commands required for the assigned task.
  3. Do not source the complete ~/.zshrc before launching an agent. Provide only explicitly required environment variables through a minimal environment file or per-command variable assignments.
  4. Ensure secrets are not inherited unless indispensable. Use short-lived, task-specific credentials with minimal repository and service permissions.
  5. Run each coding agent in a sandbox or container that restricts filesystem access to its assigned worktree.
  6. Restrict network access by default and require explicit approval for package downloads, remote API access, pushes, and pull-request creation.
  7. Require user confirmation for destructive commands, dependency installation, credential access, and modifications outside the assigned worktree.
  8. Treat repository files, task descriptions, dependency output, and build logs as untrusted content that may contain prompt-injection instructions.
  9. Document that Git worktrees isolate working directories but do not provide a process-level security boundary.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

bash
# 非交互模式(推荐用于并行任务)
cd /path/to/worktree
claude --permission-mode bypassPermissions --print '任务描述'

# 注意:需要先 source shell 配置加载环境变量
source ~/.zshrc && claude --permission-mode bypassPermissions --print '任务描述'

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs users to run Claude Code with --permission-mode bypassPermissions, disabling approval safeguards for an agent whose stated purpose is only parallel task coordination via git worktrees. In this context, the agent may autonomously read, modify, or execute beyond the minimum required scope, increasing the chance of unauthorized filesystem or command actions across multiple worktrees.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example recommends bypassing permission checks without warning users that this removes approval gates and enables autonomous file and system actions. Because the skill is designed for parallel use, this risk is amplified: multiple agent instances could act with broad autonomy at the same time, magnifying unintended or unsafe operations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation recommends source ~/.zshrc before launching the agent, which can inject ambient credentials, tokens, and other sensitive environment variables into the agent process. That exceeds the skill's worktree-management purpose and unnecessarily broadens the agent's access to secrets unrelated to the requested coding task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill tells users to source their shell profile to load environment variables but omits any warning that this may expose secrets to the agent process. Since shell profiles commonly load API keys, cloud credentials, SSH settings, and other sensitive context, this creates an avoidable secret-exposure path unrelated to basic worktree orchestration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The top-level description is presented entirely in Chinese, and the rest of the document continues in that language without indicating that users may choose another language. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale restriction is justified.

Content

No source excerpt is available for this finding.