Back to skill

Security audit

OpenClaw Cursor Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill's main purpose is coherent, but it exposes powerful Cursor/tmux control without enough authorization or scoping and includes unsafe setup instructions.

Review before installing. Use only in a trusted, isolated OpenClaw environment; remove the personal backup restore instructions, avoid curl-to-shell installers, require authentication for /cursor, restrict allowed project roots, remove default --trust/--force behavior, and fix shell escaping before using it with valuable repositories or credentials.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
docs/LOCAL_SETUP_GUIDE.md:43
Finding
Setup documentation executes mutable remote installation scripts<![CDATA[ ## Vulnerability Details **File Location**: `docs/LOCAL_SETUP_GUIDE.md:43-45, 60-66, 78-85, 199-201`; `docs/archive/WSL最终落地方案.md:74-81` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash # docs/LOCAL_SETUP_GUIDE.md:43-45 # Install Homebrew if it is not installed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ```bash # docs/LOCAL_SETUP_GUIDE.md:60-66 # Update the system sudo apt update && sudo apt upgrade -y # Install Node.js 22 curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs ``` ```bash # docs/LOCAL_SETUP_GUIDE.md:78-85 sudo apt update sudo apt install -y curl # Install Node.js 22 curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs ffmpeg ``` ```bash # docs/LOCAL_SETUP_GUIDE.md:199-201 curl -fsSL https://tailscale.com/install.sh | sh sudo tailscale up ``` ```bash # docs/archive/WSL最终落地方案.md:74-81 ## Phase 4: Install Cursor CLI inside WSL curl https://cursor.com/install -fsS | bash agent --version ``` ### Technical Analysis These commands send mutable network responses directly to a shell. The NodeSource variant executes the downloaded content through `sudo`, giving the remote script root privileges. The instructions do not pin an immutable release, verify a vendor signature, compare against a digest stored independently in this repository, or offer an inspection step before execution. Homebrew, NodeSource, Tailscale, and Cursor are relevant dependencies or vendors, but source-domain reputation does not remove the underlying time-of-check/time-of-use and supply-chain risk. The effective code executed by users can change after this project has been reviewed. The use of remote installers is not inherently required to manage `tmux`-backed Cursor tasks. The minimum necessary setup can instead use signed operating-system packages or separately downl ...[truncated 964 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace every `curl | bash` or command-substitution installer with a staged process: - Download a version-pinned artifact to a local file. - Obtain its expected digest or signature from an independent, authenticated source. - Verify the digest or signature locally. - Inspect the script before execution. - Run it without elevated privileges unless elevation is strictly necessary. 2. Prefer signed operating-system package repositories and package-manager installation procedures. 3. Pin installer versions or immutable commit identifiers instead of mutable `HEAD` or generic installer URLs. 4. Store expected checksums in this reviewed repository rather than downloading both the artifact and checksum from the same mutable source. 5. Explain which commands require elevation and avoid executing complete remote setup scripts as root. 6. Move the archived `curl | bash` instruction out of active documentation or mark it as unsafe legacy guidance. ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
docs/LOCAL_SETUP_GUIDE.md:112
Finding
Unrelated personal backup restores executable extensions, agent state, and scheduled-task configuration<![CDATA[ ## Vulnerability Details **File Location**: `docs/LOCAL_SETUP_GUIDE.md:112-160` **Vulnerability Type**: Untrusted state restoration and persistent configuration poisoning **Risk Level**: Critical ### Vulnerable Code ```bash # Create the download directory mkdir -p ~/Downloads/xiaoxia-backup cd ~/Downloads/xiaoxia-backup # Download the backup package curl -L -o xiaoxia-full-backup.tar.gz \ https://github.com/zhangzeyu99-web/xiaoxia-memory/releases/download/backup-20260318-full/xiaoxia-full-backup-20260318_112254.tar.gz # Download the checksum file curl -L -o xiaoxia-full-backup.tar.gz.sha256 \ https://github.com/zhangzeyu99-web/xiaoxia-memory/releases/download/backup-20260318-full/xiaoxia-full-backup-20260318_112254.tar.gz.sha256 # Verify file integrity sha256sum -c xiaoxia-full-backup.tar.gz.sha256 # Extract tar xzvf xiaoxia-full-backup.tar.gz # Enter the extracted directory cd xiaoxia-full-backup-20260318_112254 # Ensure the OpenClaw directory exists mkdir -p ~/.openclaw # Run the restoration script ./restore.sh ``` The same section states that the script copies the following into `~/.openclaw/`: ```text openclaw.json workspace/ agents/ extensions/ autoskill/ sessions/ cron.json nodes/ ``` ### Technical Analysis The documentation directs users to retrieve a large backup from a personal GitHub account and execute an included `restore.sh` that is not part of this audited repository. The backup is unrelated to the Skill's declared function of managing Cursor CLI jobs in `tmux`. The downloaded archive can contain executable OpenClaw extensions, agent definitions, auto-loaded skills, persistent session state, node configuration, and `cron.json`. Restoring those files can alter future agent behavior and introduce scheduled actions that survive the current setup operation. Downloading the SHA-256 file from the same GitHub release does not authenticate the archive against a trusted value. An attacker who controls or compromises the release ...[truncated 1281 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the personal backup download and restoration instructions from this project. 2. Do not distribute prepopulated `agents`, `extensions`, `autoskill`, `sessions`, `nodes`, or `cron.json` as general installation data. 3. If migration is genuinely required: - Include a minimal migration utility in the audited repository. - Restrict migration to an explicit allowlist of non-executable configuration files. - Exclude credentials, sessions, executable extensions, skills, and scheduled-task definitions. - Present a manifest and request confirmation before replacing each category. - Back up the existing `~/.openclaw` directory before making changes. 4. Publish migration artifacts through an organization-controlled release process with signed provenance. 5. Pin an immutable artifact and keep its expected digest or signature in a separately controlled, reviewed source. 6. Require inspection of extracted files and the restoration script before execution. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
cursor-agent-system/scripts/spawn-cursor.sh:255
Finding
User-controlled values are interpolated into an executable runner script without shell escaping<![CDATA[ ## Vulnerability Details **File Location**: `cursor-agent-system/scripts/spawn-cursor.sh:255-281` **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```bash cat > "${RUNNER_FILE}" <<EOF #!/usr/bin/env bash set -euo pipefail if [ -f ~/.bashrc ]; then . ~/.bashrc; fi export OPENCLAW_TASK_ID='${TASK_ID}' export OPENCLAW_SESSION_NAME='${SESSION_NAME}' export OPENCLAW_PRIORITY='${PRIORITY}' export OPENCLAW_ESTIMATED_DURATION='${ETA}' export PYTHONIOENCODING='utf-8' export PYTHONUTF8='1' export LANG='C.UTF-8' export LC_ALL='C.UTF-8' export OPENCLAW_WORKSPACE_PATH='${WORKSPACE_PATH}' PROMPT_FILE='${TASK_FILE}' PROMPT_CONTENT="\$(cat "\${PROMPT_FILE}")" printf '\\n[openclaw] 使用任务文件: %s\\n' "\${PROMPT_FILE}" set +e '${AGENT_BIN}' --trust --force --print --output-format stream-json --stream-partial-output --workspace "\${OPENCLAW_WORKSPACE_PATH}" "\${PROMPT_CONTENT}" AGENT_EXIT_CODE="\$?" set -e printf '[openclaw] agent_exit_code=%s\\n' "\${AGENT_EXIT_CODE}" exit "\${AGENT_EXIT_CODE}" EOF chmod +x "${RUNNER_FILE}" ``` The plugin forwards the relevant values from tool input: ```js const args = [ String(params.taskName), String(params.taskDescription), config.executionMode === "wsl" ? toWslPath(projectPath) : projectPath, "--json", ]; if (params.priority) { args.push("--priority", String(params.priority)); } if (params.eta) { args.push("--eta", String(params.eta)); } ``` ### Technical Analysis `PRIORITY`, `ETA`, and `WORKSPACE_PATH` can originate from tool arguments or configuration. They are inserted into generated Bash source between literal single quotes, but embedded single quotes are not escaped. Shell quoting in the plugin's child-process argument array protects the initial script invocation only; it does not protect the second-stage runner generated by `spawn-cursor.sh`. An attacker can supply a value containing a single quote followed by shell syntax. When the generated runner is later executed, ...[truncated 1299 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Avoid generating executable shell source from user-controlled values. 2. Pass runtime values through a structured environment object or positional arguments from the process-launching code. 3. If runner generation is unavoidable, serialize every interpolated value with a proven shell-escaping mechanism such as Bash `printf '%q'`. 4. Validate `priority` against a strict enum such as `low`, `normal`, and `high`. 5. Apply length and character restrictions to `eta`, task names, session queries, and paths where practical. 6. Generate the runner from a fixed static script and store task metadata in a JSON file parsed as data rather than executable code. 7. Add security regression tests using values containing single quotes, semicolons, command substitutions, newlines, and shell metacharacters. 8. Create runtime files with restrictive permissions and avoid making generated scripts executable when they can instead be invoked explicitly with Bash. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
extensions/openclaw-cursor-agent/index.js:610
Finding
Unauthenticated command interface can control trusted Cursor coding sessions<![CDATA[ ## Vulnerability Details **File Location**: `extensions/openclaw-cursor-agent/index.js:610-675`; `cursor-agent-system/scripts/spawn-cursor.sh:271-290` **Vulnerability Type**: Missing authorization on a privileged command surface **Risk Level**: Critical ### Vulnerable Code ```js function registerCommands(api, config) { api.registerCommand({ name: "cursor", description: "管理 OpenClaw Cursor Agent 后台任务(doctor/list/status/send/kill/spawn)", acceptsArgs: true, requireAuth: false, async handler(ctx) { const raw = asString(ctx.args || "").trim(); // ... if (subcommand === "send") { const [sessionQuery, ...commandParts] = rest; const result = await handleSendTool(config, { sessionQuery, command: commandParts.join(" "), }); return { text: result.content[0].text }; } if (subcommand === "kill") { const force = rest.includes("--force"); const sessionQuery = rest.filter((item) => item !== "--force")[0]; const result = await handleKillTool(config, { sessionQuery, force, purge: false, }); return { text: result.content[0].text }; } if (subcommand === "spawn") { const parts = tail.split("||").map((item) => item.trim()).filter(Boolean); if (parts.length < 2) { return { text: "spawn 用法: /cursor spawn <任务名> || <任务描述> || [项目路径]" }; } const [taskName, taskDescription, projectPath] = parts; const result = await handleSpawnTool(config, { taskName, taskDescription, projectPath }); return { text: result.content[0].text }; } }, }); } ``` Spawned sessions invoke Cursor with elevated trust settings: ```bash PROMPT_CONTENT="$(cat "${PROMPT_FILE}")" '${AGENT_BIN}' --trust --force --print \ --output-format stream-json \ --stream-partial-output \ --workspace "${OPENCLAW_WORKSPACE_P ...[truncated 2241 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Set `requireAuth: true` for the `/cursor` command. 2. Enforce authorization separately for spawn, status, send, kill, and purge operations. 3. Bind each task and `tmux` session to an authenticated owner and reject access from other users. 4. Restrict project paths to administrator-configured workspace roots after canonicalization and symlink resolution. 5. Require explicit confirmation for spawning a trusted agent, sending high-impact instructions, force-killing a session, or deleting task data. 6. Remove `--trust` and `--force` from the default execution path. Enable them only through a separately authorized, clearly disclosed configuration. 7. Apply rate limits and concurrency limits to prevent resource exhaustion. 8. Record authenticated audit events for task creation, instruction injection, status access, and termination. 9. Ensure tool-based calls are subject to the same identity, ownership, and project-path authorization checks as slash commands. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (64)

Ae1

High
Category
analysis-evasion
Content
- [插件入口](extensions/openclaw-cursor-agent/index.js) — 工具注册和执行逻辑
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
# 更新系统
sudo apt update && sudo apt upgrade -y

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
sudo apt update && sudo apt upgrade -y

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

# 安装 ffmpeg
Confidence
99% confidence
Finding
Piping curl output directly into sudo -E bash is a classic dangerous chaining pattern because it combines download, interpretation, and privileged execution into one opaque step. In this skill's context, that is especially risky because the host is being prepared to run persistent agent services and store sensitive sessions and configuration.

Chaining Abuse

High
Category
Tool Misuse
Content
sudo apt install -y curl

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs ffmpeg

# 验证
Confidence
99% confidence
Finding
The WSL instructions repeat the same unsafe chain of downloading content and immediately executing it as root. This makes compromise easy if the remote content, transport, or environment is manipulated.

Chaining Abuse

High
Category
Tool Misuse
Content
**Linux**:
```bash
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
```
Confidence
98% confidence
Finding
curl | sh is an unsafe chain because it executes network-fetched code without inspection or integrity validation. On a machine exposing OpenClaw services and bot webhooks, that could lead to remote control of the host and long-lived persistence through the installed tooling.

External Script Fetching

High
Category
Supply Chain
Content
在 WSL 中执行:

```bash
curl https://cursor.com/install -fsS | bash
agent --version
```
Confidence
98% confidence
Finding
Piping a remotely fetched script directly into `bash` executes unreviewed code from the network with the user's privileges, eliminating any inspection or integrity verification step. In this agent ecosystem, where the installed CLI is later used to run persistent background tasks, compromise at install time could grant durable execution capability and downstream access to projects, credentials, and shell sessions.

Chaining Abuse

High
Category
Tool Misuse
Content
在 WSL 中执行:

```bash
curl https://cursor.com/install -fsS | bash
agent --version
```
Confidence
96% confidence
Finding
The `| bash` construct is dangerous because it chains network retrieval directly into shell execution, making tampering, server compromise, or operator copy/paste mistakes immediately executable. In the context of a tool meant to orchestrate background coding agents through tmux and WSL, this raises the risk of persistent compromise of the execution environment.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Content
t: "",
  defaultProjectPath: "",
  executionMode: process.platform === "win32" ? "wsl" : "direct",
  timeoutMs: 120000,
  shell: {
    executable: process.platform === "win32" ? "wsl.exe" : "bash",
    args: [],
    workingDirectory: "",
    wslDistro: "",
  },
};

const SPAWN_SCHEMA = {
  type: "object",
  required: ["taskName", "taskDescription"],
  properties: {
    taskName: { type: "string", description: "Short task label, for example feature-auth" },
    taskDescription: { type: "string", description: "The prompt that Cursor CLI should execute" },
    projectPath: { type: "string", description: "Optional project directory" },
    priority: { type: "string", description: "Task priority, for example low, normal, high" },
    eta: { type: "string", description: "Estimated duration, for example 45分钟" },
    taskFile: { type: "string", description: "Optional existing markdown task file" },
  },
};

const SESSION_SCHEMA = {
  type: "object",
  required: ["sessionQuery"],
  properti
Confidence
80% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Session Persistence

Medium
Category
Rogue Agent
Content
cursor-agent-system/
├── scripts/
│   ├── common.sh          # Shared utilities
│   ├── spawn-cursor.sh    # Start background task
│   ├── check-status.sh    # Query task status
│   ├── attach-session.sh  # Attach to tmux session
│   ├── send-command.sh    # Send instructions to task
Confidence
70% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Missing User Warnings

Medium
Confidence
85% confidence
Finding
The README presents background execution and task termination as normal operations but does not warn users that these actions create persistent processes, consume system resources, and can alter code or kill active work. For an agent skill that bridges chat input to tmux-managed Cursor CLI sessions, the lack of safety warnings and operational constraints increases the risk of accidental or unauthorized system-impacting actions.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The README encourages broad natural-language commands like starting, modifying, and stopping persistent coding jobs without defining confirmation requirements, scope limits, or safety boundaries. In a skill that can launch long-running tmux/Cursor sessions and send follow-up commands, vague triggers increase the chance of unintended execution, misuse, or prompt-driven task manipulation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill advertises and references capabilities that can start persistent tmux-backed coding sessions and interact with the shell, but it declares no explicit tool scope or permission boundaries. In an agent ecosystem, missing scope declarations increases the chance that the skill is invoked with broader-than-necessary access, enabling unintended file, environment, or command execution paths.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The activation cues are broad and include common phrases about background tasks, status checks, tmux, and generic task control, which can cause over-triggering in ordinary conversation. If auto-selected, the skill could launch or manipulate persistent coding sessions when the user only intended to discuss them, creating unnecessary system-side actions.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Most user-facing documentation and examples are written in Chinese, and the natural-language mapping assumes Chinese inputs, while the skill does not state that language is optional or provide an opt-in choice. This creates a locale/language constraint that is not documented as region-specific or user-selectable.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The workflow explicitly describes starting, controlling, and killing persistent background sessions but provides no user warning or confirmation around system-impacting behavior. Because these actions can consume resources, alter code, or terminate active work, lack of warning raises the risk of accidental destructive or costly operations.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The script's comments, usage text, and operational messages are entirely in Chinese, which imposes a specific language on users without offering any choice or opt-in. Under the stated policy, a skill should not force a language or locale unless it is explicitly justified or user-selectable.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
User-facing comments, help text, status labels, and runtime messages are consistently hard-coded in Chinese throughout the script. There is no indication of user opt-in, locale detection, or documented justification that this skill is intentionally limited to a Chinese-speaking environment.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The info, warn, and error helpers emit user-facing text only in Chinese (e.g. 信息, 警告, 错误, 缺少命令). This enforces a specific language for operator-visible output without offering a language choice or documenting a justified locale restriction, which matches the policy-violation category.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The script's comments, usage text, and user-facing messages are entirely in Chinese, such as the description and installation prompts. This imposes a specific language on all users with no opt-in or alternative locale handling, which matches the language/locale policy violation category.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script launches the Cursor/agent CLI with both --trust and --force, suppressing normal safety friction while passing a prompt built from user-controlled task content into a long-running coding agent operating on a real workspace. In this skill’s context, that materially increases the chance of unsafe file modification, command execution, or acceptance of dangerous instructions without any explicit user confirmation or warning at launch time.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The skill template forces all instructions, status output, and control guidance to be in Chinese. This is a natural-language policy concern because the file does not provide user opt-in, alternative language options, or a documented reason for restricting the skill to a specific language/locale.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 更新系统
sudo apt update && sudo apt upgrade -y

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 更新系统
sudo apt update && sudo apt upgrade -y

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 更新系统
sudo apt update && sudo apt upgrade -y

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 更新系统
sudo apt update && sudo apt upgrade -y

# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
extensions/openclaw-cursor-agent/index.js:175