Back to skill

Security audit

OpenClaw 升级前影响评估工具

Security checks for vulnerabilities and agentic risk

Overview

This is mostly an OpenClaw update-reporting tool, but it overreaches by requesting command execution and documenting a global update command despite saying it will not perform updates.

Review this skill before installing. It should be constrained to workspace reads/writes and GitHub release fetching; do not grant command execution unless you separately intend to allow global OpenClaw updates. Treat its compatibility report as advisory only, verify that real backup files were created, and do not let an agent automatically run the documented pnpm add -g openclaw@latest command from the report or examples.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
_meta.json:29
Finding

Unnecessary Command-Execution Capability and Contradictory Global Update Guidance

Content
View full analysis

Vulnerability Details

File Location: _meta.json:29-38, SKILL.md:22-25, and SKILL.md:315-322
Vulnerability Type: Excessive privilege declaration and unsafe command-execution guidance
Risk Level: Medium

Evidence

_meta.json:29-38 declares command-execution capability even though the implemented analysis, release retrieval, backup, and reporting workflows do not execute system commands:

json
"capabilities": [
  "file_read",
  "file_write",
  "exec",
  "web_fetch"
],
"permissions": {
  "workspace": "read-write",
  "network": "github.com",
  "exec": "limited"
},

SKILL.md:22-25 explicitly states that the Skill does not perform OpenClaw updates:

markdown
### 我们不做:
- ❌ 不执行 OpenClaw 更新
- ❌ 不自动更新技能包
- ❌ 不修改系统配置

However, SKILL.md:315-322 presents an Agent-executable global update operation:

javascript
// 升级前
const analysis = await openclaw.updateChecker.analyze();
if (analysis.impactSummary.high === 0) {
  console.log('✅ 可以安全升级');
  await openclaw.exec({ command: 'pnpm add -g openclaw@latest' });
} else {
  console.log('⚠️ 存在兼容性问题,请先处理');
}

Technical Analysis

The Skill's implemented functionality in index.js requires workspace file access and outbound access to the GitHub Releases API. It does not invoke child_process, exec, spawn, or an equivalent command-execution API. Therefore, declaring the exec capability exceeds the minimum privileges necessary for its legitimate purpose.

The documentation compounds this least-privilege violation by instructing an Agent to invoke openclaw.exec with pnpm add -g openclaw@latest. This conflicts with the Skill's stated boundary that it does not execute updates or modify system configuration. A global package installation changes the host environment and may execute package lifecycle scripts supplied by the installed package or its dependencies.

The risk is amplified by the implem ...[truncated 1697 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove command execution from the Skill metadata:

    json
    "capabilities": [
      "file_read",
      "file_write",
      "web_fetch"
    ],
    "permissions": {
      "workspace": "read-write",
      "network": "github.com"
    }
    
  2. Remove the openclaw.exec call from SKILL.md. If upgrade instructions are necessary, display the command only as optional user guidance and clearly state that it requires separate, explicit confirmation.

  3. Keep the Skill's trust boundary limited to:

    • Reading narrowly selected workspace configuration metadata.
    • Fetching release information from the fixed official GitHub API endpoint.
    • Writing reports and backups within an approved workspace directory.
  4. Do not recommend an upgrade merely because the high-risk counter is zero. Parse and evaluate the actual release notes and relevant configuration content before producing a compatibility conclusion.

  5. Require an independent confirmation step before any separate update tool performs a global installation. The confirmation should identify the exact command, package source, destination scope, and potential lifecycle-script execution.

  6. Add automated tests that fail if production code or Skill instructions introduce openclaw.exec, child_process, exec, or spawn without an explicitly reviewed requirement.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the skill actually runs tests or other non-user-facing workflows instead of the advertised upgrade analysis and backup flow, it creates a trust-boundary failure. Users may believe compatibility has been assessed and files protected when neither occurred, which can directly cause data loss or unsafe upgrade decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the skill actually runs tests or other non-user-facing workflows instead of the advertised upgrade analysis and backup flow, it creates a trust-boundary failure. Users may believe compatibility has been assessed and files protected when neither occurred, which can directly cause data loss or unsafe upgrade decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill documentation begins in Chinese and the entire README is written in Chinese, with no indication that users may choose another language or that the skill is limited to a Chinese-speaking region. This can violate language/locale policy when a skill effectively imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
80% confidence
Finding

The skill documents network access, file operations, and version detection behavior but does not declare any explicit tool scope or permission boundaries. In an agent environment, undeclared capabilities increase the risk of over-privileged execution and make it harder for users or orchestrators to constrain network and environment access before invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description and the full SKILL.md content force a single language/locale for users, which matches the language/locale policy violation category. There is no opt-in, alternate language option, or explanation that this skill is intended only for a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest advertises automatic backup behavior together with read-write workspace access, limited exec, and network access to GitHub, but it does not clearly warn users that invoking the skill may create or modify files and reach external resources. In a pre-upgrade tool, this combination increases the risk of surprising side effects, accidental overwrites, or data exposure through fetched metadata, especially because autoBackup is enabled by default.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · index.js (reported line 27)May include surrounding context.

js
workspace: process.env.OPENCLAW_STATE_DIR || process.cwd(),
  backupDir: './backup',
  reportFile: 'OPENCLAW-UPDATE-IMPACT-ANALYSIS.md',
  githubReleases: 'https://api.github.com/repos/openclaw/openclaw/releases'
};

