Back to skill

Security audit

Erp Skill Research

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent as an OCD ERP coaching aid, but its automation examples create review-worthy risks around scheduled tasks, unsafe shell command construction, and sensitive mental-health logs.

Review before installing. Use this only if you are comfortable with OpenClaw creating cron reminders, sending Feishu notifications, and saving sensitive ERP records locally. Prefer removing crons by exact IDs, avoid the bulk cleanup pipeline, and use a structured file-writing API rather than pasting generated report text into a shell command.

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:589
Finding
Shell Command Injection Through Unsafely Interpolated Session Report Content## Vulnerability Details **File Location**: `SKILL.md`, lines 589–593 **Vulnerability Type**: Shell command injection caused by unsafe interpolation of user-controlled content **Risk Level**: High ### Vulnerable Code ```bash **Automation command:** ```bash # Save session record to desktop openclaw file write --path ~/Desktop/ERP练习记录_$(date +%Y-%m-%d).md --content "[GENERATED_REPORT]" ``` ``` The nested Markdown fences above reflect the complete relevant segment as written in the skill document. The vulnerable command is: ```bash openclaw file write --path ~/Desktop/ERP练习记录_$(date +%Y-%m-%d).md --content "[GENERATED_REPORT]" ``` ### Technical Analysis The skill directs the agent to generate a report containing user-influenced values, including exposure descriptions, feared outcomes, observations, ritual notes, and retrieval cues. It then places the entire generated report into a double-quoted shell argument represented by `[GENERATED_REPORT]`. If the agent performs textual substitution and executes the resulting command through a shell, report content containing a double quote can terminate the intended argument. Shell metacharacters, command substitutions such as `$()`, or backticks may then be interpreted by the shell rather than passed literally to `openclaw file write`. Double quotes do not suppress command substitution in common shells. Consequently, merely replacing the placeholder while preserving the surrounding quotes is not a safe encoding strategy. This issue depends on the documented template being materialized into a shell command, but that is the explicit automation behavior prescribed by the skill. ### Attack Path 1. A user supplies a session value that will appear in the generated report, such as an exposure description, feared outcome, observation, or retrieval cue. 2. The supplied value contains shell syntax designed to terminate or alter the `--content` argument, or contains command substitu ...[truncated 1388 chars]
Remediation
## Remediation Suggestions 1. **Do not place generated report content directly into a shell command.** Use an OpenClaw file-writing tool or structured API that accepts the destination path and content as separate, non-shell parameters. 2. **Avoid shell evaluation entirely.** Generate the destination filename in application logic and invoke the file API directly rather than using `$(date ...)` and textual command construction. 3. **Use a standard-input interface if a command-line operation is unavoidable.** Pass report data through standard input to a program that does not reevaluate the content as shell syntax. Keep the shell command itself static. 4. **Do not rely on manual escaping.** Report content may contain quotes, dollar signs, backticks, newlines, Unicode characters, and other shell-sensitive data. Ad hoc replacement is error-prone. 5. **Use an argument-array execution API.** If OpenClaw must be invoked as a subprocess, provide each argument separately without `shell=true`, `sh -c`, or equivalent shell parsing. 6. **Constrain file destinations.** Resolve the output path to a dedicated ERP records directory, reject path traversal, and create files with restrictive permissions because the reports contain sensitive health information. 7. **Add adversarial tests.** Verify that report fields containing double quotes, single quotes, `$()`, backticks, semicolons, pipes, redirection operators, command-line options, and multiline text are written literally and never executed.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Anti-Refusal Statement

High
Category
Anti-Refusal
Content
- **Willingness** over endurance — we approach discomfort with openness, not gritted teeth
- **Values-driven exposure** — "Why am I doing this?" connects to what matters
- **Defusion** — "I'm having the thought that..." vs. "I will definitely..."
- **Present-moment awareness** — noticing without judging

---
Confidence
80% confidence
Finding
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
openclaw cron rm [CRON_JOB_ID]
# Remove all ERP-related crons:
openclaw cron ls | grep "ERP" | awk '{print $1}' | xargs -I {} openclaw cron rm {}
```

#### 4.2 Ending Criteria (Inhibitory Learning, NOT Habituation)
Confidence
85% confidence
Finding
The pipeline `openclaw cron ls | grep "ERP" | awk '{print $1}' | xargs -I {} openclaw cron rm {}` performs bulk deletion based on a broad name match. This can remove unintended cron jobs if unrelated tasks contain 'ERP' in their name, and chaining shell filters increases the risk of overbroad or unsafe destructive actions without confirmation.

Chaining Abuse

High
Category
Tool Misuse
Content
| **End-of-session reminder** | `openclaw cron add --name "ERP Session End" --in Xm --message "..." --session isolated --announce --channel feishu --to [ID]` |
| **List active crons** | `openclaw cron ls \| grep ERP` |
| **Remove specific cron** | `openclaw cron rm [ID]` |
| **Remove all ERP crons** | `openclaw cron ls \| grep ERP \| awk '{print $1}' \| xargs -I {} openclaw cron rm {}` |
| **Save session record** | `openclaw file write --path ~/Desktop/ERP练习记录_$(date +%Y-%m-%d).md --content "..."` |

### Session Logging Automation
Confidence
85% confidence
Finding
This reference repeats the same unsafe bulk-removal pattern in the command table, normalizing a destructive chained command that may delete unrelated cron entries matching 'ERP'. Because it is presented as a quick reference, users or agents may execute it without reviewing the scope, amplifying the chance of accidental task deletion.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The cron message template sent to the user is entirely in Chinese and the channel target is a user-facing Feishu notification, but the document does not state that the skill is only for Chinese-speaking users or provide an opt-in language selection. This creates a language/locale policy issue because the skill mandates a specific language for user-facing output rather than offering a choice.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The end-of-session reminder and the generated session record template are presented in Chinese as the default user-facing content, yet the skill does not offer a language choice or justify a China-specific deployment scope. Because these are direct outputs to the user, this is a natural-language locale policy violation rather than a stylistic preference.

Static analysis

No suspicious patterns detected.