1-Click RCE to steal your Moltbot data and keys
OpenClaw accepted a gatewayUrl query parameter and immediately connected to it, leaking the auth token to an attacker-controlled server. Combined with a missing WebSocket origin check, an attacker could use the stolen token to disable safety features and run arbitrary commands on the victim's machine.
depthfirst.com
Published on depthfirst.com
OpenClaw (formerly Moltbot and ClawdBot), the open-source AI personal assistant that can take actions on your behalf, is the most popular topic on X right now. It is already trusted by over 100,000 developers to hold the keys to their digital life, from iMessage/WhatsApp/Slack access to unrestricted local computer…
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
The application persisted an attacker-supplied gateway URL from a query parameter and immediately connected to it, sending the auth token, while the WebSocket server also failed to validate the origin header.
Impact
An attacker could steal the victim's data and keys and achieve remote code execution on the victim's machine, though the direct token-leak method alone did not work on localhost instances or bypass sandboxing until chained with the WebSocket origin flaw.
What the attacker needed
Victim visits a malicious webpage; victim runs OpenClaw (local or remote)
The fix
The issue was fixed by adding a gateway URL confirmation modal, removing the auto-connect-without-prompt behaviour.
How it was found
- Victim visits an attacker-controlled webpage.
- The page opens a background window to the victim's OpenClaw with a gatewayUrl parameter pointing to the attacker's server.
- The attacker receives the auth token over the WebSocket connection.
- The page opens a WebSocket to the victim's local OpenClaw and authenticates with the stolen token.
- The page sends API requests to disable user confirmation and sandboxing.
- The page sends a node.invoke request to run an arbitrary command.
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 a personal AI assistant that runs on your computer and can control it. A flaw let a malicious website trick the assistant into sending its secret login token to the attacker, who then used it to turn off safety prompts and run commands on the victim's machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.