Back to skill

Security audit

Coding Cli Management

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent coding-delegation purpose, but it needs Review because it can run worker-provided prompts through coding CLIs with approval bypasses and persist or upload sensitive task data.

Install only in a contained task runner with trusted Workers, task-scoped CLI credentials, workspace-only filesystem access, restricted network access, reviewed diffs before MinIO sync, and clear retention and redaction rules for prompts and logs. Do not use it on sensitive repositories until the approval-bypass flags and heredoc prompt-saving pattern are fixed.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/run-coding-cli.sh:49
Finding

Worker-Controlled Prompts Are Executed with CLI Safety Controls Disabled

Content
View full analysis
&1 | tee "$log_file" exit_code=${PIPESTATUS[0]} ;; gemini) timeout "$timeout_secs" gemini -p "$(cat "$prompt_file")" -y 2>&1 | tee "$log_file" exit_code=${PIPESTATUS[0]} ;; qodercli) timeout "$timeout_secs" qodercli -p "$(cat "$prompt_file")" \ --yolo -w "$workspace" 2>&1 | tee "$log_file" exit_code=${PIPESTATUS[0]} ;; ``` ### Technical Analysis The wrapper passes prompt-file contents to authenticated coding agents while explicitly enabling non-interactive approval or permission-bypass modes: - Claude is invoked with `--dangerously-skip-permissions`. - Gemini is invoked with `-y`. - Qoder CLI is invoked with `--yolo`. According to the documented workflow, the prompt originates from a Worker message. The wrapper only verifies that the prompt file and workspace exist. It does not authenticate the prompt origin, inspect requested operations, isolate the CLI in a sandbox, restrict network access, or constrain filesystem access to the designated workspace. Although the prompt is passed as one quoted command-line argument and therefore does not directly create shell metacharacter injection in this script, it is interpreted as instructions by an autonomous coding agent. Because the agent's confirmation and permission protections are disabled, malicious prompt instructions can cause the CLI to invoke tools, run commands, read accessible files, or modify content without an intervening approval step. A timeout limits execution duration but does not restrict which resources the CLI can access during that ...[truncated 1605 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:102
Finding

Fixed Heredoc Delimiter Enables Shell Injection During Prompt-File Construction

Content
View full analysis
"$prompt_file" << 'PROMPT_EOF' {extracted prompt content} PROMPT_EOF ``` ### Technical Analysis The documented procedure instructs the Manager to insert extracted, Worker-controlled prompt content directly into shell source between fixed heredoc delimiters. Quoting the opening delimiter as `'PROMPT_EOF'` prevents parameter expansion, command substitution, and backslash processing within ordinary heredoc content. It does not prevent an input line exactly equal to `PROMPT_EOF` from terminating the heredoc. An attacker can therefore include the fixed delimiter in the supplied prompt, followed by arbitrary shell syntax. If the Manager constructs and executes the documented block through textual substitution, the injected line closes the heredoc and subsequent attacker-controlled lines are parsed as shell commands. For example, the structural form of a malicious prompt could be: ```text Normal coding instructions PROMPT_EOF attacker_controlled_command # Remaining text ``` The vulnerability arises before `run-coding-cli.sh` is invoked, so the wrapper's quoting and CLI allowlist do not mitigate it. ### Attack Path 1. A malicious or compromised Worker sends a `coding-request:` with a prompt containing a line exactly equal to `PROMPT_EOF`. 2. The prompt places attacker-controlled shell commands immediately after that line. 3. The Manager follows the documented procedure and substitutes the extracted prompt into the shell block. 4. The injected delimiter terminates the intended heredoc early. 5. The shell interprets the following prompt lines as commands rather ...[truncated 1324 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Prompt Exfiltration via Tool

High
Category
System Prompt Leakage
Confidence
97% confidence
Finding

The skill writes extracted prompt content to disk and then submits it to a selected coding CLI, which may be backed by an external service. Because the prompt originates from workers and can include confidential repository content, secrets, or sensitive task data, this creates a realistic prompt-exfiltration path through both local persistence and third-party tool transmission.

Content

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

md
# 3. Create processing marker
bash /opt/hiclaw/agent/skills/task-coordination/scripts/create-processing-marker.sh "$task_id" "manager" 15

# 4. Save prompt to file
timestamp=$(date +%Y%m%d-%H%M%S)
prompt_dir="/root/hiclaw-fs/shared/tasks/${task_id}/coding-prompts"
mkdir -p "$prompt_dir"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown skill describes executing coding CLIs in a worker workspace on the user's behalf, which implies shell execution and code/file modification. While later steps show admin enablement for delegation mode, the document does not clearly warn that the skill will write prompts/configs, modify workspace contents, and sync changes to remote storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill persists full worker-generated prompts to disk under a shared task path and then feeds them to an external AI CLI. Prompts can contain secrets, proprietary code context, credentials, or other sensitive instructions, so storing them unredacted increases exposure and creates a durable exfiltration path if the CLI transmits content off-host or if other processes can read the files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The success notification template is written only in Chinese, and the failure/admin templates later in the document are also Chinese-only. This is a natural-language locale constraint in the skill instructions, but the document does not state that Chinese is required nor offer user-language selection except for the separate admin enablement prompt.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Both the worker failure notice and the human admin escalation text are specified in Chinese. Because the skill does not provide language choice for these messages or justify a locale-specific policy, this appears to violate the language/locale policy constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The template that must be appended to spec.md is entirely in Chinese, which forces a specific language into downstream task documentation. The skill does not offer an alternative language or explain why the template must be Chinese.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script presents itself as a generic wrapper for coding CLIs, but for supported tools it explicitly disables or suppresses safety controls using flags such as --dangerously-skip-permissions, -y, and --yolo. Because the prompt file is fully injected into the agent and the script changes into the target workspace before execution, any malicious or unsafe prompt can drive the agent to perform destructive file or command actions without interactive approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The execution paths for claude, gemini, and qodercli all run in non-interactive approval-bypassing modes, but the user only receives routine logging rather than a clear consent gate or warning. In a skill context where prompts and workspaces may be influenced by untrusted inputs, this materially increases the chance of silent destructive actions, data exfiltration, or unsafe code changes being performed automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The admin notification template includes last log lines and references to credential locations such as ~/.{cli}/. Even if operationally useful, the markdown should warn that logs and diagnostic messages may contain sensitive information and should be shared minimally.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.