Back to skill

Security audit

openclaw-with-vscode

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real VS Code Copilot bridge, but it grants broad local agent-control authority with weak scoping and unclear safeguards.

Install only if you trust the VS Code extension publisher and are comfortable sending coding prompts and possibly code context through Copilot/GitHub services. Use it in trusted workspaces, avoid prompts containing secrets, and prefer explicit confirmation before allowing the bridge to edit files, delete files, or run commands.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:58
Finding
Shell Command Injection Through Unsafe Prompt Interpolation## Vulnerability Details **File Location**: `SKILL.md`, lines 58-61 **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```bash curl -s -X POST http://localhost:19836/trigger \ -H "Content-Type: application/json" \ -d '{"prompt":"<TASK_DESCRIPTION>"}' ``` ### Technical Analysis The documented workflow places the task description inside a single-quoted shell argument without defining any escaping or safe serialization procedure. The task description originates from user-controlled coding requests. If an agent implements the placeholder through direct textual substitution, an apostrophe in the task can terminate the single-quoted argument. Additional shell syntax can then be interpreted by the shell rather than being treated as JSON data. JSON metacharacters can also corrupt the request even when they do not result in command execution. This is an injection flaw at the boundary between untrusted prompt data, JSON serialization, and shell command construction. ### Attack Path 1. An attacker submits a coding task containing a single quote followed by shell metacharacters and a command. 2. The agent substitutes the task text directly for `<TASK_DESCRIPTION>`. 3. The injected quote terminates the shell's single-quoted `-d` argument. 4. The shell interprets the remaining attacker-controlled text as command syntax. 5. The injected command executes under the operating-system account running OpenClaw. ### Impact Assessment Successful exploitation permits arbitrary local command execution with the privileges of the OpenClaw process. Depending on those privileges, an attacker could read or modify workspace files, access user-readable credentials, alter source code, invoke network utilities, or compromise other resources available to the user account.
Remediation
## Remediation Suggestions - Never interpolate task text directly into a shell command. - Construct the request body with a JSON serializer that correctly escapes all prompt content. - Pass prompt content through an environment variable or positional argument rather than embedding it in command source. - Prefer a direct HTTP client API that accepts a structured JSON object and does not invoke a shell. - If command-line tooling is required, use a pattern such as: ```bash payload="$(jq -n --arg prompt "$TASK_DESCRIPTION" '{prompt: $prompt}')" curl --fail --silent --show-error \ -X POST http://127.0.0.1:19836/trigger \ -H "Content-Type: application/json" \ --data-binary "$payload" ``` - Validate that generated requests remain valid JSON for prompts containing quotes, backslashes, newlines, command substitutions, and other shell metacharacters.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:50
Finding
Unauthenticated Local Endpoint Can Dispatch Privileged Agent Tasks## Vulnerability Details **File Location**: `SKILL.md`, lines 50-61 **Vulnerability Type**: Missing authentication and authorization on a privileged local API **Risk Level**: High ### Vulnerable Code ```bash curl -s http://localhost:19836/health ``` ```bash curl -s -X POST http://localhost:19836/trigger \ -H "Content-Type: application/json" \ -d '{"prompt":"<TASK_DESCRIPTION>"}' ``` The privileged execution context is additionally documented at line 90: ```markdown - Copilot Chat should be in **Agent mode** for full execution / Copilot Chat 应切换到 **Agent 模式**以获得完整执行能力 ``` ### Technical Analysis The documented `/trigger` request contains no authentication credential, session secret, authorization scope, or user-confirmation mechanism. The Skill describes the receiver as capable of editing files, running commands, and creating code, and recommends Copilot Agent mode for full execution. Binding a service to loopback reduces exposure from remote hosts but does not establish an authorization boundary. Other processes running in the same user session can ordinarily connect to localhost. Browser-based or locally compromised software may also be able to attempt requests, subject to the receiver's HTTP and browser security behavior. The documentation claims that traffic stays on localhost, but locality alone does not ensure that the caller is authorized to direct an agent with command and workspace access. ### Attack Path 1. The user opens VS Code with the bridge extension running and Copilot Chat configured in Agent mode. 2. An untrusted local process discovers or already knows that the bridge listens on port `19836`. 3. The process sends an attacker-controlled JSON prompt to `http://127.0.0.1:19836/trigger`. 4. The bridge forwards the prompt to Copilot without requiring proof that the request came from the intended OpenClaw client. 5. Copilot may edit files or execute commands in the open workspace according to the malicious prompt. ### Impact Asse ...[truncated 405 chars]
Remediation
## Remediation Suggestions - Generate a cryptographically random, per-session bearer token and require it on every non-health request. - Store the token with permissions limited to the current user and rotate it whenever the bridge restarts. - Bind explicitly to `127.0.0.1` or a protected Unix-domain socket rather than relying on ambiguous hostname resolution. - Authorize individual operations and apply least privilege instead of granting unrestricted Agent-mode behavior. - Require explicit user confirmation before command execution, file deletion, access outside the workspace, or other high-impact operations. - Reject oversized, malformed, or unsupported requests and apply rate limiting. - If browser clients are possible, enforce restrictive origin checks and do not enable permissive CORS. - Log request provenance and sensitive actions without recording secrets or complete confidential prompts.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:22
Finding
Unpinned External VS Code Extension Introduces Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, lines 22-30 **Vulnerability Type**: Unverified executable third-party dependency **Risk Level**: Medium ### Vulnerable Code ```markdown Install the OpenClaw Chat extension from VS Code Marketplace: 从 VS Code 扩展商店安装 OpenClaw Chat 扩展: ```bash code --install-extension wodeapp.openclaw-chat ``` Or search **"OpenClaw Chat"** in VS Code Extensions panel. 或在 VS Code 扩展面板搜索 **"OpenClaw Chat"** 安装。 The extension starts automatically with VS Code. No manual launch needed. ``` ### Technical Analysis The Skill depends on executable extension code retrieved from the VS Code Marketplace, but the installation command does not pin a reviewed version or verify a package digest or signature. The extension implementation is not included in the audited project, so its endpoint security, data handling, update behavior, and command-execution controls cannot be verified from this artifact. Because the extension starts automatically with VS Code and is intended to interact with workspaces and Copilot Agent mode, compromise of the publisher account, Marketplace artifact, or later update could introduce code with substantial access to the user's development environment. This finding identifies a supply-chain weakness; the available artifact does not establish that the named extension is currently malicious. ### Attack Path 1. The user follows the setup instructions and installs the extension by identifier without a pinned version or independently verified digest. 2. The Marketplace supplies the current package or a future automatically updated package. 3. If the publisher account, distribution channel, or package is compromised, malicious extension code is installed. 4. The extension starts with VS Code. 5. The compromised extension operates with the permissions and workspace access available to VS Code extensions. ### Impact Assessment A compromised dependency could access or modify workspace content, observe prompts, ...[truncated 256 chars]
Remediation
## Remediation Suggestions - Pin installation to a specific reviewed extension version where supported. - Publish and verify cryptographic checksums or signed release artifacts. - Document the expected publisher identity, source repository, requested permissions, network destinations, and update policy. - Review the extension source and packaged artifact before deployment in sensitive environments. - Disable automatic updates where reproducible, controlled deployments are required; evaluate updates before rollout. - Prefer an auditable, bundled, or internally mirrored dependency when the bridge is permitted to execute commands or modify source code. - Apply VS Code workspace trust and operating-system sandboxing to limit the consequences of dependency compromise.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Confidence
96% confidence
Finding
The skill instructs invocation for very broad categories like writing, editing, reviewing, or debugging code, which are common requests and can trigger delegation to a tool that can edit files and run commands. This increases the chance of unintended handoff of sensitive prompts or unsafe autonomous actions without explicit user confirmation.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The description presents the bridge as a normal coding helper but omits an upfront warning that tasks may cause file edits and command execution on the user's machine. Users may unknowingly authorize high-impact local actions, making social engineering and accidental destructive operations more likely.

External Transmission

Medium
Category
Data Exfiltration
Content
1. Check if the extension is running / 检查扩展是否运行:

```bash
curl -s http://localhost:19836/health
```

If not running, guide the user through Setup above.
Confidence
87% confidence
Finding
Although the HTTP request targets localhost, the skill forwards user prompts to a local extension that then routes them to Copilot, which the document itself admits uses GitHub's API. That means potentially sensitive code or instructions may be transmitted beyond the local machine, and the local service also acts as a privileged execution bridge capable of triggering edits and commands.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
The example user prompt and dispatched task are written in Chinese, while the skill does not state that language is user-selectable for examples or operation. This can be interpreted as a locale-specific default without explicit opt-in.

Static analysis

No suspicious patterns detected.