Back to skill

Security audit

OpenClaw Agent Creator

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned, but it needs Review because it can persistently change OpenClaw/Feishu routing and can expose Feishu app secrets in command output or logs.

Install only if you are comfortable letting this skill modify OpenClaw's persistent Feishu routing configuration and restart the gateway. Before use, verify the exact agent_id, account_id, peer_id, and dmScope change, run a dry run where possible, avoid passing app secrets on the command line, redact command output/transcripts, protect backups, and schedule gateway restart for a safe window.

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

Warning
Location
scripts/upsert_openclaw_agent.py:155
Finding

Feishu Application Secret Exposure Through Process Arguments and JSON Output

Content
View full analysis
\ --routing-mode \ [--account-id ] \ [--app-id ] \ [--app-secret ] \ [--bot-name ] \ [--peer-kind ] \ [--peer-id ] ``` `scripts/upsert_openclaw_agent.py:155-167`: ```python before = copy.deepcopy(existing) if args.app_id: existing["appId"] = args.app_id if args.app_secret: existing["appSecret"] = args.app_secret if args.bot_name: existing["botName"] = args.bot_name summary["channelAccount"] = { "status": status, "accountId": args.account_id, "before": before, "after": copy.deepcopy(existing), } ``` `scripts/upsert_openclaw_agent.py:258`: ```python print(json.dumps(summary, indent=2, ensure_ascii=False)) ``` ### Technical Analysis The documented workflow passes `app_secret` as a command-line argument. Command-line secrets may be recorded in shell history, Agent transcripts, process-monitoring systems, audit logs, or process listings available to other local users while the command is running. The script then copies the complete account object into both the `before` and `after` summary fields. Because account objects can contain `appSecret`, line 258 serializes the credential to standard output. This leaks both newly supplied credentials and credentials that were already present in the OpenClaw configuration. Backups produced by the workflow legitimately retain the configuration secret, but the additional disclosure through process arguments and standard output unnecessarily expands the number of locations in which the secret may persist. ### Attack Path 1. A user supplies a Feishu ` ...[truncated 1236 chars]
Remediation
View remediation
` from command examples and provide a non-echoing input mechanism, such as Python's `getpass.getpass()`. 3. Never include complete account objects in status output. Report only non-sensitive metadata and changed field names, for example: ```python summary["channelAccount"] = { "status": status, "accountId": args.account_id, "changedFields": changed_fields, } ``` 4. Add recursive output redaction as a defense-in-depth measure. Keys such as `appSecret`, `secret`, `token`, `password`, and `authorization` should be replaced with a fixed value such as `"***REDACTED***"` before serialization. 5. Review existing shell history, Agent transcripts, CI output, and operational logs for leaked secrets. Rotate any Feishu application secret that may already have been exposed. 6. Preserve restrictive file permissions when writing the configuration and backups, and document secure deletion or retention requirements for obsolete backups. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:102
Finding

Shell Command Injection Risk from Unquoted User-Controlled Arguments

Content
View full analysis
--workspace --non-interactive ``` ```bash openclaw agents add --workspace --model --non-interactive ``` `SKILL.md:114-125`: ```bash python3 scripts/upsert_openclaw_agent.py \ --config ~/.openclaw/openclaw.json \ --agent-id \ --routing-mode \ [--account-id ] \ [--app-id ] \ [--app-secret ] \ [--bot-name ] \ [--peer-kind ] \ [--peer-id ] ``` ### Technical Analysis The Skill instructs the Agent to interpolate collected values into shell commands without quoting them or requiring execution through an argument-array API. Although the Python updater validates `agent_id`, other inputs—including `workspace`, `model`, `account_id`, `app_id`, `app_secret`, `bot_name`, and `peer_id`—are not constrained by the documented workflow to shell-safe character sets. If an Agent constructs a shell command literally from these templates, spaces, command substitutions, redirection operators, separators, or other shell metacharacters in a supplied value can change the command's structure. Quoting alone would reduce accidental token splitting, but the preferred control is to bypass shell parsing entirely. The Python script itself uses `argparse` and does not invoke a shell. The injection risk arises in the Skill's command-construction instructions executed before the script receives the arguments. ### Attack Path 1. An attacker supplies a required or optional field containing shell syntax, such as a malicious `workspace`, `model`, `bot_name`, `account_id`, or `peer_id`. 2. The Agent substitutes that value into one of the documented shell templates without robust quoting. 3. The Agent executes the resultin ...[truncated 1107 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
82% confidence
Finding

