OpenClaw 'ClawJacked': Website-to-Local Agent Takeover via Loopback Trust and WebSocket Abuse
Oasis Security showed in its early-2026 tests that a malicious website could open a WebSocket to OpenClaw's localhost gateway (the local management entry point for an agent platform), skip origin checks by claiming a CLI client, then brute-force password auth because loopback attempts were exempt from rate limits. The fix is already out; the lesson is to stop treating localhost as identity and to scope every agent session and RPC method as privileged.
Threat Analysis
- Three trust failures chained together. Origin validation applied only to certain client IDs, localhost pairings were auto-approved, and loopback password guesses skipped throttling and logging.
- The browser was the real remote party. In Oasis's early-2026 browser tests, Chrome, Edge and most Firefox configurations allowed a public HTTPS page to reach loopback, while Safari blocked the insecure WebSocket. In those tested configurations, a public HTTPS page could open
ws://127.0.0.1:18789/ws; trusting loopback over origin collapsed the boundary. - Authenticated impact was full control-plane access. The whitepaper shows reachable methods for chat hijack, config changes, node command dispatch, agent file writes, scheduled jobs, and log access.
- Passwords were not meaningful protection. Oasis measured 300+ guesses per second from browser JavaScript, so a human-chosen gateway password was effectively bypassable.
- Local agent gateways are admin APIs. Pairing, session creation, and high-impact RPC methods need the same hardening you would apply to any internet-facing control plane.
Applicable AIDEFEND Defenses (7)
agents.files.* or automation endpoints into a durable backdoor.What Defenders Should Do Now
- Inventory OpenClaw or similar local agent gateways across endpoints, especially anything listening on port
18789, and upgrade all instances to version2026.2.25or later. - If password authentication is still enabled, prefer high-entropy tokens, remove stale paired devices, and rotate device tokens after any suspected exposure.
- Put browser-originated management actions behind explicit approval or an outright deny path: new pairings,
node.invoke, config writes, agent file writes, skill installs, and scheduled jobs. - Log and alert on loopback auth bursts, client-ID/origin mismatches, first-time pairings, and unexpected administrative RPC usage.
- Audit what each OpenClaw instance can actually reach - AI provider keys, messaging channels, shell execution, workspace files, and logs - then cut standing access to the minimum necessary.
1 additional consideration
Browser-to-localhost exposure regression testing
Conclusion
OpenClaw is a strong reminder that localhost is not a security boundary when the browser can still speak WebSocket to it. The defensive floor is to bind agent authority to verified runtime identity, narrow every session and RPC method to the smallest usable scope, and test local agent gateways the way you would test any privileged control-plane API.
Last updated: