Back to skill

Security audit

自媒体内容创作大师

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent content-creation purpose, but its setup script has a real local command-injection risk and it makes persistent OpenClaw changes without strong consent or rollback guidance.

Install only after the setup script is fixed to avoid shell interpretation, especially around OPENCLAW_HOME. Users should also be told exactly which files and agents will be created, what brand information will be stored, and how to remove the workspaces and registered agents later.

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/setup.cjs:24
Finding

Shell Command Injection Through OPENCLAW_HOME

Content
View full analysis

Vulnerability Details

File Location: scripts/setup.cjs:14, 24-28, 67-72
Vulnerability Type: OS command injection caused by unsafe shell command construction
Risk Level: High

Vulnerable Code

The workspace root is derived from the externally controlled OPENCLAW_HOME environment variable:

js
const OPENCLAW_DIR = process.env.OPENCLAW_HOME || path.join(os.homedir(), '.openclaw');
const TEAM_DIR = path.join(OPENCLAW_DIR, TEAM_NAME);

Commands are converted into a single string and interpreted by a system shell:

js
function runCommand(args) {
  try {
    return { code: 0, output: execSync(args.join(' '), { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], shell: true }) };
  } catch (e) {
    return { code: e.status || 1, output: e.stderr || e.stdout || e.message };
  }
}

The attacker-influenced workspace path is manually placed inside double quotes and passed to the vulnerable command runner:

js
const { code, output } = runCommand([
  'openclaw', 'agents', 'add', agent.id,
  '--name', `"${agent.name}"`,
  '--workspace', `"${path.join(TEAM_DIR, agent.id)}"`,
  '--description', `"${agent.desc}"`,
]);

Technical Analysis

OPENCLAW_HOME is process-environment input and is not validated or safely escaped. Its value propagates through OPENCLAW_DIR, TEAM_DIR, and path.join() into the --workspace command argument.

runCommand() joins the argument array with spaces and invokes execSync() with shell: true. Consequently, the array does not provide argument-boundary protection: the resulting string is parsed by the operating-system shell.

Manually surrounding the workspace path with double quotes does not prevent shell injection. Shell command substitution constructs such as $(command) and backtick substitutions remain active inside double-quoted strings. An environment value containing such syntax can therefore cause an arbitrary command to e ...[truncated 1889 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace shell-based execution with an API that invokes a fixed executable and passes arguments separately. For example, use execFileSync() or spawnSync() with shell: false.
js
const { execFileSync } = require('child_process');

function runOpenClaw(args) {
  try {
    return {
      code: 0,
      output: execFileSync('openclaw', args, {
        encoding: 'utf-8',
        stdio: ['pipe', 'pipe', 'pipe'],
        shell: false,
      }),
    };
  } catch (e) {
    return {
      code: e.status || 1,
      output: e.stderr || e.stdout || e.message,
    };
  }
}
  1. Pass raw arguments without manually adding quotation marks:
js
runOpenClaw([
  'agents', 'add', agent.id,
  '--name', agent.name,
  '--workspace', path.join(TEAM_DIR, agent.id),
  '--description', agent.desc,
]);
  1. Apply the same non-shell execution pattern to every OpenClaw invocation, including version checks and agent listing.

  2. Validate OPENCLAW_HOME as a filesystem path. Reject null bytes and unexpected control characters, resolve it with path.resolve(), and optionally require it to fall under an explicitly permitted base directory. Validation should supplement, not replace, removal of shell interpretation.

  3. Do not attempt to fix the issue using ad hoc shell escaping. Correct argument separation with shell: false is the primary security control.

  4. Add regression tests using workspace paths containing spaces, quotes, dollar signs, backticks, semicolons, and command-substitution syntax. Verify that these values are treated only as literal path data and never interpreted by a shell.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill explicitly instructs executing local commands (which openclaw, openclaw agents list/add, mkdir) and modifying the local environment, but it declares no permissions or allowed-tools scope. This creates an authorization gap where the agent's real capabilities are broader than the manifest communicates, increasing the chance of unexpected command execution and reducing user visibility into risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs creation of directories under ~/.openclaw, copying templates, and writing USER.md files containing collected user data, but does so without an explicit safety warning or consent checkpoint before filesystem modification. This is dangerous because it causes persistent local changes and stores potentially sensitive business/profile information in the user's home directory without clear disclosure.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicate finding points to the same persistent workspace creation behavior: local directories under the user's home are created and later used by registered agents. While not overtly malicious, this persistence can retain sensitive brand strategy inputs and create durable execution context for future agent runs without a prominent warning.

Content

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

  1. 创建团队根目录:
    bash
    mkdir -p ~/.openclaw/workspace-content-creation
    
  2. 从 {baseDir}/templates/ 目录复制文件到 3 个子目录:
    text

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicate finding points to the same persistent workspace creation behavior: local directories under the user's home are created and later used by registered agents. While not overtly malicious, this persistence can retain sensitive brand strategy inputs and create durable execution context for future agent runs without a prominent warning.

Content

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

  1. 创建团队根目录:
    bash
    mkdir -p ~/.openclaw/workspace-content-creation
    
  2. 从 {baseDir}/templates/ 目录复制文件到 3 个子目录:
    text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The agent registration commands alter local OpenClaw configuration by adding persistent agents, yet the skill provides no explicit warning that it will change tool state beyond the current session. Persistent registration can surprise users, create long-lived configuration drift, and broaden future automation behavior without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The user-facing comments and console output are entirely in Chinese, including installation guidance and next-step instructions. This imposes a specific language/locale on users without offering a choice or documenting that the skill is intentionally limited to a Chinese-only regional context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says this skill is triggered with "/content-creation", but the script's completion instructions tell the user to use "/content-pipeline" to start content creation. This is an active contradiction in user-facing setup/documentation rather than a mere omission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file title and all operating instructions are written entirely in Chinese, and the skill provides no indication that users may choose another language or opt in to this locale. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file presents all bootstrap instructions and the assistant persona entirely in Chinese, with no indication that the user can choose another language. This can violate language/locale policy when a skill implicitly enforces a specific language without offering opt-in or alternatives.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains only Chinese headings and instructions, which can function as a language-specific constraint for users interacting with the skill. Under the policy, forcing a specific language without user opt-in or justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire skill definition is written as a Chinese-language persona and communication style, with no indication that users may choose another language or that the locale restriction is intentional for a region-specific use case. This can violate language/locale policy when a skill implicitly enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file title and all operational instructions are presented as a Chinese-only manual, with no indication that the skill can adapt to the user's preferred language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless a justified locale constraint is documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s natural-language content is entirely in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-language context. Under the policy rule for language or locale constraints, forcing a specific language without opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file presents all user-facing content exclusively in Chinese, and there is no natural-language indication that the user can choose another language or has opted into this locale. Under the policy category for language or locale constraints, this can be considered a forced language choice unless justified or optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file presents the skill name, role, and description exclusively in Chinese, which can amount to a language/locale policy issue when no user opt-in or alternative language support is indicated. The content does not document that the skill is region-specific or that users can choose their preferred language.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/setup.cjs:26