Siretta QUARTZ-GOLD httpd delfile.cgi stack-based buffer overflow vulnerability
The delfile.cgi script in the Siretta QUARTZ-GOLD router copies the user-supplied _filename parameter into a fixed-size stack buffer without checking length, causing a stack-based buffer overflow. An attacker can send a crafted HTTP request to overwrite the return address and potentially achieve remote code execution.
Originally disclosed on Cisco Talos
A stack-based buffer overflow vulnerability exists in the httpd delfile.cgi functionality of Siretta QUARTZ-GOLD G5.0.1.5-210720-141020. A specially-crafted HTTP request can lead to remote code execution.
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 code uses sprintf to copy the user-controlled _filename parameter into a fixed-size stack buffer without any length check.
Impact
A specially-crafted HTTP request can lead to remote code execution, though the attacker must have valid credentials (PR:H in CVSS).
What the attacker needed
Valid credentials for the router's web interface; network access to the router's web server
The fix
The vulnerability was fixed by the vendor in a patch release.
How it was found
- Send an HTTP POST request to /delfile.cgi with a valid Basic Authorization header.
- Include a _filename parameter containing a long string that exceeds the buffer size.
- Include the correct _http_id parameter.
- The server processes the request, causing a stack-based buffer overflow and potentially crashing or allowing code execution.
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.
A buffer overflow happens when a program writes more data into a fixed-size memory area than it can hold, spilling over into nearby memory. Here, the router's web server takes a filename from an HTTP request and copies it into a small stack buffer without checking its length. By sending a very long filename, an attacker can overwrite the return address and possibly run their own code on the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.