Back to skill

Security audit

Openclaw Ai Doctor

Security checks for vulnerabilities and agentic risk

Overview

This is a troubleshooting skill, but it gives powerful repair commands without enough safety checks or warnings.

Install only if you are comfortable reviewing each command before it runs. Do not let it execute package installs, deletes, chmod changes, or API-key exports automatically; verify paths, back up files, prefer least-privilege permissions such as owner-only memory files, and inspect npm manifests and lockfiles before installing dependencies.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:88
Finding

World-Readable Permissions Applied to Agent Memory Files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 88-89
Vulnerability Type: Excessive file permissions exposing potentially sensitive memory
Risk Level: Medium

Vulnerable Code:

bash
chmod 644 ~/.openclaw/workspace/memory/*.md
chmod 644 ~/.openclaw/workspace/MEMORY.md

Technical Analysis

The documented repair procedure assigns mode 644 to the Agent's memory files. This gives the owner read/write access but grants read access to every other local account.

Agent memory may contain conversation history, personal information, operational context, internal instructions, or other sensitive data. World-readable permissions violate least-privilege principles and are unnecessary when the intended repair is merely to restore access for the Agent's owning account.

Attack Path

  1. A user invokes the Skill to troubleshoot a memory-access problem.
  2. The Agent follows the documented commands and changes the memory files to mode 644.
  3. Another account with local access to the host locates the OpenClaw workspace.
  4. That account reads MEMORY.md or files under memory/ using the newly granted group/other read permissions.
  5. Sensitive Agent state or user information is disclosed without authorization.

Impact Assessment

Exploitation requires access through another local account or process operating under a different identity. It does not grant write access or root privileges, but it can expose all content stored in the affected memory files. The disclosure scope includes every matching Markdown file in the memory directory and the primary MEMORY.md file.

Remediation
View remediation

Remediation Suggestions

  • Use owner-only permissions, such as chmod 600, rather than 644.
  • Verify file ownership with stat or ls -l before changing permissions.
  • Restore the expected owner with a narrowly scoped chown operation when ownership is the actual problem.
  • Avoid wildcard permission changes until the affected files have been enumerated and reviewed.
  • Document that memory files may contain sensitive data and must not be readable by unrelated local users.
  • Add a post-remediation check confirming that files are owned by the OpenClaw account and are not accessible to group or other users.

T08 · Insecure Dependencies

Error
Location
SKILL.md:64
Finding

Forced and Unscoped npm Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 64-65
Vulnerability Type: Unsafe dependency installation with lifecycle-script execution
Risk Level: High

Vulnerable Code:

bash
npm install --force
npm cache clean --force && npm install

Technical Analysis

These repair commands perform npm installation without first changing to or validating a trusted project directory. Consequently, the package manifest used by npm depends on the Agent's current working directory.

The --force option disables or overrides npm safety protections. In addition, npm install can execute package lifecycle scripts such as preinstall, install, and postinstall. If the current directory contains an attacker-controlled or compromised package.json, installation can execute arbitrary commands with the permissions of the account running the Agent.

Clearing the npm cache does not verify dependency integrity or establish package trust. The commands also do not require a reviewed lockfile, use deterministic installation, restrict lifecycle scripts, or validate package provenance.

Attack Path

  1. An attacker causes or persuades the Agent to troubleshoot a project directory containing a malicious or compromised npm manifest.
  2. The Skill classifies the problem as a startup or dependency issue.
  3. The Agent runs npm install --force or the cache-cleaning installation command from that directory.
  4. npm resolves the declared dependencies and executes applicable lifecycle scripts.
  5. Malicious package code runs with the privileges of the Agent's operating-system account.
  6. The payload can access or modify any files and services available to that account, including the OpenClaw workspace and configuration.

Impact Assessment

Successful exploitation provides arbitrary code execution under the Agent user's identity. The resulting payload may read Agent data, alter workspace files, access use ...[truncated 243 chars]

Remediation
View remediation

Remediation Suggestions

  • Require an explicit, verified project directory before running any package-manager command.
  • Replace npm install --force with deterministic installation through npm ci and a reviewed, intact lockfile.
  • Do not use --force as a general-purpose repair step.
  • Initially install with npm ci --ignore-scripts where compatible, then review and explicitly authorize any required lifecycle scripts.
  • Verify package names, versions, registry configuration, integrity metadata, and lockfile changes.
  • Run dependency installation in a sandbox, container, or minimally privileged account when troubleshooting untrusted projects.
  • Present dependency changes for user approval before installation.

T08 · Insecure Dependencies

Error
Location
SKILL.md:116
Finding

Untrusted Skill Dependencies Can Execute npm Lifecycle Scripts

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 116
Vulnerability Type: Arbitrary Skill dependency installation without provenance validation
Risk Level: High

Vulnerable Code:

bash
cd ~/.openclaw/skills/<skillName> && npm install

Technical Analysis

The Skill-loading repair procedure runs npm install inside a selected Skill directory without requiring validation of that Skill's origin, package manifest, lockfile, or dependencies.

npm installations can invoke lifecycle scripts supplied by either the Skill package or its dependencies. Therefore, troubleshooting an untrusted or compromised Skill may execute attacker-controlled commands. The placeholder also lacks documented validation, so an implementation must not treat a user-provided Skill name as inherently trusted.

Attack Path

  1. An attacker supplies, modifies, or compromises a Skill containing a malicious package.json or dependency.
  2. The Skill fails to load, either naturally or intentionally, causing the user to request repair.
  3. The Agent follows the documented treatment and enters the affected Skill directory.
  4. The Agent runs npm install.
  5. npm executes malicious lifecycle scripts or installs a compromised dependency.
  6. The code runs under the Agent user's account and can access resources available to that identity.

Impact Assessment

Successful exploitation results in arbitrary local code execution with the privileges of the user running OpenClaw. This can expose or modify the OpenClaw workspace, memory, configuration, API credentials available to the process, and other user-accessible files. The command does not itself provide administrator privileges, but a malicious package inherits the full effective access of the invoking account.

Remediation
View remediation

Remediation Suggestions

  • Permit installation only for Skills obtained from authenticated and approved sources.
  • Canonicalize the Skill path and verify that it remains inside the expected Skills directory.
  • Inspect package.json, lifecycle scripts, registry settings, and the lockfile before installation.
  • Prefer npm ci --ignore-scripts with a reviewed lockfile instead of an unrestricted npm install.
  • Enable lifecycle scripts only when they are required and have been individually reviewed.
  • Pin dependency versions and validate integrity hashes.
  • Perform installation in an isolated environment with restricted filesystem and network permissions.
  • Require explicit user confirmation that identifies the Skill and summarizes proposed dependency changes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The skill recommends rm -rf ~/.openclaw/workspace/temp/*.lock as a generic fix for task hangs, which can delete synchronization artifacts without confirming they are stale. In this skill's support context, users are likely to execute the command directly, potentially corrupting active workflows or masking the true root cause.

Content

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

bash
openclaw gateway restart
openclaw sessions kill <sessionId>
rm -rf ~/.openclaw/workspace/temp/*.lock

003 - 工具失效

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The skill recommends rm -rf ~/.openclaw/workspace/temp/*.lock as a generic fix for task hangs, which can delete synchronization artifacts without confirming they are stale. In this skill's support context, users are likely to execute the command directly, potentially corrupting active workflows or masking the true root cause.

Content

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

bash
openclaw gateway restart
openclaw sessions kill <sessionId>
rm -rf ~/.openclaw/workspace/temp/*.lock

003 - 工具失效

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

Deleting ~/.openclaw/skills-index.json is a file-destructive action presented as routine remediation, with no validation that the file is the correct target or that rescanning will succeed. The context makes it somewhat less dangerous because the file is apparently regenerable, but users could still lose local state or break skill discovery temporarily.

Content

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

010 - 技能加载失败

bash
cd ~/.openclaw/skills/<skillName> && npm install
rm ~/.openclaw/skills-index.json && openclaw skills scan

5. 复诊 (Follow-up)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill recommends restarting services, killing a session, and deleting lock files with rm -rf as part of routine troubleshooting, but provides no warning, backup guidance, or verification step. In an operational support skill, users may copy-paste these commands directly, causing loss of in-progress state or deleting the wrong files if path expansion behaves unexpectedly.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

005 - 记忆断裂

bash
chmod 644 ~/.openclaw/workspace/memory/*.md
chmod 644 ~/.openclaw/workspace/MEMORY.md

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

005 - 记忆断裂

bash
chmod 644 ~/.openclaw/workspace/memory/*.md
chmod 644 ~/.openclaw/workspace/MEMORY.md

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill advises changing file permissions on memory files to mode 644 without explaining that this makes them world-readable on many systems. Because these files may contain conversation memory or sensitive agent data, broadening read access can create local information disclosure risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs users to export a new API key and modify workspace permissions without warning that secrets can be exposed through shell history, process environment leakage, or persistent session configuration. In a troubleshooting context, users are especially likely to follow such guidance verbatim, increasing the risk of credential disclosure and unintended access expansion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill tells users to delete the skills index and immediately rescan, but does not warn that deleting the index may temporarily disrupt skill discovery or fail if regeneration does not succeed. While lower impact than other issues, troubleshooting guidance that includes file deletion should clearly describe expected regeneration behavior and failure modes.

Content

No source excerpt is available for this finding.