Back to skill

Security audit

OpenClaw Direct Setup

Security checks for vulnerabilities and agentic risk

Overview

This installer is mostly aligned with setting up OpenClaw, but it performs high-impact system and supply-chain actions that are under-scoped or misleading in places.

Review setup.sh before installing. Avoid running the automatic installer as-is on a primary machine; install Ollama manually, pin or verify package versions where possible, skip unneeded extra skills, and do not accept the firewalld firewall change. Treat ~/.openclaw/openclaw.json as sensitive because it can contain gateway tokens and API keys, and back it up before using the documented rm -rf uninstall command.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
setup.sh:48
Finding

Unverified Remote Installer Is Downloaded and Executed Directly

Content
View full analysis
/dev/null; then echo "Ollama not found. Installing..." if command -v curl &> /dev/null; then curl -fsSL https://ollama.com/install.sh | sh else echo "ERROR: curl not found. Install Ollama manually from https://ollama.com" read -p "Press Enter to exit..." exit 1 fi fi ``` ### Technical Analysis The installer downloads a mutable shell script from `https://ollama.com/install.sh` and pipes the response directly into `sh`. The payload is not pinned to a version and is not authenticated through a published cryptographic signature or expected hash. The user also has no opportunity to inspect the downloaded content before execution. HTTPS provides transport protection but does not protect against compromise of the upstream server, DNS or certificate infrastructure, or the remote installation script itself. Any change to the remote response changes the code executed by an already-reviewed copy of this Skill. Installing Ollama may support the local-model workflow, but immediate execution of an unverified remote script is not the minimum privilege or minimum trust approach required for that functionality. The installer could instead require a preinstalled Ollama binary or retrieve and verify a versioned release artifact. ### Attack Path 1. An attacker compromises the upstream installer endpoint, its deployment pipeline, or another component capable of changing the response. 2. A user without an existing `ollama` executable runs `bash setup.sh`. 3. `curl` retrieves the attacker-controlled response. 4. The response is passed directly to `sh` without verification or review. 5. The payload executes with all permissions of the invoking user. 6. If the remote payload requests elevation and the us ...[truncated 454 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
setup.sh:115
Finding

Unpinned Global Packages and Agent Skills Create Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
create-config.js:6
Finding

Gateway Authentication Token Uses Weak Randomness and Is Written Without Explicit Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
setup.sh:138
Finding

Default Firewall Hardening Path Permanently Opens the Gateway Port

