T08 · Insecure Dependencies
- Location
SKILL.md:134- Finding
Unpinned npm Package Execution and Privileged Installation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its reinstall purpose, but it asks users to run powerful cleanup and install commands that could delete sensitive OpenClaw data or execute unverified npm code with elevated privileges.
Install only if you are comfortable reviewing and adapting the commands. Before running it, make an encrypted verified backup, avoid sudo npm and @latest where possible, use a trusted pinned OpenClaw version or verified local binary, inspect what will be restored, and prefer renaming old directories over immediately deleting them.
SKILL.md:134Unpinned npm Package Execution and Privileged Installation
SKILL.md:88Unsafe Destructive Cleanup and Broad Process Termination
The broader pattern match on rm -rf ~ reflects that home-directory-rooted recursive deletions are inherently hazardous even when the suffix narrows scope. In shell documentation, such commands deserve special care because small edits, variable expansion issues, or formatting mistakes can widen deletion scope dramatically.
sudo npm uninstall -g openclaw
rm -rf ~/.openclaw rm -rf ~/.openclaw-dev
The broader pattern match on rm -rf ~ reflects that home-directory-rooted recursive deletions are inherently hazardous even when the suffix narrows scope. In shell documentation, such commands deserve special care because small edits, variable expansion issues, or formatting mistakes can widen deletion scope dramatically.
sudo npm uninstall -g openclaw
rm -rf ~/.openclaw rm -rf ~/.openclaw-dev
Even though the intended target is ~/.openclaw-dev, the use of rm -rf under the home directory falls into a class of commands with high misuse potential. In a skill designed for broad user execution, destructive shell commands are more dangerous because many users will copy them verbatim without validating the target.
rm -rf ~/.openclaw rm -rf ~/.openclaw-dev
### Step 6: Install Latest OpenClaw
Even though the intended target is ~/.openclaw-dev, the use of rm -rf under the home directory falls into a class of commands with high misuse potential. In a skill designed for broad user execution, destructive shell commands are more dangerous because many users will copy them verbatim without validating the target.
rm -rf ~/.openclaw rm -rf ~/.openclaw-dev
### Step 6: Install Latest OpenClaw
The skill repeatedly instructs users to run npx openclaw without pinning a specific package version. npx may fetch and execute the latest published package, so a compromised or malicious upstream release could result in arbitrary code execution during uninstall, doctor, gateway, or status operations.
The skill explicitly preserves and restores full user state including credentials, devices, memory databases, agents, and installed skills. While persistence is the purpose of a reinstall backup, from a security perspective it also preserves potentially compromised sessions, stale tokens, malicious skills, and unauthorized paired-device state across the reinstall.
Create a complete backup of all user configurations:
# Create backup directory with timestamp
The backup guidance copies ~/.openclaw, which the document explicitly says contains tokens, API keys, credentials, paired-device data, and memory files, yet it does not warn that the backup itself becomes a high-value secret bundle. Recommending cloud or external storage without encryption guidance increases the chance of credential disclosure and account compromise.
This invocation uses npx openclaw without a pinned version, allowing execution of whatever version npm resolves at runtime. In a reinstall workflow, that expands trust to the package registry during a sensitive maintenance operation and can lead to arbitrary code execution if the package or dependency chain is compromised.
The skill documents destructive uninstall and rm -rf cleanup steps, but the warnings are not explicit enough about irreversible loss if the backup is incomplete, corrupt, or restores incorrectly. In a workflow that touches credentials, memory databases, skills, and workspace data, this can cause permanent loss or partial state corruption.
An unpinned npx openclaw command in an uninstall step can execute unexpected code from a newly published package version. Because this command is part of a privileged maintenance path and may be run by administrators, the blast radius includes deletion, persistence changes, and credential exposure.
This unpinned npx openclaw usage relies on live package resolution, which can execute attacker-controlled code if the npm package is hijacked or replaced. Since it occurs during uninstall guidance, users may run it assuming it is safe while granting it broad access to local state.
The use of sudo npm uninstall -g openclaw requires elevated privileges and can magnify the impact of mistakes or malicious package lifecycle behavior. Although common in system-wide package management, recommending privileged npm operations in a skill increases risk, especially in a document already relying on registry-fetched packages.
npm cache clean --force
# Remove old OpenClaw npm package if still exists
sudo npm uninstall -g openclaw
# Remove any remaining .openclaw directories
rm -rf ~/.openclaw
sudo npm install -g openclaw@latest combines root privileges with installation of the latest available registry package, creating a strong supply-chain and privilege-escalation risk. A compromised or typo-squatted package executed during installation could run arbitrary code as root.
# Install globally
sudo npm install -g openclaw@latest
# Verify installation
npx openclaw --version
The verification command uses npx openclaw without pinning, which can trigger download and execution of an unexpected version even immediately after installation. That undermines trust in the reinstall process and creates an avoidable supply-chain execution point.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp -r ~/openclaw-backup-YYYYMMDD/* ~/.openclaw/
chmod 700 ~/.openclaw
### Step 8: Run Health Check and Fix
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp -r ~/openclaw-backup-YYYYMMDD/* ~/.openclaw/
chmod 700 ~/.openclaw
### Step 8: Run Health Check and Fix
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp -r ~/openclaw-backup-YYYYMMDD/* ~/.openclaw/
chmod 700 ~/.openclaw
### Step 8: Run Health Check and Fix
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp -r ~/openclaw-backup-YYYYMMDD/* ~/.openclaw/
chmod 700 ~/.openclaw
### Step 8: Run Health Check and Fix
Running npx openclaw doctor --fix without version pinning allows arbitrary code execution through package resolution at runtime. The --fix behavior also suggests state-changing actions, making compromise potentially more damaging than a read-only check.
Starting the gateway via unpinned npx openclaw can execute a malicious package version and establish persistence or network exposure. Because this command launches a service, compromise could result in long-lived unauthorized access or credential harvesting.
The health check command uses npx openclaw without version pinning, creating another supply-chain execution point. Even though it sounds diagnostic, the command still grants code execution in the user's environment if npm resolves a malicious package.
The status command is also unpinned and may fetch and run an untrusted package version. While the immediate action is informational, compromise still enables arbitrary code execution in a context where sensitive config and credentials are present.
The one-liner backup script automates persistence of all OpenClaw state into a timestamped archive, which can carry forward sensitive sessions and previously compromised configuration. In a reinstall context, this makes cleanup less effective if the original environment was tampered with.
Run this before uninstalling to create a timestamped backup:
# Create automatic backup
The troubleshooting stop command again uses unpinned npx openclaw, exposing users to the same package-resolution risk during incident handling. Security-sensitive recovery steps are especially dangerous places to introduce unauthenticated remote code execution paths.
The force-start troubleshooting command uses unpinned npx openclaw, which may execute a malicious version precisely when the user is bypassing safeguards with --force. That combination increases the risk of unsafe state changes and persistence.