TP-Link TL-R600VPN HTTP Server fs directory Remote Code Execution Vulnerability
The HTTP server on the TP-Link TL-R600VPN router has a buffer overflow in its header parsing function when handling requests to /fs/ pages. An authenticated attacker can send a crafted HTTP request to overwrite the return address and execute arbitrary code on the device.
Originally disclosed on Cisco Talos
An exploitable remote code execution vulnerability exists in the HTTP header-parsing function of the TP-Link TL-R600VPN HTTP Server. A specially crafted HTTP request can cause a buffer overflow, resulting in remote code execution on the device.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The function httpGetMimeTypeByFileName calculates the length of a user-controlled header and adds it to a buffer offset without checking the buffer size, leading to a stack-based buffer overflow.
Impact
An authenticated attacker could execute arbitrary code on the device, potentially taking full control of the router.
What the attacker needed
Authentication to the router's web interface; Valid Referer header
The fix
The vulnerability was fixed in a beta firmware provided by the vendor.
How it was found
- Authenticate to the router's web interface.
- Send a GET request to a /fs/ page with a valid Referer header and an overly long header value.
- The server crashes or executes attacker-controlled code.
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 report has not been written yet. The Original tab links to the source.
This report describes a flaw in a router's web server. When the server processes certain web addresses, it copies too much data into a small memory area, which can crash the server or let an attacker run their own code. The attacker must already be logged in to the router to exploit this.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.