Back to skill

Security audit

corn-manager-master

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a cron-reminder helper, but it asks the agent to create persistent outbound scheduled messages and retain operation details in memory without enough scoping or consent.

Review before installing. Use this only if you are comfortable with it creating persistent OpenClaw scheduled messages, and require the agent to show the exact schedule, message, channel, and recipient before creation. Avoid writing raw task names, message contents, channel IDs, or user IDs into agent memory or MEMORY.md; use a bounded structured log instead.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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 (2)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:121
Finding

Untrusted Cron Data May Be Written to Persistent Agent Memory

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:121; related guidance at references/cron-examples.md:95
Vulnerability Type: Persistent storage of potentially attacker-controlled operational content
Risk Level: Medium

Vulnerable Code Snippet

SKILL.md:121:

markdown
3. **日志记录**:将所有的检查结果、操作记录或异常情况记入系统的 `memory` 或日志文件中以便复盘

English translation:

text
Record all inspection results, operation records, or exceptions in system memory or log files for later review.

references/cron-examples.md:95:

markdown
4. **日志记录**:重要任务的创建和执行记录到MEMORY.md中

English translation:

text
Record the creation and execution of important tasks in MEMORY.md.

Technical Analysis

The Skill directs the Agent to persist cron operation details in system memory or MEMORY.md. Such records may contain user-controlled task names, reminder messages, recipient identifiers, errors, or other contextual content.

Agent memory is not an appropriate general-purpose audit log. Unlike a structured log, persistent memory may be loaded into future Agent sessions and influence later model behavior. The instructions provide no requirements for:

  • Separating untrusted content from trusted instructions.
  • Redacting recipient identifiers or sensitive message content.
  • Obtaining user consent before persistence.
  • Applying retention or deletion policies.
  • Preventing stored content from being interpreted as future instructions.

This creates a conditional memory-poisoning path if attacker-controlled text is copied into persistent Agent state. The issue does not itself prove that arbitrary rules are currently written, but the documented workflow enables that outcome when operational values are persisted without filtering.

