Reverse RDP Attack: Code Execution on RDP Clients
Multiple vulnerabilities were found in RDP clients (rdesktop, FreeRDP, and Microsoft's mstsc) that allow a malicious RDP server to execute code on the connecting client's machine. Additionally, a path traversal flaw in Microsoft's clipboard sharing lets a malicious server drop arbitrary files on the client, and clipboard syncing allows eavesdropping and modification of clipboard content.
Published on research.checkpoint.com
However, Check Point Research recently discovered multiple critical vulnerabilities in the commonly used Remote Desktop Protocol (RDP) that would allow a malicious actor to reverse the usual direction of communication and infect the IT professional or security researcher’s computer. Such an infection could then allow…
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 multiple memory-safety bugs (integer overflows, underflows, and missing bounds checks) in RDP client implementations, plus missing path canonicalisation in clipboard file handling.
Impact
A malicious RDP server could execute arbitrary code on the client's machine (for open-source clients) or drop arbitrary files (for Microsoft's client, which Microsoft declined to patch), and could also read or modify the client's clipboard.
What the attacker needed
Victim connects to a malicious RDP server; clipboard sharing enabled (for path traversal)
The fix
FreeRDP and rdesktop released patches; for Microsoft's client, Microsoft stated the path traversal did not meet their servicing criteria, so no patch was issued, and users are advised to disable clipboard sharing.
How it was found
- Set up a malicious RDP server that sends crafted packets to the client.
- For rdesktop, send a chopped packet to trigger integer underflow and heap overflow in channels like lspci, rdpsnddbg, or seamless.
- For FreeRDP, send a bitmap update with dimensions causing integer overflow or truncation.
- For Microsoft's client, use the clipboard sharing feature to send a path traversal in the FileGroupDescriptor.
- The client stores the file outside the intended folder, allowing arbitrary file write.
- For clipboard eavesdropping, the server receives clipboard updates and can read or modify content.
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.
Remote Desktop Protocol (RDP) is used to connect to another computer remotely. Normally the client controls the server, but this research shows that a malicious server can attack the client. By sending specially crafted data, the server can run code on the client's computer or place files anywhere on it.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.