Back to skill

Security audit

Deep Research

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed deep-research workflow, but it needs review because it spawns tool-enabled Claude subprocesses and includes unsafe shell scheduling examples.

Install only if you are comfortable with a research skill that can create .research files, use network search/scraping tools, and spawn multiple Claude Code subprocesses with shell and file access. Before running it on sensitive repositories or private data, require an explicit execution plan, restrict child-agent tools and paths, avoid --continue/--resume unless intended, and fix the scheduler pattern to validate task IDs and avoid shell interpolation.

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

Error
Location
SKILL.md:198
Finding

Unsafe Task Identifier Interpolation in Shell-Based Subprocess Scheduler

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 198–208
Vulnerability Type: Command injection and path traversal caused by unsafe shell interpolation
Risk Level: High

Vulnerable code:

bash
cat "$research_dir/tasks.txt" | parallel -j $max_parallel \
    "timeout 600 claude -p \"\$(cat $research_dir/prompts/{}.md)\" \
    --allowedTools 'Read,Write,Edit,Bash,WebFetch,WebSearch' \
    --output-format json > $research_dir/child_outputs/{}.json 2>&1"

# Or use background tasks
for task_id in $(cat "$research_dir/task_ids.txt"); do
    (
        timeout 600 claude -p "$(cat "$research_dir/prompts/$task_id.md")" \
            --allowedTools "Read,Write,Edit,Bash,WebFetch,WebSearch" \
            --output-format json \
            > "$research_dir/child_outputs/$task_id.json" 2>&1
    ) &

Technical Analysis

The GNU Parallel template substitutes {} directly into a shell command string without validating or safely passing the task identifier as an argument. If a task identifier contains shell metacharacters, command substitutions, redirection operators, whitespace, or quoting characters, those characters may alter the generated shell command.

The background-task alternative reads identifiers using for task_id in $(cat ...), which performs command substitution followed by shell word splitting and pathname expansion. The identifier is then embedded in prompt and output paths without validation or canonical containment checks. Values containing directory separators or traversal sequences such as ../ can consequently resolve outside the intended prompts/ or child_outputs/ directories.

This becomes exploitable when task identifiers are derived from user-controlled input or externally collected research data and are written to tasks.txt or task_ids.txt without strict normalization.

Attack Path

  1. An attacker supplies or influences a research subtarget that becomes a ta ...[truncated 1494 chars]
Remediation
View remediation

Remediation Suggestions

  1. Generate internal task identifiers rather than using raw user-provided labels. Enforce a strict allowlist such as ^[A-Za-z0-9_-]+$ and reject empty values, whitespace, path separators, traversal components, shell metacharacters, and control characters.

  2. Replace for task_id in $(cat ...) with a line-preserving reader:

    bash
    while IFS= read -r task_id; do
        # Validate task_id before use.
    done < "$research_dir/task_ids.txt"
    
  3. Move task execution into a fixed worker script and pass the identifier as a positional argument. Invoke that script through GNU Parallel without constructing a nested shell command from untrusted text.

  4. Quote every variable expansion, including "$max_parallel", and use -- where supported to prevent values from being interpreted as options.

  5. Resolve prompt and output paths to canonical absolute paths and verify that each remains beneath the canonical research directory before reading or writing.

  6. Create output files with restrictive permissions and refuse symbolic links or unexpected existing file types where supported.

  7. Add negative tests covering identifiers with spaces, newlines, ../, quotes, semicolons, command substitutions, redirection operators, wildcard characters, and leading hyphens.

  8. Retain least-privilege --allowedTools settings for each child task and remove Bash or network tools whenever the specific subtask does not require them.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
98% confidence
Finding

The skill is explicitly designed to invoke an external claude -p process, delegating work to another model/runtime outside the current agent boundary. This materially expands the trust boundary and can expose prompts, retrieved data, repository content, or derived outputs to an external provider or separately configured execution environment; in this skill, the risk is amplified by parallel fan-out and automated subprocess orchestration.

Content

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

bash
# 基本非交互调用
claude -p "Your prompt here"