Content
View full analysis
/dev/null; then sudo ufw deny from any to any port $PORT proto tcp 2>/dev/null && \ echo "[OK] UFW rule added - external access blocked" || \ echo "[WARNING] Could not create UFW rule (localhost binding still protects)" elif command -v firewall-cmd &> /dev/null; then sudo firewall-cmd --permanent --add-port=$PORT/tcp 2>/dev/null && \ sudo firewall-cmd --reload && \ echo "[OK] firewalld rule added" || \ echo "[WARNING] Could not create firewalld rule" ``` ### Technical Analysis The prompt claims that the operation will block external access, and acceptance is the default. The UFW branch creates a deny rule, but the firewalld branch executes: ```bash firewall-cmd --permanent --add-port=$PORT/tcp ``` In firewalld, `--add-port` allows traffic to that port in the applicable zone; it does not deny external access. The script then reloads the firewall, making the rule active and persistent. This contradicts the stated security purpose. The generated OpenClaw configuration currently binds the gateway to `127.0.0.1`, which prevents the gateway itself from listening on external interfaces. Nevertheless, opening the firewall port is unnecessary and weakens defense in depth. It may expose another service already using that port or expose OpenClaw if its binding is later changed. The oper ...[truncated 1267 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (22)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The README recommends a forceful recursive delete of ~/.openclaw during uninstall. Even though it is limited to the application's directory, this can erase user workspace contents, configuration, and tokens without confirmation, making accidental destructive execution plausible in a one-click installer context.

Content

Scanner excerpt · README.md (reported line 90)May include surrounding context.

bash
npm uninstall -g openclaw
rm -rf ~/.openclaw

Problems?

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The README recommends a forceful recursive delete of ~/.openclaw during uninstall. Even though it is limited to the application's directory, this can erase user workspace contents, configuration, and tokens without confirmation, making accidental destructive execution plausible in a one-click installer context.

Content

Scanner excerpt · README.md (reported line 90)May include surrounding context.

bash
npm uninstall -g openclaw
rm -rf ~/.openclaw

Problems?

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

bash
npm uninstall -g openclaw
rm -rf ~/.openclaw

Scripts

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

bash
npm uninstall -g openclaw
rm -rf ~/.openclaw

Scripts

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

Fetching an external script from the internet during setup creates a strong supply-chain risk, especially because the content is not pinned, verified, or reviewed locally first. In an installer context this is more dangerous because users are primed to grant trust and the script is intended to modify the system.

Content

Scanner excerpt · setup.sh (reported line 51)May include surrounding context.

sh
echo "[3/6] Checking Ollama..."
if ! command -v ollama &> /dev/null; then
    echo "Ollama not found. Installing..."
    if command -v curl &> /dev/null; then
        curl -fsSL https://ollama.com/install.sh | sh
    else
        echo "ERROR: curl not found. Install Ollama manually from https://ollama.com"

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

Piping curl output directly into 'sh' is a classic unsafe chaining pattern that grants immediate code execution to whatever the remote server returns. In an installation script, this can fully compromise the user's account and system state with no inspection point, making the context especially dangerous.

Content

Scanner excerpt · setup.sh (reported line 52)May include surrounding context.

sh
if ! command -v ollama &> /dev/null; then
    echo "Ollama not found. Installing..."
    if command -v curl &> /dev/null; then
        curl -fsSL https://ollama.com/install.sh | sh
    else
        echo "ERROR: curl not found. Install Ollama manually from https://ollama.com"
        read -p "Press Enter to exit..."

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script claims it will block external access, but the firewalld branch runs '--add-port=$PORT/tcp', which opens the port rather than denying it. This creates the opposite of the advertised protection and can expose the service to the network if OpenClaw binds beyond localhost now or in a future configuration change.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · README.md (reported line 13)May include surrounding context.

md
The script will:
1. Check if Node.js is installed
2. Install OpenClaw globally
3. Create config with your LLM settings
4. Start the gateway

That's it!

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · README.md (reported line 61)May include surrounding context.

OpenAI

text
LLM Base URL: https://api.openai.com/v1
LLM Model: gpt-4o

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 80)May include surrounding context.

OpenAI

text
LLM Base URL: https://api.openai.com/v1
LLM Model: gpt-4o

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README instructs users to run a destructive uninstall command that recursively deletes the entire ~/.openclaw directory, including configuration and workspace data, without warning that user data will be lost. In an installer skill, omission of a clear data-loss warning increases the chance of accidental destruction of local state and credentials stored in that directory.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises executable installer scripts and shell-based setup behavior, but the manifest does not declare any tool scope such as permissions or allowed-tools. This creates a transparency and review gap: users and platforms cannot easily understand that the skill expects shell/environment access before invocation, increasing the chance of unsafe execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The quick-start instructions tell users to run setup scripts and describe global npm installs, config creation, and service startup, but do not clearly warn that these actions modify the host system. Users may execute the installer without understanding that it writes files, installs software globally, and starts local services, which increases supply-chain and system-integrity risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs users to place an API key into ~/.openclaw/openclaw.json without explaining the security implications of storing credentials in a local plaintext config file. If file permissions are weak, backups are exposed, or the workspace is shared, the key could be disclosed and abused.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · setup.sh (reported line 18)May include surrounding context.

sh
if [ "$EUID" -eq 0 ]; then
    echo "[ERROR] Running as root detected!"
    echo ""
    echo "DO NOT run this script as root/sudo."
    echo "OpenClaw should run under your standard user account for security."
    echo ""
    echo "Please close this window and run normally."

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script exceeds its stated installer scope by fetching and executing Ollama's remote install script automatically. Because the downloaded script is executed immediately, any compromise of the upstream host, TLS interception, or unexpected installer behavior leads to arbitrary code execution on the user's machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A remote script is executed via shell without a clear warning or explicit user confirmation. This removes the user's opportunity to review or decline arbitrary code execution and makes compromise of the remote source immediately dangerous.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installer silently expands scope by globally installing ClawHub and additional third-party skills unrelated to the core OpenClaw setup. This increases the attack surface and trust footprint because users expecting only OpenClaw installation also receive extra code and capabilities from external packages/repositories.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · setup.sh (reported line 151)May include surrounding context.

sh
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
        # Linux - try ufw first, then firewall-cmd
        if command -v ufw &> /dev/null; then
            sudo ufw deny from any to any port $PORT proto tcp 2>/dev/null && \
                echo "[OK] UFW rule added - external access blocked" || \
                echo "[WARNING] Could not create UFW rule (localhost binding still protects)"
        elif command -v firewall-cmd &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · setup.sh (reported line 155)May include surrounding context.

sh
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
        # Linux - try ufw first, then firewall-cmd
        if command -v ufw &> /dev/null; then
            sudo ufw deny from any to any port $PORT proto tcp 2>/dev/null && \
                echo "[OK] UFW rule added - external access blocked" || \
                echo "[WARNING] Could not create UFW rule (localhost binding still protects)"
        elif command -v firewall-cmd &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · setup.sh (reported line 156)May include surrounding context.

sh
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
        # Linux - try ufw first, then firewall-cmd
        if command -v ufw &> /dev/null; then
            sudo ufw deny from any to any port $PORT proto tcp 2>/dev/null && \
                echo "[OK] UFW rule added - external access blocked" || \
                echo "[WARNING] Could not create UFW rule (localhost binding still protects)"
        elif command -v firewall-cmd &> /dev/null; then

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script performs global npm installs and installs additional skills without explicit confirmation, which can surprise users and introduce unreviewed code into the environment. While common in convenience installers, this behavior still broadens trust and persistence on the host.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.