Back to skill

Security audit

Openclaw Troubleshooter

Security checks for vulnerabilities and agentic risk

Overview

This OpenClaw troubleshooting skill is purpose-aligned, but its repair instructions can force-stop processes, overwrite configuration, and uninstall skills without the safeguards it claims.

Review this skill carefully before installing. Prefer check-only mode first, manually back up openclaw.json, verify the process name and command line before stopping any PID, and avoid --yes uninstall or fix-all flows unless you have confirmed the exact targets.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:306
Finding
Unscoped force termination of the process owning a selected port<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:306-311` **Vulnerability Type**: Unvalidated destructive process management **Risk Level**: Medium ### Vulnerable Code ```powershell # 2. 清理端口 Write-Host "📋 清理端口 $Port..." -ForegroundColor Yellow $connection = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue if ($connection) { Stop-Process -Id $connection.OwningProcess -Force Start-Sleep -Seconds 2 } ``` ### Technical Analysis The gateway repair procedure obtains the process associated with the caller-selected local port and forcibly terminates it. It does not verify that the owning process is an OpenClaw Gateway, validate its executable path or command line, or request confirmation before termination. The script accepts the target through the unrestricted integer parameter `$Port`. Consequently, invoking the repair procedure with a port used by an unrelated application causes that application's process to be terminated. Multiple matching connections may also result in more than one process identifier being passed to `Stop-Process`. This is an unsafe destructive operation rather than evidence of intentional malicious behavior. ### Attack Path 1. Identify a local port used by an unrelated, security-sensitive, or availability-sensitive process. 2. Invoke the documented gateway repair script with that port through its `-Port` parameter. 3. `Get-NetTCPConnection` returns the owning process identifier. 4. The script passes that identifier directly to `Stop-Process -Force`. 5. The unrelated process is terminated without identity validation or user confirmation. ### Impact Assessment An attacker or mistaken operator who can invoke the repair procedure can terminate processes under the privileges of the script. If the script runs with elevated privileges, the scope includes processes that the same elevated account is permitted to stop. Potential consequences include denial of service, interrupted transactions, loss of ...[truncated 151 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict the accepted port to the configured OpenClaw Gateway port or an explicitly approved range. 2. Resolve every owning PID and verify its executable path, process name, and command line before termination. 3. Require the process command line to identify an OpenClaw Gateway instance. 4. Display the process identity and obtain explicit confirmation before stopping it. 5. Attempt graceful Gateway shutdown before using `Stop-Process`. 6. Use `-Force` only as a final fallback after a bounded graceful-shutdown timeout. 7. Handle multiple connections individually and reject ambiguous process ownership. 8. Record the PID and validation evidence in an audit log. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:339
Finding
Live configuration is destructively overwritten without backup or atomic replacement<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:339-375`; conflicting backup claim at `SKILL.md:407` **Vulnerability Type**: Unsafe configuration-file update **Risk Level**: Medium ### Vulnerable Code ```powershell # 配置修复脚本 $ErrorActionPreference = "Stop" $OpenClawHome = $env:OPENCLAW_HOME ?? "$env:USERPROFILE\.openclaw" $configPath = Join-Path $OpenClawHome "openclaw.json" Write-Host "🔧 修复 openclaw.json 配置..." -ForegroundColor Cyan $config = Get-Content $configPath -Raw | ConvertFrom-Json # 修复 Control UI allowedOrigins if (-not $config.gateway.controlUi) { $config.gateway.controlUi = @{} } $config.gateway.controlUi.allowedOrigins = @( "http://127.0.0.1:18789", "http://localhost:18789" ) # 修复 trustedProxies if (-not $config.gateway.trustedProxies) { $config.gateway.trustedProxies = @("127.0.0.1") } # 修复 denyCommands $config.gateway.nodes.denyCommands = @( "canvas.present", "canvas.hide", "canvas.navigate", "canvas.eval", "canvas.snapshot", "canvas.a2ui.push", "canvas.a2ui.pushJSONL", "canvas.a2ui.reset" ) # 保存配置 $config | ConvertTo-Json -Depth 10 | Set-Content $configPath -Encoding UTF8 ``` The documentation separately claims: ```text 1. **备份配置** - 修复前自动备份 openclaw.json ``` ### Technical Analysis The procedure reads the active `openclaw.json`, mutates it, serializes it again, and writes directly to the original path. It does not create the backup promised by the documentation. It also lacks schema validation, a same-volume temporary file, atomic replacement, post-write verification, and rollback behavior. Direct use of `Set-Content` can leave the live configuration incomplete or invalid if the write is interrupted. PowerShell JSON deserialization and serialization can also normalize object representation and discard original formatting. The fixed serialization depth may truncate deeply nested data if the configuration contains structures beyond that depth. The script assumes required ...[truncated 1510 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Resolve and validate the intended OpenClaw home directory before accessing the configuration. 2. Create a timestamped backup with restrictive permissions before making any changes. 3. Validate that required parent objects exist and have the expected types. 4. Preserve unknown fields and use a serialization depth sufficient for the validated schema. 5. Validate the complete modified document against the OpenClaw configuration schema. 6. Write the result to a uniquely named temporary file in the same directory. 7. Flush and re-read the temporary file, then verify that it is valid JSON and semantically acceptable. 8. Replace the original file atomically only after validation succeeds. 9. Restore the backup automatically if replacement or post-write validation fails. 10. Preserve original file permissions and avoid following unexpected symbolic links or reparse points. 11. Update the documentation so backup and rollback claims exactly match implemented behavior. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
skill.json:5
Finding
Invalid JSON metadata and inconsistent license declarations<![CDATA[ ## Vulnerability Details **File Location**: `skill.json:5-7`; related declarations at `_meta.json:5` and `SKILL.md:5` **Vulnerability Type**: Metadata integrity and parser compatibility defect **Risk Level**: Low ### Vulnerable Code `skill.json` contains JavaScript-style comments, which are not permitted by the JSON standard: ```json "license": "MIT-0", // 声明使用 MIT-0 协议 "acceptLicenseTerms": true, // 核心:同意协议条款 "confirmOwnership": true // 确认拥有技能版权 ``` The package also declares different licenses: ```yaml # SKILL.md license: MIT ``` ```json // _meta.json "license": "MIT-0" ``` ```json // skill.json "license": "MIT-0" ``` ### Technical Analysis Strict JSON parsers reject comments. As a result, consumers that parse `skill.json` according to the JSON standard cannot reliably load or validate the Skill metadata. The license is also inconsistent: the `SKILL.md` front matter declares `MIT`, while `_meta.json` and `skill.json` declare `MIT-0`. MIT and MIT-0 are distinct SPDX license identifiers. This inconsistency can cause different package consumers, policy engines, or compliance scanners to derive different licensing conclusions. No evidence indicates that this discrepancy is intentionally designed to bypass policy controls. It is nevertheless an integrity problem in security- and compliance-relevant metadata. ### Attack Path 1. A package installer, registry, or validation pipeline reads `skill.json` using a strict JSON parser. 2. Parsing stops at the first `//` comment and package validation or installation fails. 3. If a permissive parser is used instead, separate consumers may read the license from different files. 4. One consumer records `MIT`, while another records `MIT-0`, producing inconsistent policy or compliance decisions. There is no demonstrated path to privilege escalation or code execution from this issue alone. ### Impact Assessment The issue can cause denial of package installation, metadata validation failures, in ...[truncated 225 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all comments from `skill.json` so it is valid standards-compliant JSON. 2. If explanatory comments are required, place them in documentation rather than JSON metadata. 3. Select the correct SPDX license identifier and use it consistently in `SKILL.md`, `skill.json`, and `_meta.json`. 4. Add automated strict-JSON parsing to package validation. 5. Add a consistency check that compares name, version, slug, and license fields across all metadata files. 6. Revalidate ownership and license assertions after correcting the declared license. ]]>
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (5)

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill recommends force-killing node.exe processes and any process bound to port 18789, and the repair script also stops processes by PID. Even if intended for OpenClaw recovery, these actions can terminate unrelated workloads, corrupt in-progress work, or disrupt other services when process selection is too broad or port ownership is misidentified.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The fix-config script programmatically rewrites openclaw.json, adding and replacing nested settings including allowedOrigins, trustedProxies, and denyCommands, but does not clearly warn that it will overwrite configuration state. In context, this is risky because operators may run a 'repair' workflow expecting additive checks, while the script silently imposes defaults that may weaken intended custom policy or break existing deployments.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The documentation promises an automatic backup before repair, but the provided fix-config script writes directly to openclaw.json with Set-Content and shows no backup step. This can permanently destroy a working or partially recoverable configuration during a repair attempt, especially when the script also normalizes multiple settings at once.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The notes claim dangerous skill uninstallation requires user confirmation, but the documented remediation uses clawhub uninstall ... --yes, which suppresses confirmation entirely. In a troubleshooting skill, this creates a mismatch between user expectations and actual destructive behavior, increasing the chance of accidental removal of software or data needed for investigation.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The manifest description and user-facing documentation are entirely in Chinese, with no indication that other languages are supported or that the skill is intentionally restricted to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy issue.

Static analysis

No suspicious patterns detected.