RCE in Visual Studio Code's Remote WSL for Fun and Negative Profit
The VS Code server used by the Remote WSL extension used a local WebSocket connection. JavaScript in websites could connect to it and execute arbitrary commands on the target system.
Published on parsiya.net
The Visual Studio Code server in Windows Subsystem for Linux uses a local WebSocket WebSocket connection to communicate with the Remote WSL extension. JavaScript in websites can connect to this server and execute arbitrary commands on the target 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
Impact
A website could connect to the local server and execute arbitrary commands on the target system.
What the attacker needed
VS Code with Remote WSL extension; Victim visits a malicious page
How it was found
- Use the inspector to execute arbitrary code on the target machine.
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.
When you use VS Code inside Windows Subsystem for Linux, a helper server runs in the background. A malicious web page you visited could connect to it and make it run commands on your computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.