Back to skill

Security audit

Cron Delivery Fix

Security checks for vulnerabilities and agentic risk

Overview

The skill is meant to fix cron delivery problems, but its scripts can broadly overwrite scheduled delivery settings with hard-coded destinations and contain an input-handling flaw.

Install only if you understand and control the OpenClaw cron environment. Do not run fix-all.sh on production or multi-user cron jobs without first reviewing the exact destination values and making a backup; prefer manually scoped edits or patched scripts that take explicit channel, recipient, and account inputs.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/restore.sh:23
Finding

Arbitrary Python Code Execution Through Unsanitized Job ID

Content
View full analysis
/dev/null | python3 -c " import json, sys text = sys.stdin.read() start = text.index('{') data = json.loads(text[start:]) for job in data.get('jobs', data): if job['id'].startswith('$JOB_ID') or job['id'] == '$JOB_ID': print(f' name: {job.get(\"name\")}') print(f' session: {job.get(\"sessionTarget\")}') print(f' kind: {job.get(\"payload\",{}).get(\"kind\")}') d = job.get('delivery', {}) print(f' mode: {d.get(\"mode\")}') print(f' channel: {d.get(\"channel\")}') print(f' to: {d.get(\"to\")}') print(f' accountId: {d.get(\"accountId\")}') break " ``` ### Technical Analysis The first positional argument is assigned to `JOB_ID` and interpolated directly into the source code supplied to `python3 -c`: ```python if job['id'].startswith('$JOB_ID') or job['id'] == '$JOB_ID': ``` Shell quoting protects the later `openclaw cron edit "$JOB_ID"` invocation from ordinary shell argument injection, but it does not protect the generated Python program. A job ID containing quote characters and Python syntax can terminate the intended string literal and inject additional Python expressions or statements. The injected Python runs with the same operating-system identity and environment as the user executing `restore.sh`. No job-ID format validation, escaping, or argument-based transfer into Python is performed. ### Attack Path 1. An attacker supplies or recommends a maliciously crafted job ID to a user or automation agent. 2. The user invokes `restore.sh` with that value as its first argument. 3 ...[truncated 969 chars]
Remediation
View remediation
/dev/null | python3 -c ' import json import sys job_id = sys.argv[1] text = sys.stdin.read() start = text.index("{") data = json.loads(text[start:]) for job in data.get("jobs", data): if job.get("id") == job_id: print(f" name: {job.get('name')}") print(f" session: {job.get('sessionTarget')}") print(f" kind: {job.get('payload', {}).get('kind')}") delivery = job.get("delivery", {}) print(f" mode: {delivery.get('mode')}") print(f" channel: {delivery.get('channel')}") print(f" to: {delivery.get('to')}") print(f" accountId: {delivery.get('accountId')}") break ' "$JOB_ID" ``` Additional hardening should include: 1. Validate `JOB_ID` against the exact identifier syntax accepted by OpenClaw. 2. Use exact identifier equality rather than ambiguous prefix matching. 3. Reject empty, malformed, or multiple-match identifiers before making changes. 4. Prefer a standalone Python script or a structured JSON-processing tool over dynamically generated source. 5. Test the script with quotes, backslashes, newlines, and Python metacharacters to prevent regression. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fix-all.sh:15
Finding

Bulk Cron Repair Can Overwrite Valid Delivery Destinations With Hard-Coded Values

Content
View full analysis
&1) ``` The purported restore oper ...[truncated 2924 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims to diagnose and repair delivery issues but instead normalizes jobs to a single hard-coded delivery configuration can misroute messages, overwrite valid job-specific settings, or send to the wrong recipient/account. Because it changes notification targets and account context, the mismatch is security-relevant, not just a quality issue.

Content

No source excerpt is available for this finding.

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

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

Standard Template for Delivery Tasks

All cron jobs that need to send messages to users must have:

text
sessionTarget: isolated

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The comment states jobs with no mode should default to announce, but the implementation preserves mode='none' and applies --no-deliver. This mismatch can disable delivery for jobs the operator expects to be repaired, creating silent message loss and making incident response harder because the script claims to fix delivery failures while suppressing delivery instead.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill explicitly directs execution of shell scripts but does not declare any tool restrictions or permissions boundary. In a skill that modifies cron configuration, missing tool scope increases the chance of unintended shell access and makes review, enforcement, and least-privilege controls harder.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script hardcodes a recipient, channel, and account ID, then rewrites cron delivery settings to those values. That creates a direct risk of unauthorized redirection of scheduled outputs, data leakage to an attacker-controlled destination, and persistent exfiltration every time affected jobs run.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script enumerates all cron jobs and bulk-edits any job matching broad predicates, rather than limiting changes to explicitly selected failing delivery jobs. In an operational environment this can silently alter unrelated scheduled tasks, causing misdelivery, delivery suppression, or workflow breakage across the fleet.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This shell script executes openclaw cron edit to overwrite the job's session and delivery settings, which is a safety-relevant write operation. Although the script prints status messages, it does not prompt for confirmation before applying the change, and the header comments do not clearly warn that invoking it will immediately mutate the specified job.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script's comments, usage text, and user-facing status messages are all in Chinese, which imposes a specific language on users without any opt-in or explanation. The policy explicitly calls out language or locale constraints as violations unless the skill offers a choice or clearly justifies the restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains natural-language comments and CLI output exclusively in Chinese, including the usage/help text shown to users. Under the policy rule, forcing a specific language without offering a choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's natural-language comments, usage guidance, and status output are written in Chinese only. Under the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.