Back to skill

Security audit

Moltbot Security

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent security-hardening guide, but it includes copy-paste commands that execute mutable internet scripts and make privileged system changes without enough safety checks.

Review this skill before installing and do not paste the remote installer pipelines as-is. Prefer vendor package-manager instructions with signed repositories, inspect or verify downloaded installers, run non-mutating audit commands before `--fix`, and apply firewall or SSH changes only when you have console recovery access.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:182
Finding
Privileged Execution of a Mutable NodeSource Setup Script## Vulnerability Details **File Location**: `SKILL.md`, line 182 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical **Complete Code Snippet**: ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - ``` ### Technical Analysis The command downloads a mutable script from an external URL and pipes it directly into a privileged Bash process. The payload is not pinned to a specific immutable version, inspected before execution, or verified using a cryptographic checksum or signature. HTTPS provides transport protection but does not ensure that the script will remain unchanged after the Skill has been reviewed. A compromise of the upstream service, publishing infrastructure, account, or trusted delivery chain could therefore replace the effective payload. The use of `sudo -E` makes the issue especially severe: the downloaded script executes with root privileges while preserving environment variables from the calling user. Direct root execution exceeds the privileges needed merely to download repository configuration and prevents the user from reviewing the code before it runs. ### Attack Path 1. An attacker compromises the NodeSource hosting or publishing infrastructure, or otherwise causes the URL to return a malicious script. 2. A user follows the Skill's Node.js installation instructions. 3. `curl` downloads the attacker-controlled response. 4. The pipe passes the response directly to `sudo -E bash`. 5. Bash executes the payload as root without integrity verification or a review step. 6. The payload can alter system files, install software or persistence mechanisms, access root-readable data, or take complete control of the host. ### Impact Assessment Successful exploitation provides arbitrary code execution with root privileges. The potential scope includes the entire host: system configuration, installed software, local user data, credentials readable by root, network settings, services, and secu ...[truncated 189 chars]
Remediation
## Remediation Suggestions - Prefer the operating system's signed package repositories or a repository setup procedure that uses explicit package-signing verification. - Do not pipe downloaded content directly into a shell. - If an external setup artifact is unavoidable: 1. Download a versioned artifact to a local file. 2. Obtain the expected checksum or signature through a trustworthy, independent channel. 3. Verify the artifact cryptographically. 4. Review the downloaded script before execution. 5. Run only the specific privileged operations that are necessary. - Avoid `sudo -E`; explicitly pass only required, non-sensitive environment variables. - Pin repository keys and verify their fingerprints rather than trusting mutable bootstrap content.

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:198
Finding
Direct Execution of a Mutable Tailscale Installation Script## Vulnerability Details **File Location**: `SKILL.md`, line 198 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Complete Code Snippet**: ```bash curl -fsSL https://tailscale.com/install.sh | sh ``` ### Technical Analysis The instruction retrieves executable shell content from an external URL and immediately passes it to `sh`. The response is not pinned, saved for review, or validated with a cryptographic checksum or signature. Because the URL is mutable, the effective code can change after the Skill has been audited. HTTPS alone does not protect against compromise of the legitimate upstream publisher or its infrastructure. The installation script may also invoke privilege-elevation mechanisms as part of package installation, increasing the possible impact beyond the invoking account. This approach is not the minimum-risk method necessary to install Tailscale. Signed package repositories or separately downloaded and verified artifacts provide stronger review and integrity boundaries. ### Attack Path 1. An attacker compromises the Tailscale script-hosting or publishing infrastructure, or causes the endpoint to serve modified content. 2. A user follows the documented installation command. 3. `curl` retrieves the modified script. 4. The shell executes the response immediately, without verification or inspection. 5. The payload runs with the user's privileges and may attempt or request elevation during installation. 6. The attacker can modify accessible files, steal user-readable information, execute additional payloads, or potentially compromise the host if elevation succeeds. ### Impact Assessment At minimum, successful exploitation provides arbitrary command execution as the invoking user, affecting that user's files, credentials, processes, and accessible resources. If the installer obtains elevated privileges, the scope can expand to system-wide compromise. No malicious payload was embedded in the audited proje ...[truncated 72 chars]
Remediation
## Remediation Suggestions - Prefer installation through an operating system package manager using a repository with verified package signatures. - Replace the shell pipeline with separate download, verification, inspection, and execution steps. - Pin the downloaded installer or package to a specific version. - Publish and verify a cryptographic checksum or signature before execution. - Clearly disclose any privilege escalation performed by the installer and limit elevated operations to those strictly required. - If a verified package-manager procedure is unavailable, instruct users to consult the vendor's installation documentation rather than embedding an unverified remote-shell pipeline.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (23)

Chaining Abuse

High
Category
Tool Misuse
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```
Confidence
98% confidence
Finding
This pipeline chains a network fetch directly into a privileged shell, collapsing download, trust, and execution into one step. That removes opportunities for validation and makes compromise of the remote source immediately equivalent to root code execution on the host.

External Script Fetching

High
Category
Supply Chain
Content
```bash
# Linux
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

# Mac
Confidence
98% confidence
Finding
Piping `curl -fsSL https://tailscale.com/install.sh | sh` executes unaudited code fetched at runtime from the network. If the remote server, CDN path, TLS trust chain, or local network path is compromised, the user will run attacker-supplied shell commands immediately.

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
# Linux
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

# Mac
Confidence
97% confidence
Finding
The `| sh` pattern is a classic unsafe command chain because it executes whatever bytes are returned over the network without review. In a skill meant for security hardening, this is especially risky because users are likely to trust and run commands verbatim.

Chaining Abuse

High
Category
Tool Misuse
Content
**Install UFW:**
```bash
sudo apt update && sudo apt install ufw -y
```

**Set defaults:**
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The README presents `clawdbot security audit --deep --fix` as a quick audit command, but the `--fix` flag implies automatic system modifications and no warning is given that it may change configuration, permissions, or network exposure. In an agent-skill context, users or automated tooling may copy or invoke this command verbatim, causing unintended changes without prior review or confirmation.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**What this does:** Ensures only you can read sensitive config files.

```bash
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
chmod 700 ~/.openclaw/credentials
```
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**What this does:** Ensures only you can read sensitive config files.

```bash
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
chmod 700 ~/.openclaw/credentials
```
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
chmod 700 ~/.openclaw/credentials
```
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Session Persistence

Medium
Category
Rogue Agent
Content
**Permission meanings:**
- `700` = Only owner can access folder
- `600` = Only owner can read/write file

Or let OpenClaw fix it:
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```
Confidence
95% confidence
Finding
The `sudo -E` form specifically preserves environment variables when escalating privileges, which can unintentionally pass attacker-controlled or sensitive environment state into the root shell. Combined with piping remote content to bash, this materially increases risk.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```
Confidence
95% confidence
Finding
The `sudo -E` form specifically preserves environment variables when escalating privileges, which can unintentionally pass attacker-controlled or sensitive environment state into the root shell. Combined with piping remote content to bash, this materially increases risk.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu/Debian:**
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
```

**Windows:** Download from [nodejs.org](https://nodejs.org/)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

No suspicious patterns detected.