Attack Path

  1. An attacker or untrusted user requests a cron job with crafted text in its name, message, or associated operational context.
  2. The Skill creates or attemp ...[truncated 1093 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the instruction to write operational records into Agent memory or MEMORY.md.
  2. Use a dedicated, structured audit log that is not loaded as Agent instructions.
  3. Store only the minimum necessary metadata, such as an opaque task ID, timestamp, outcome, and normalized error code.
  4. Redact reminder messages, user identifiers, channel identifiers, credentials, tokens, and other sensitive fields.
  5. Treat all logged values as untrusted data and encode them in a structured format such as JSON.
  6. Apply restrictive file permissions, bounded retention, log rotation, and deletion procedures.
  7. Require explicit user consent before retaining message or recipient information.
  8. Ensure future Agent prompts never interpret audit-log content as executable instructions.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/validate-cron.sh:19
Finding

Regex-Based Cron Lookup and Unconditional Success Produce False Validation Results

Content
View full analysis

Vulnerability Details

File Location: scripts/validate-cron.sh:19-85
Vulnerability Type: Insecure JSON validation and failure-handling logic
Risk Level: Medium

Vulnerable Code Snippet

bash
TASK_INFO=$(openclaw cron list --json | grep -B 5 -A 20 "$TASK_NAME" || true)

if [[ -z "$TASK_INFO" ]]; then
    echo "❌ 错误: 未找到任务 '$TASK_NAME'"
    exit 1
fi

echo "✅ 任务存在"
echo ""

# 提取任务信息
echo "2. 任务配置详情:"
echo "$TASK_INFO"
echo ""

# 检查关键参数
echo "3. 关键参数检查:"

# 检查 session isolated
if echo "$TASK_INFO" | grep -q '"sessionTarget": "isolated"'; then
    echo "✅ sessionTarget: isolated (符合规范)"
else
    echo "❌ sessionTarget: 不是 isolated (不符合规范)"
fi

# 检查 announce 模式
if echo "$TASK_INFO" | grep -q '"mode": "announce"'; then
    echo "✅ delivery.mode: announce (符合规范)"
else
    echo "❌ delivery.mode: 不是 announce (不符合规范)"
fi

# 检查 channel
if echo "$TASK_INFO" | grep -q '"channel":'; then
    CHANNEL=$(echo "$TASK_INFO" | grep '"channel":' | head -1 | sed 's/.*"channel": *"\([^"]*\)".*/\1/')
    echo "✅ channel: $CHANNEL (已配置)"
else
    echo "❌ channel: 未配置"
fi

# 检查 to (用户ID)
if echo "$TASK_INFO" | grep -q '"to":'; then
    TO_USER=$(echo "$TASK_INFO" | grep '"to":' | head -1 | sed 's/.*"to": *"\([^"]*\)".*/\1/')
    echo "✅ to: $TO_USER (已配置)"
else
    echo "❌ to: 未配置"
fi

# 检查时间配置
if echo "$TASK_INFO" | grep -q '"at":'; then
    AT_TIME=$(echo "$TASK_INFO" | grep '"at":' | head -1 | sed 's/.*"at": *"\([^"]*\)".*/\1/')
    echo "✅ at: $AT_TIME (一次性任务)"
elif echo "$TASK_INFO" | grep -q '"cron":'; then
    CRON_EXPR=$(echo "$TASK_INFO" | grep '"cron":' | head -1 | sed 's/.*"cron": *"\([^"]*\)".*/\1/')
    echo "✅ cron: $CRON_EXPR (周期性任务)"
else
    echo "❌ 时间配置: 未找到 at 或 cron 配置"
fi

echo ""
echo "========================================"
echo "✅ 验证完成: 任务 '$TASK_NAME' 配置基本正确"
echo ""
echo "📋 规范检查结果:"
echo "  1. ✅ 任务存在性检查"
echo "  2. ✅ 
...[truncated 3093 chars]
Remediation
View remediation

Remediation Suggestions

  1. Parse the JSON with jq instead of searching serialized JSON with grep:

    bash
    if ! CRON_JSON=$(openclaw cron list --json); then
        echo "Unable to retrieve cron tasks" >&2
        exit 1
    fi
    
    if ! TASK_INFO=$(printf '%s\n' "$CRON_JSON" |
        jq -ce --arg name "$TASK_NAME" '[.[] | select(.name == $name)] |
            if length == 1 then .[0]
            else error("Expected exactly one matching task")
            end'); then
        echo "Task lookup failed or was ambiguous" >&2
        exit 1
    fi
    
  2. Compare task names as exact strings and require exactly one matching object.

  3. Validate all required properties against expected values, including sessionTarget, delivery mode, channel, and recipient.

  4. Validate ISO 8601 timestamps and cron expressions with an appropriate parser rather than checking only for field presence.

  5. Maintain a failure flag or terminate immediately when any required check fails.

  6. Return a nonzero exit status for retrieval errors, missing tasks, ambiguous matches, invalid fields, or invalid schedules.

  7. Print the overall success message only after every check succeeds.

  8. If grep remains anywhere in the implementation, use fixed-string matching and an option delimiter, such as grep -F -- "$TASK_NAME", although structured JSON parsing remains the preferred solution.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

代码的核心能力确实与“创建 OpenClaw 定时任务”相关,因此总体领域一致;但描述中的两个关键点与实现不符。第一,描述强调“自动提取当前对话上下文”,而代码中 CHANNEL="feishu" 和 USER_ID="ou_xxxxxx" 明确是占位默认值,注释还写着 TODO: 需要从会话上下文自动获取,说明该能力尚未实现。第二,描述称“创建和检查”定时任务,但脚本仅调用 openclaw cron add 进行创建,最后只是打印一条建议用户手动运行的 openclaw cron list 验证命令,并没有执行检查逻辑。因此该描述对实际行为有实质性夸大,构成不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明强调“创建通用技能”“自动提取当前对话上下文”“标准化创建和检查 OpenClaw 定时任务”。但提供的代码仅是 validate-cron.sh,功能集中在按任务名查找已存在的 cron 任务并校验若干配置项。它没有创建任务的逻辑,没有从对话上下文提取信息的逻辑,也没有展示一个同时覆盖创建与检查的完整技能实现。虽然“检查 OpenClaw 定时任务”这一部分与代码部分吻合,但其主要能力与声明中的创建能力明显不一致,因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill instructs automatic extraction of current session channel and user ID without an explicit user-facing warning or confirmation step. In this context, that can cause scheduled messages to be created against an inferred recipient using session-derived identifiers, increasing the risk of privacy leakage, misdelivery, or user-surprising actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The command templates include --announce, --channel, and --to, which means the resulting scheduled task will actively send messages to the inferred recipient. Without an explicit warning, users may not realize the skill is setting up future outbound communications, which can lead to accidental spam, disclosure to the wrong recipient, or unauthorized-looking notifications.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The instruction to record all checks and operation logs into memory or log files can capture session-sensitive data such as channel, user IDs, message contents, schedules, and failure details by default. In a cron-management skill, this creates a realistic risk of unnecessary retention of personal or operational data, which could later be exposed through logs, debugging, or memory reuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire skill reference is written in Chinese and does not indicate that language selection is optional or that the document is intended only for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This shell script contains natural-language comments and user-facing messages in Chinese, and all runtime prompts/errors are presented only in that language. That creates a language-policy issue because the skill forces a specific language without offering the user any locale selection or documented opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's operational output, including errors, status messages, and completion text, is entirely hard-coded in Chinese. Per the policy criteria, forcing a specific language in natural-language strings without offering a choice is a reportable violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

All user-facing comments and console messages in the script are written in Chinese, including usage, errors, status output, and recommendations. For a general shell utility, this imposes a specific language on users without opt-in or any documented region-specific justification, matching the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The header comment states the script '自动从当前会话中提取 channel 和 user_id', implying context-driven extraction. In reality, CHANNEL and USER_ID are initialized to fixed placeholder values and may only be changed through explicit --channel/--to arguments, which contradicts the documented behavior.

Content

No source excerpt is available for this finding.