Back to skill

Security audit

Pub Self Upgrade

Security checks for vulnerabilities and agentic risk

Overview

This skill is an OpenClaw self-updater, but its executable upgrade path can replace the running package and restart the service without the review and confirmation controls it describes.

Review this skill carefully before installing. It is not clearly malicious, but it can change the OpenClaw code that runs as your gateway service; prefer a manual or redesigned updater that resolves one exact version, shows matching release notes, verifies registry and integrity, requires explicit approval immediately before install, and avoids persistent scheduled upgrades.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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)

T06 · System Persistence

Warning
Location
SKILL.md:89
Finding

Persistent scheduled upgrade can execute after the initiating session ends

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
scripts/upgrade-openclaw.sh:120
Finding

Mutable global npm installation can execute unreviewed third-party code

Content
View full analysis
&1; then fail "npm install failed" log "Trying the official registry..." if ! npm install -g openclaw@latest --registry https://registry.npmjs.org 2>&1; then fail "npm install from the official registry also failed" ``` The original script messages are in Chinese; the commands above are reproduced faithfully while the messages are translated into English for this report. ### Technical Analysis The installation target uses the mutable `latest` tag rather than an exact, previously reviewed package version. The first installation attempt also uses the user's configured npm registry instead of explicitly using the documented official registry. An npm installation can execute package lifecycle scripts and installs executable application code that subsequently runs as the systemd-managed OpenClaw gateway. Therefore, the effective code executed by this reviewed Skill can change after the Skill itself has been audited. The script does not: - Pin an exact package version. - Validate the downloaded package's integrity against an independently approved digest. - Verify npm provenance or publisher identity. - Disable or inspect lifecycle scripts. - Ensure that the configured registry is the expected official registry before the first attempt. - Stage and validate the package before replacing the active global installation. The global installation and service restart are necessary for the declared upgrade function, but using a mutable target and an uncontrolled first-choice registry exceeds what is necessary to perform a reviewed upgrade safely. ### Attack Path 1. An attacker compromises the npm publisher account, controls the configured npm registry, or causes a malicious release to receive the `latest` tag. 2. Th ...[truncated 1088 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/upgrade-openclaw.sh:73
Finding

Executable upgrade path bypasses the documented release-review and confirmation gate

Content
View full analysis
/dev/null \ | python3 -c " import sys, json try: d = json.load(sys.stdin) body = d.get('body', '') name = d.get('name', '') html = d.get('html_url', '') lines = body.strip().split('\n') safe = [l for l in lines[:50] if l.strip()] print(f'--- {name} ---') for l in safe: print(l) if len(lines) > 50: print('...') print(f'--- Full: {html} ---') except Exception as e: print(f'ParseError: {e}') " 2>/dev/null || echo "API request failed") log "=== Release Notes ===" echo "$RN" | while IFS= read -r l; do log "$l"; done log "=== End Release Notes ===" BREAKING_HINT=$(echo "$RN" | grep -ci "breaking\|BREAKING\|重新.*密码\|密码.*变更\|credential\|re-auth\|reauthenticate\|password.*change\|migration" || true) if [ "$BREAKING_HINT" -gt 0 ]; then log "⚠️ Release notes contain possible breaking-change keywords; monitor after upgrade" fi ``` It then proceeds to back up and install the unrelated mutable `latest` target without requiring confirmation: ```bash rm -rf "$BAKDIR" log "Backing up current code to openclaw-fallback..." cp -r "$CURDIR" "$BAKDIR" ok "Backup complete ($(du -sh "$BAKDIR" | awk '{print $1}'))" step "Phase 2: npm install -g openclaw@latest" log "Installing openclaw@latest..." if ! npm install -g openclaw@latest 2>&1; then fail "npm install failed" log "Trying the official registry..." if ! npm install -g openclaw@latest --registry https://registry.npmjs.org 2>&1; then ``` The original script messages are in Chinese; command behavior ...[truncated 2397 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior promises user confirmation and 'zero downtime', but the described implementation includes a service restart with acknowledged interruption and modifies systemd unit metadata. Misrepresenting state-changing behavior is dangerous because it can cause an operator or agent to approve actions under false assumptions, especially for self-upgrade logic that changes running infrastructure.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
98% confidence
Finding

