OpenClaw Security Hardening
CVE-2026-25253 affected 17,500+ exposed instances. 63% of publicly accessible OpenClaw deployments had critical misconfigurations. Here’s how to not be one of them.
Publicly exposed OpenClaw instances found by researchers in early 2026
Had at least one critical misconfiguration enabling unauthorized access
Malicious skills identified on ClawHub — including credential-stealing malware
Secure the Gateway Critical
The Gateway is OpenClaw’s entry point — leaving it exposed or with a weak token is the #1 security mistake.
Set a strong gateway auth token
Your .env file must contain a strong, unique token. This token is required to connect any client to your Gateway.
Tokens like “password123”, “openclaw”, or anything short are trivially brute-forceable. Use at least 32 random characters. The openssl rand -hex 32 command generates an ideal token.
Do NOT expose port 3000 to the internet
Your Docker Compose file should bind OpenClaw’s port to localhost only:
Enable the gateway password or token requirement
In your .env file, ensure authentication is required for all connections:
Harden SSH Access Critical
SSH is your server’s front door. Switch from passwords to keys, and lock down who can get in.
Step 1: Generate an SSH key pair on your local machine
Step 2: Copy your public key to the server
Step 3: Test key-based login before disabling passwords
Step 4: Disable password authentication
Always test key-based SSH login in a separate window BEFORE restarting sshd and disabling passwords. If you lock yourself out, you’ll need to use your hosting provider’s console access to recover.
Configure UFW Firewall High
UFW (Uncomplicated Firewall) is Ubuntu’s built-in firewall. Configure it to allow only necessary traffic.
Port 3000 (OpenClaw’s Control UI) should never be open in your firewall. Access it exclusively via SSH tunnel. Opening this port exposes your entire agent interface to the internet.
Install and configure fail2ban
Fail2ban automatically bans IP addresses that show malicious behaviour — like repeated failed SSH logins.
Access the Control UI Securely High
There are two secure ways to access OpenClaw’s Control UI — SSH tunnel (simplest) or Tailscale (best for teams).
Option A: SSH Tunnel (recommended for individuals)
Run this on your local machine whenever you need to access the Control UI:
Keep this terminal open. Then visit http://localhost:3000 in your browser. Close the terminal when done.
Option B: Tailscale (recommended for persistent access or teams)
Tailscale creates a private encrypted network between your devices and your VPS.
Now access the Control UI at http://100.x.x.x:3000 from any device on your Tailscale network.
Multiple team members can securely access the same OpenClaw instance without each running an SSH tunnel. No port forwarding, no firewall rules — Tailscale’s zero-config mesh network handles everything.
Protect Your API Keys Critical
Your AI API keys are the most sensitive data on your server. Any skill installed on OpenClaw has potential access to the .env file — including malicious ones.
File permissions
Set strict spending limits on every AI provider
- Anthropic Console
console.anthropic.com → Settings → Limits → Set a monthly spend cap - OpenAI Platform
platform.openai.com → Settings → Limits → Set usage limit - Google AI Studio
Free tier has built-in quotas; for paid use, set billing limits in Google Cloud Console
Consider using separate API keys per deployment
Create a dedicated API key for OpenClaw rather than using your main account key. If the key is ever compromised, you can rotate it without affecting other tools.
If you’re using Git to manage your OpenClaw configuration, ensure .env is in your .gitignore. Hundreds of API keys have been compromised this way.
Vet ClawHub Skills Before Installing High
In January 2026, a campaign called ClawHavoc distributed credential-stealing malware through 341 malicious ClawHub skills. Here’s how to protect yourself.
Red flags to look for before installing a skill
- Unverified publisher
Prefer skills from verified publishers (blue checkmark). Be extremely cautious with anonymous or newly registered publishers. - Suspicious permissions
A “YouTube downloader” skill that requests file system access and network permissions to arbitrary IPs is a red flag. Permissions should match the stated purpose. - Impersonating popular tools
The ClawHavoc campaign specifically impersonated crypto utilities, YouTube tools, and prediction market bots. If a skill claims to do something very popular, verify the publisher carefully. - No source code or recent activity
Open source skills you can audit are far safer. Check if the skill has been updated recently and whether it has community reviews. - Very new or zero reviews
A skill published yesterday with zero reviews and high install counts is suspicious.
Start with zero skills and add only what you actually use. Each skill you install increases your attack surface. Review your installed skills quarterly and remove any you no longer use.
Stay Updated on CVEs Critical
When CVE-2026-25253 was disclosed, managed hosting providers patched their entire fleet within hours. Self-hosters who weren’t monitoring went weeks without patching. Automate this.
Create an automated weekly update script
Schedule it with cron (runs every Sunday at 3 AM)
Where to monitor for OpenClaw security advisories
- OpenClaw GitHub repository
Watch the repo and enable security advisory notifications in GitHub settings - OpenClaw Discord #security channel
Critical vulnerabilities are announced here first - NVD (National Vulnerability Database)
Search for “openclaw” at nvd.nist.gov for official CVE listings
Complete Security Checklist
Use this as your final verification before going live. Check off each item.
- Gateway auth token set — Strong 32+ character token in .env
- Port 3000 NOT open in firewall — Access via SSH tunnel only
- Port binding is 127.0.0.1:3000 — Not 0.0.0.0:3000 in docker-compose.yml
- SSH keys enabled, passwords disabled — PasswordAuthentication no in sshd_config
- UFW firewall active — Only ports 22, 80, 443 open (and 22 only to your IP ideally)
- fail2ban running — sudo systemctl status fail2ban
- .env file permissions set to 600 — chmod 600 .env
- AI provider spending limits set — For all providers you use
- Root login disabled — PermitRootLogin no in sshd_config
- Weekly update cron job active — crontab -l to verify
- Only necessary skills installed — Remove any unused skills
- GitHub security advisories enabled — Watch the OpenClaw repo
Server Secured — Next Steps
With security in place, protect yourself from the other major risk: runaway AI API costs from agent loops.
Prevent Runaway API Costs → ← Back to Installation Guide
