1-click RCE on Keybase
Keybase clients allowed chat messages to contain specially crafted base64-encoded link objects that could display one URL but open another, and on Windows the URL could point to a local executable or an SMB share, leading to command execution when clicked. An attacker could send a payment request with a phishing link to achieve 1-click RCE on the victim's system.
Published on shielder.it
Keybase clients allowed to send links in chats with arbitrary schemes and arbitrary display text. On Windows it was possible to send an apparently harmless link which, when clicked, could execute arbitrary commands on the victim’s system.
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 client decoded a special base64-encoded link format from chat messages and used the 'url' field without validating the scheme, allowing local file paths or SMB paths to be opened.
What the attacker needed
Keybase account; Victim uses Windows client; Victim clicks the link
The fix
The fix removed the 'display' field and prefixed the 'url' field with 'http://' when it doesn't begin with 'http(s)://', preventing local and SMB paths.
How it was found
- Craft a base64-encoded JSON link object with a benign display URL and a malicious URL pointing to a local executable or SMB path.
- Send the crafted string as a chat message or payment request message.
- The victim clicks the displayed link, causing the client to open the malicious URL and execute the program.
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.
Keybase is a chat app. The bug let a sender craft a link that looked like one website but actually opened something else, like a program on the victim's computer. When the victim clicked it, the program ran, giving the attacker control.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.