/**

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises precise backup of affected files, but the analysis populates affectedFiles entries without real filesystem paths, while the backup routine only copies entries that contain file.path. This creates a dangerous false sense of backup coverage: users may proceed with an upgrade believing critical files were preserved when in fact little or nothing was backed up.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The generated report and recommendations assert that core configurations are compatible and that the system can be safely upgraded, but the code performs only coarse category-based heuristics and no real compatibility validation. This can mislead operators into making production changes based on unsupported assurances, increasing the risk of outages, broken integrations, or loss of configuration integrity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The report timestamp is explicitly formatted with 'zh-CN' and the file's user-facing strings throughout the skill are written only in Chinese, which effectively forces a specific language/locale experience. The policy allows locale constraints only when the user can opt in or when the restriction is clearly documented and justified, neither of which appears here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The '我们不做' section explicitly says the skill does not execute OpenClaw updates or modify system configuration. Later usage examples show openclaw.exec running pnpm add -g openclaw@latest, which directly performs an upgrade and changes installed software, contradicting the stated non-update intent in the documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The display name and description are written entirely in Chinese, but the manifest does not state that the skill is intended only for Chinese-speaking users or offer any language choice. Under the policy, locale-specific presentation should be justified or optional rather than implicitly forced.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The package description is written only in Chinese (OpenClaw 更新影响分析器 - 自动分析官方更新对配置的影响并备份), which can imply a fixed language experience for users without offering any language or locale choice. Under the policy, language constraints should be opt-in or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · package.json (reported line 20)May include surrounding context.

json
"author": "潜助 🤖",
  "license": "MIT",
  "dependencies": {
    "fs-extra": "^11.1.1",
    "node-fetch": "^2.6.9",
    "semver": "^7.5.4"
  },

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · package.json (reported line 21)May include surrounding context.

json
"license": "MIT",
  "dependencies": {
    "fs-extra": "^11.1.1",
    "node-fetch": "^2.6.9",
    "semver": "^7.5.4"
  },
  "engines": {

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · package.json (reported line 22)May include surrounding context.

json
"dependencies": {
    "fs-extra": "^11.1.1",
    "node-fetch": "^2.6.9",
    "semver": "^7.5.4"
  },
  "engines": {
    "node": ">=18.0.0"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file's user-facing console messages are written in Chinese throughout, including startup, test progress, and failure output. This imposes a specific language on users without opt-in or documented justification, which matches the locale-policy concern for natural-language content.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access, suspicious.exposed_secret_literal

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
index.js:24

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
node_modules/whatwg-url/lib/url-state-machine.js:691