# 指定允许的工具(无需人工确认)
claude -p "Your prompt" --allowedTools "Read,Write,Edit,Bash"

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
98% confidence
Finding

This command not only invokes an external claude -p subprocess but also grants it a tool set, including filesystem and shell capabilities. That combination increases risk because user data and workspace context may be transmitted to or acted on by a separately governed agent process, and the subprocess can then perform additional actions locally.

Content

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

md
claude -p "Your prompt here"

# 指定允许的工具(无需人工确认)
claude -p "Your prompt" --allowedTools "Read,Write,Edit,Bash"

# JSON 格式输出(便于脚本解析)
claude -p "Your prompt" --output-format json

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
97% confidence
Finding

Using JSON-formatted output does not reduce the core risk: the skill still sends work to an external model/process. Structured output can even make large-scale automation easier, allowing downstream scripts to consume external-model results programmatically across many tasks.

Content

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

md
claude -p "Your prompt" --allowedTools "Read,Write,Edit,Bash"

# JSON 格式输出(便于脚本解析)
claude -p "Your prompt" --output-format json

# 流式 JSON 输出
claude -p "Your prompt" --output-format stream-json

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
97% confidence
Finding

Streamed JSON output further facilitates automated orchestration of an external model subprocess and can accelerate high-volume processing. In the context of this skill's multi-agent design, that increases the scale at which sensitive context or fetched content could be propagated beyond the primary agent boundary.

Content

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

md
claude -p "Your prompt" --output-format json

# 流式 JSON 输出
claude -p "Your prompt" --output-format stream-json

# 继续上一次对话
claude -p "Follow up question" --continue

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
96% confidence
Finding

Continuation of an external model session can reuse prior context that may contain sensitive repository data, user requests, or prior research artifacts. This creates persistence risk because the skill may unintentionally rely on or expose historical context outside the current task's minimal-need scope.

Content

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

md
claude -p "Your prompt" --output-format stream-json

# 继续上一次对话
claude -p "Follow up question" --continue

# 继续指定会话
claude -p "Follow up" --resume <session_id>

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
97% confidence
Finding

Resuming a specified external session deepens the persistence and cross-task context risk, because the skill can bind new work to an existing conversation state not visible or reviewable in the current execution. In a research workflow that aggregates diverse sources and local files, this increases the chance of unintended data carryover and disclosure.

Content

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

claude -p "Follow up question" --continue

继续指定会话

claude -p "Follow up" --resume <session_id>

text

### 子进程调度模板

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger description is broad enough to match many ordinary research or writing requests, which can cause the skill to activate unexpectedly with powerful tools and a multi-process workflow. In this skill's context, accidental activation is more dangerous because it combines Bash, web access, MCP tools, and large-scale file creation, increasing the chance of unintended external requests or workspace modification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L016 要求子进程不与用户进行“等确认/等反馈”式互动,强调非交互执行;但 L020 又把“必须等待用户确认”设为整体流程必须遵守的关键约束。对于该技能作为多 agent 编排工作流的整体行为,这两段文档会给实现者传达互相冲突的操作意图:既要避免确认式交互,又要以确认作为进入后续步骤的前置条件。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

L020 明确声明在用户回复肯定词前“不得进入下一步”,将用户确认设为硬性前置条件。但后文的初始化、脚本生成、prompt 设计与并行执行流程被写成严格顺序的常规执行步骤,且示例命令直接展示可运行的子进程调用,容易导致实现者在未确认前继续推进执行准备甚至实际执行,和前述约束形成冲突。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs the agent to create extensive directory structures, logs, caches, prompts, and reports in the local workspace without clearly warning the user in the skill description that files will be written. This can lead to unauthorized or surprising modification of the user's project directory, especially when the skill is triggered implicitly or on sensitive repositories.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

L064 要求“用用户语言汇报”,L229 又以“例如要求中文则全程中文”规定语言一致性。虽然这不是明显的强制单一语言,但文档没有明确说明用户可主动选择其他语言或切换语言输出,存在轻微的语言策略不透明问题。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.