Back to skill

Security audit

OpenClaw Docker Linux

Security checks for vulnerabilities and agentic risk

Overview

This Docker deployment guide requests powerful access, but clearly discloses the risks and keeps its behavior aligned with installing and managing OpenClaw.

Review the scripts before deployment, verify and pin the container image, keep host port publishing on 127.0.0.1, and leave unnecessary credential mounts disabled. Docker group membership grants lasting root-equivalent access. Protect .env and OpenClaw state, restrict your tailnet, and verify forwarding is removed when stopping. All bundled files were reviewed; downloaded dependencies remain outside this inspection.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (88)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
use Tailscale Serve or MagicDNS instead. The host-level global-install path in `references/troubleshooting.md` is optional, explicitly gated, and binds to `loop

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `references/troubleshooting.md` — Common errors and fixes

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

text

3. **Create `docker-compose.yml`** using the token from onboard.
   See `references/docker-config.md` for the full template and .env setup.

4. **Start the container:**
   ```bash

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 186)May include surrounding context.

sh
show_info() {
    # Get token from .env. Mask it to reveal only the first 4 characters —
    # never print the token itself or enough of it to reconstruct.
    TOKEN=$(grep OPENCLAW_GATEWAY_TOKEN .env | cut -d '=' -f2)
    MASKED_TOKEN="${TOKEN:0:4}..."
    
    # Get the Tailscale serve hostname if available. The serve hostname is

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/quickstart.md (reported line 19)May include surrounding context.

2. Create .env file

bash
cat > .env << 'EOF'
# AI Model API Key (REQUIRED - at least one)
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
# OPENAI_API_KEY=sk-your-key-here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## References

- `references/common-usage.md` — Day-to-day commands
- `references/docker-config.md` — docker-compose.yml, .env template, permissions, Tailscale, management script
- `references/quickstart.md` — Simple 5-minute setup guide
- `references/docker-setup.sh` — Management script (start/stop/logs/doctor/tailscale/approve_telegram)
- `references/gotchas.md` — Critical mistakes and how to avoid them

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 57)May include surrounding context.

sh
print_success "Docker and Docker Compose are installed"
}

# Check .env file
check_env() {
    if [ ! -f .env ]; then
        print_error ".env file not found!"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 59)May include surrounding context.

sh
# Check .env file
check_env() {
    if [ ! -f .env ]; then
        print_error ".env file not found!"
        echo ""
        echo "Please create a .env file with your configuration:"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 60)May include surrounding context.

sh
# Check .env file
check_env() {
    if [ ! -f .env ]; then
        print_error ".env file not found!"
        echo ""
        echo "Please create a .env file with your configuration:"
        echo "  cp .env.example .env"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 62)May include surrounding context.

sh
if [ ! -f .env ]; then
        print_error ".env file not found!"
        echo ""
        echo "Please create a .env file with your configuration:"
        echo "  cp .env.example .env"
        echo "  nano .env"
        echo ""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 74)May include surrounding context.

sh
# Check for required keys
    if ! grep -q "ANTHROPIC_API_KEY\|OPENAI_API_KEY" .env; then
        print_warning "No AI API key found in .env file"
    fi
    
    if ! grep -q "OPENCLAW_GATEWAY_TOKEN" .env; then

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 78)May include surrounding context.

sh
fi
    
    if ! grep -q "OPENCLAW_GATEWAY_TOKEN" .env; then
        print_warning "OPENCLAW_GATEWAY_TOKEN not set in .env file"
    fi
    
    print_success ".env file found"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 81)May include surrounding context.

sh
print_warning "OPENCLAW_GATEWAY_TOKEN not set in .env file"
    fi
    
    print_success ".env file found"
}

# Fix config if needed

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/quickstart.md (reported line 34)May include surrounding context.

SLACK_BOT_TOKEN=

EOF

Lock it down before adding real secrets — .env holds your gateway token

and model API keys.

chmod 600 .env

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/quickstart.md (reported line 36)May include surrounding context.

Lock it down before adding real secrets — .env holds your gateway token

and model API keys.

chmod 600 .env

text

### 3. Create `docker-compose.yml`

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-config.md (reported line 94)May include surrounding context.

md
> Replace `YOUR_USERNAME` with your actual Linux username throughout.
> Remove volume mounts you don't need (e.g. Linuxbrew, npm-global, gh config).

## .env Template

Create `.env` in the same directory as `docker-compose.yml`:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-config.md (reported line 227)May include surrounding context.

bash
# Install
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | \
  sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null

curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | \
  sudo tee /etc/apt/sources.list.d/tailscale.list

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-config.md (reported line 227)May include surrounding context.

bash
# Install
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | \
  sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null

curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | \
  sudo tee /etc/apt/sources.list.d/tailscale.list

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-config.md (reported line 229)May include surrounding context.

md
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | \
  sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null

curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | \
  sudo tee /etc/apt/sources.list.d/tailscale.list

sudo apt-get update && sudo apt-get install tailscale

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/docker-config.md (reported line 232)May include surrounding context.

md
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | \
  sudo tee /etc/apt/sources.list.d/tailscale.list

sudo apt-get update && sudo apt-get install tailscale

# Connect
sudo tailscale up

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 63)May include surrounding context.

sh
print_error ".env file not found!"
        echo ""
        echo "Please create a .env file with your configuration:"
        echo "  cp .env.example .env"
        echo "  nano .env"
        echo ""
        echo "Required variables:"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/docker-setup.sh (reported line 64)May include surrounding context.

sh
echo ""
        echo "Please create a .env file with your configuration:"
        echo "  cp .env.example .env"
        echo "  nano .env"
        echo ""
        echo "Required variables:"
        echo "  - ANTHROPIC_API_KEY or OPENAI_API_KEY"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/troubleshooting.md (reported line 419)May include surrounding context.

Cleanup (optional):

bash
# Remove systemd service files
sudo rm /etc/systemd/system/openclaw.service
sudo systemctl daemon-reload

# Or uninstall global OpenClaw

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 · SKILL.md (reported line 25)May include surrounding context.

md
This skill involves elevated privileges and credential management. Review before running:

- **sudo operations** — All Docker setup commands require elevated trust. Review `references/docker-setup.sh` before executing.
- **Tailscale remote access** — Enables network access to your OpenClaw instance. Ensure your Tailscale network policy allows this and review your firewall rules.
- **Credential mounting** — Mounting `~/.config/gh` or other credential directories into containers exposes them to the container image. Only do this if you fully trust the image source.
- **Host file exposure** — Volume mounts give containers access to host files. Be careful which directories you mount and which containers you run.

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 · references/docker-setup.sh (reported line 280)May include surrounding context.

sh
if ! command -v tailscale &> /dev/null; then
        print_error "Tailscale not installed"
        echo ""
        echo "Install with: sudo apt install tailscale"
        echo "Then run: sudo tailscale up"
        exit 1
    fi