This skill is explicitly designed for self-modification of the running OpenClaw installation, including fetching updates from external sources, replacing the global package, changing systemd execution paths, and restarting the service. Self-upgrade mechanisms are highly sensitive because they alter the trusted computing base; any compromise, misconfiguration, or logic flaw can lead to service takeover, persistence, or destructive outage.

Content

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

md
description: "零停机升级 OpenClaw:查 release notes → 主公确认 → 旁路备份 → npm install → 重启 + 回滚兜底"
---

# openclaw-self-update-zero-downtime

## 用途

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The rollback instructions include a destructive 'rm -rf' against the live global package directory. Even though the path is specific, recursive forced deletion in a self-upgrade skill is dangerous because path mistakes, symlink issues, environment differences, or partial rollback states can remove the active installation or other files and leave the service unavailable.

Content

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

手动回滚

bash
rm -rf ~/.npm-global/lib/node_modules/openclaw
cp -r ~/.npm-global/lib/node_modules/openclaw-fallback ~/.npm-global/lib/node_modules/openclaw
systemctl --user restart openclaw-gateway

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The rollback instructions include a destructive 'rm -rf' against the live global package directory. Even though the path is specific, recursive forced deletion in a self-upgrade skill is dangerous because path mistakes, symlink issues, environment differences, or partial rollback states can remove the active installation or other files and leave the service unavailable.

Content

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

手动回滚

bash
rm -rf ~/.npm-global/lib/node_modules/openclaw
cp -r ~/.npm-global/lib/node_modules/openclaw-fallback ~/.npm-global/lib/node_modules/openclaw
systemctl --user restart openclaw-gateway

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

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

json
{
  "name": "openclaw-self-update-zero-downtime",
  "version": "1.0.0",
  "description": "Zero-downtime OpenClaw upgrade with backup/rollback, release notes review, and user confirmation",
  "keywords": ["openclaw", "update", "upgrade", "zero-downtime", "blue-green"],

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly describes shell-capable behavior such as npm installation, systemd modification, backups, restarts, cron scheduling, and rollback, yet it declares no explicit tool scope or permissions. This creates an authorization and transparency gap: an agent may execute high-risk system actions without an auditable, least-privilege declaration of what tools are required.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include broad everyday expressions like '帮我更新' and '检查更新', which can match ambiguous user intent and cause the skill to activate in contexts not clearly limited to self-upgrading OpenClaw. Because the skill performs package installation, service restarts, and configuration changes, accidental activation materially increases operational risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation condition '会话上下文表明需要进行 OpenClaw 自身升级' lacks a precise boundary and permits contextual inference to trigger a high-impact maintenance workflow. For a self-modifying skill, ambiguous activation is particularly risky because unintended interpretation can lead to package changes, cron persistence, or service disruption.

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 · scripts/upgrade-openclaw.sh (reported line 75)May include surrounding context.

sh
log "查询 GitHub API 获取 release notes..."
RN=$(curl -sL --connect-timeout 10 \
    "https://api.github.com/repos/openclaw/openclaw/releases/tags/v2026.6.5" 2>/dev/null \
    | python3 -c "
import sys, json
try:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language text hardcodes the assistant's interaction style around '主公确认', implying a fixed language/register choice rather than adapting to the user's preferred language or tone. This can violate locale/language policy when no user opt-in or documented justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The example confirmation prompt is written only in Chinese and does not indicate that the skill should localize to the user's language preference. A fixed-language prompt can create a language-policy issue if users are not given a choice or if the skill is not clearly region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The header comments and operational instructions are written in Chinese, including the user-notification instruction on L16. This imposes a specific language/locale on operators without any opt-in or alternative, which matches the policy category for forced language usage.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
15% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/upgrade-openclaw.sh (reported line 74)May include surrounding context.

sh
step "阶段 0b: 查 release notes"

log "查询 GitHub API 获取 release notes..."
RN=$(curl -sL --connect-timeout 10 \
    "https://api.github.com/repos/openclaw/openclaw/releases/tags/v2026.6.5" 2>/dev/null \
    | python3 -c "
import sys, json