Hacking OpenClaw 🦞
A vulnerability in OpenClaw allowed an attacker to steal a gateway token by tricking a user into clicking a malicious link, leading to full account takeover and arbitrary code execution. The attack exploited a crafted gatewayUrl parameter that opened a WebSocket to an attacker-controlled server, leaking the token stored in localStorage.
Published on infosecwriteups.com
If you’ve been following recent AI trends, you’ve probably come across Clawdbot, Moltbot, or what is now called OpenClaw, after a brief but chaotic rebranding frenzy.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application accepted a user-supplied gatewayUrl parameter and initiated a WebSocket connection to it without validating the origin, causing the stored token to be sent to an attacker-controlled server.
Impact
An attacker could steal a valid gateway token, leading to full account takeover and arbitrary code execution with the same trust as the legitimate user; the attack works even for locally hosted gateways, though version 2026.1.29 mitigates it by requiring user confirmation.
What the attacker needed
Victim clicks a malicious link; victim has OpenClaw gateway running; attacker controls a WebSocket server
The fix
Starting with version 2026.1.29, OpenClaw mitigates the issue by requiring explicit user confirmation before initiating the connection.
How it was found
- The attacker crafts a malicious link that includes a gatewayUrl parameter pointing to their own WebSocket server.
- The victim clicks the link, which opens their local OpenClaw gateway URL.
- The browser establishes a WebSocket connection to the attacker's server.
- The gateway token stored in localStorage is forwarded to the attacker's WebSocket.
- The attacker uses the stolen token to send arbitrary requests to the assistant, achieving code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
OpenClaw is an AI assistant that runs on your computer. A security flaw let a bad website steal a special key (token) that proves you are logged in, by making your browser send it to the attacker. With that key, the attacker could control the assistant and run commands on your machine.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.