The description is partially accurate because the code does modify ~/.openclaw/openclaw.json, specifically Feishu channel accounts, bindings, and session.dmScope. However, it overstates the implemented behavior in material ways. The script never creates an OpenClaw agent object or workflow; it only associates an existing --agent-id with routing rules in config. It also does not execute any restart, verification, or other follow-up operational commands mentioned in the description. Therefore the declared purpose does not fully and accurately represent the actual code behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

The skill description explicitly states it will modify ~/.openclaw/openclaw.json, including channel accounts, bindings, and session.dmScope, and perform follow-up operational commands like gateway restart. Because this targets persistent local configuration and session-related scope, misuse or accidental invocation could permanently alter agent behavior, expand messaging reach, or disrupt service until manually corrected.

Content

Scanner excerpt · SKILL.json (reported line 3)May include surrounding context.

json
{
  "name": "openclaw-create-agent",
  "description": "Create and wire a new OpenClaw agent with a fixed workflow. Use when the user asks to create/add a new OpenClaw agent or says '我要创建一个新的 Agent', automate multi-agent setup for Feishu, modify ~/.openclaw/openclaw.json channel accounts, bindings, and session.dmScope, or run follow-up commands such as gateway restart and binding verification.",
  "version": "1.0.0",
  "license": "MIT",
  "author": "devops"

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description uses broad activation cues such as 'Use when the user asks to create/add a new OpenClaw agent' and includes multiple operational intents in one sentence. This can cause the skill to be invoked in situations beyond the user's precise intent, increasing the chance of unintended configuration changes, restarts, or account binding actions on sensitive local agent infrastructure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs file reads and writes against a sensitive user config (~/.openclaw/openclaw.json) but does not declare any explicit tool scope or permission boundaries. Missing tool restrictions increases the chance that an agent invoking this skill can perform broader filesystem actions than the user expects, especially since the workflow includes backup creation and config mutation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill explicitly modifies persistent routing state in ~/.openclaw/openclaw.json, including bindings and session.dmScope, which can alter how future conversations are routed across accounts or peers. Persistent session/routing changes are security-relevant because a mistaken or malicious configuration can redirect messages, expand access scope, or create long-lived cross-session effects beyond the immediate task.

Content

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

md
---
name: openclaw-create-agent
description: Create and wire a new OpenClaw agent with a fixed workflow. Use when the user asks to create/add a new OpenClaw agent or says “我要创建一个新的 Agent”, automate multi-agent setup for Feishu, modify ~/.openclaw/openclaw.json channel accounts, bindings, and session.dmScope, or run follow-up commands such as gateway restart and binding verification.
---

# OpenClaw Create Agent

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The workflow includes creating runtime state, updating bindings, enforcing dmScope, and restarting services, all of which have persistent effects on future agent behavior. Because these changes survive the current interaction, any mistake in agent_id, peer/account mapping, or scope setting can cause durable misrouting, cross-tenant confusion, or unintended message access.

Content

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

md
1. Align scenario (new bot per agent or multi-group per agent).
2. For multi-group scenarios, run guided gates in Step 0.5.
3. Read current config and backup.
4. Create agent runtime with OpenClaw CLI.
5. Upsert config for channel account, binding, and `dmScope`.
6. Restart gateway and verify.
7. Return a concise change summary.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs the operator to back up and modify a configuration file that may contain sensitive identifiers or secrets, including app_secret, without warning about credential exposure, secret handling, or the consequences of persistent config changes. This can lead to accidental disclosure through shell history, logs, backups, or unsafe file permissions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Restarting the OpenClaw gateway can interrupt active message handling or agent workflows, but the skill provides no warning or confirmation step before doing so. In production or shared environments, an unexpected restart can cause avoidable downtime or message processing gaps.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest includes a specific Chinese trigger phrase, but does not say that language selection is optional or that the skill is intended for a Chinese-language or region-specific environment. This can be a natural-language policy issue because it bakes in a locale-specific activation example without documenting user opt-in or justified locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The description embeds a Chinese trigger phrase and later sections prescribe Chinese prompts and confirmations, but the file does not state that language selection is optional or user-driven. This can violate language/locale policy where skills should not force a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Step 0 and Step 0.5 require the agent to ask and wait for confirmations using Chinese phrases such as 已创建群 and 已发送. Because no alternative language path or opt-in is provided, the skill appears to impose a specific language for interaction.

Content

No source excerpt is available for this finding.