Back to skill

Security audit

Huo15 Plan Mode

Security checks for vulnerabilities and agentic risk

Overview

The skill is meant to add confirmations for risky commands, but its helper script can run arbitrary shell commands without protection by default and it changes persistent OpenClaw workspace files.

Review this skill carefully before installing. Its goal is protective, but the integration script should not be sourced or used as a command wrapper unless it is changed to avoid eval, fail closed by default, and require confirmation for unknown or risky commands. Be aware that setup modifies HEARTBEAT.md and writes command logs under ~/.openclaw/workspace/memory/activity.

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
scripts/plan-mode-integration.sh:60
Finding

Arbitrary Shell Command Execution Through Unsafe eval and Fail-Open Filtering

Content
View full analysis

Vulnerability Details

File Location: scripts/plan-mode-integration.sh, lines 60–74
Vulnerability Type: Command injection through unsafe shell evaluation
Risk Level: High

Vulnerable Code

bash
plan_mode_exec() {
    local cmd="$1"
    
    # Plan Mode disabled
    [ "$PLAN_MODE_ENABLED" = "false" ] && {
        eval "$cmd"
        return $?
    }
    
    # Non-dangerous command, execute directly
    plan_mode_is_dangerous "$cmd" || {
        eval "$cmd"
        return $?
    }

The unsafe execution path is compounded by protection being disabled by default at lines 13–14:

bash
PLAN_MODE_ENABLED="${PLAN_MODE_ENABLED:-false}"
PLAN_MODE_STRICT="${PLAN_MODE_STRICT:-false}"

Technical Analysis

plan_mode_exec accepts an entire command as one string and passes it to eval. Unlike executing a fixed program with a quoted argument array, eval reparses the string as shell syntax. Shell substitutions, command separators, pipelines, redirections, variable expansion, and compound commands are therefore interpreted and executed.

The safety check does not provide a reliable security boundary. It uses a limited denylist of textual patterns, and all unmatched input is treated as safe. Semantically equivalent commands, alternate executable paths, unsupported destructive utilities, indirect expansion, or payloads embedded in otherwise benign-looking commands can evade these patterns.

The integration also initializes PLAN_MODE_ENABLED to false. Unless callers explicitly override that environment variable, every command supplied to the wrapper is evaluated without inspection or confirmation.

Attack Path

  1. An attacker influences task content, model-generated output, configuration, or another value that is ultimately passed as the first argument to plan_mode_exec.
  2. Plan Mode remains disabled by default, or the attacker constructs shell syntax that is not recog ...[truncated 995 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove eval entirely. Accept the executable and its arguments as an array, preserving argument boundaries:

    bash
    plan_mode_exec() {
        local risk
    
        if [ "$PLAN_MODE_ENABLED" != "true" ]; then
            printf '%s\n' 'Plan Mode must be explicitly enabled.' >&2
            return 1
        fi
    
        risk="$(plan_mode_classify "$@")" || return 1
    
        if [ "$risk" != "low" ]; then
            plan_mode_request_confirmation "$risk" "$@" || return 1
        fi
    
        command -- "$@"
    }
    

    Call it as:

    bash
    plan_mode_exec rm -rf -- /tmp/test
    

    Do not accept a preassembled shell program when only one command and its arguments are required.

  2. Default to fail-closed behavior. Unknown, malformed, or unclassifiable operations should be rejected or require confirmation rather than being automatically executed.

  3. Replace the textual denylist with a structured policy. Resolve and validate the executable separately from its arguments, define explicitly permitted operations, and classify unknown executables conservatively.

  4. If shell-language features such as pipelines are genuinely required, parse them with a dedicated policy-aware mechanism or place execution behind an isolated, least-privileged sandbox. Do not attempt to secure arbitrary shell programs using regular-expression matching.

  5. Require a cryptographically unpredictable confirmation identifier bound to the exact executable, arguments, requester, and expiration time. Execute only after validating an explicit approval for that immutable request.

  6. Run the integration under a dedicated low-privilege account with restricted filesystem and network access. Avoid exposing secrets in its environment.

  7. Add regression tests covering command substitution, separators, redirections, alternate executable paths, whitespace variations, indirect expansion, and unknown commands to verify that ...[truncated 29 chars]

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (39)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

text
⚠️ 危险操作检测

操作: rm -rf /tmp/test/*
文件数: 3 个
风险: 高

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
[[ "$cmd" =~ trash ]] && return 0
    [[ "$cmd" =~ kill[[:space:]] ]] && return 0
    [[ "$cmd" =~ pkill ]] && return 0
    [[ "$cmd" =~ "git push --force" ]] && return 0
    [[ "$cmd" =~ "git push -f" ]] && return 0
    [[ "$cmd" =~ shutdown ]] && return 0
    [[ "$cmd" =~ reboot ]] && return 0

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
[[ "$cmd" =~ trash ]] && return 0
    [[ "$cmd" =~ kill[[:space:]] ]] && return 0
    [[ "$cmd" =~ pkill ]] && return 0
    [[ "$cmd" =~ "git push --force" ]] && return 0
    [[ "$cmd" =~ "git push -f" ]] && return 0
    [[ "$cmd" =~ shutdown ]] && return 0
    [[ "$cmd" =~ reboot ]] && return 0

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
[[ "$cmd" =~ trash ]] && return 0
    [[ "$cmd" =~ kill[[:space:]] ]] && return 0
    [[ "$cmd" =~ pkill ]] && return 0
    [[ "$cmd" =~ "git push --force" ]] && return 0
    [[ "$cmd" =~ "git push -f" ]] && return 0
    [[ "$cmd" =~ shutdown ]] && return 0
    [[ "$cmd" =~ reboot ]] && return 0

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode-integration.sh (reported line 29)May include surrounding context.

sh
[[ "$cmd" =~ trash ]] && return 0
    [[ "$cmd" =~ kill[[:space:]] ]] && return 0
    [[ "$cmd" =~ pkill ]] && return 0
    [[ "$cmd" =~ "git push --force" ]] && return 0
    [[ "$cmd" =~ "git push -f" ]] && return 0
    [[ "$cmd" =~ shutdown ]] && return 0
    [[ "$cmd" =~ reboot ]] && return 0

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode-integration.sh (reported line 109)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 12)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 13)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 14)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 15)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode-integration.sh (reported line 109)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 12)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 13)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 14)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 15)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode-integration.sh (reported line 109)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 12)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 13)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 14)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/plan-mode.sh (reported line 15)May include surrounding context.

sh
#   4. 记录操作日志
#
# 使用方式:
#   ./plan-mode.sh check "rm -rf /tmp/test"
#   ./plan-mode.sh confirm "rm -rf /tmp/test"
#   ./plan-mode.sh execute "rm -rf /tmp/test"
#   ./plan-mode.sh is-dangerous "rm -rf /tmp/test"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill clearly describes shell-capable behavior through multiple scripts and command interception/execution logic, but it declares no explicit tool scope or permissions. That makes the operational boundary ambiguous and can lead an agent platform to grant broader shell access than reviewers or users expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The listed trigger phrases are broad and conversational, including generic terms like 'Plan Mode' and '二次确认', without defining context, namespace, or exclusion conditions. This can cause accidental activation or prompt-injection-style invocation in unrelated conversations, altering agent behavior unexpectedly around sensitive operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The confirmation flow appears to require replies of '是' or '否' only, with no language fallback or explicit normalization rules. In a multilingual environment this can cause confirmation failures, misinterpretation, or unsafe continuation/cancellation if the agent handles non-Chinese responses inconsistently.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

The autoConfirmLowRisk: true setting authorizes the system to execute a class of operations without user approval based on its own risk classification. If classification is incomplete or bypassed, the skill can autonomously perform actions such as network access or file reads in situations the user did not intend.

Content

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

json
{
  "mode": "strict",
  "autoConfirmLowRisk": true,
  "notifyOnCancel": true
}