Siretta QUARTZ-GOLD httpd delfile.cgi OS command injection vulnerability
The delfile.cgi endpoint of the Siretta QUARTZ-GOLD router's web server takes a filename parameter and inserts it unsanitised into a shell command, allowing an authenticated attacker to execute arbitrary OS commands. An attacker could send a crafted HTTP request to run commands on the device, such as rebooting it.
Originally disclosed on Cisco Talos
An os command injection 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 arbitrary command 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 `_filename` parameter is passed directly into a shell command via `sprintf` and `system` without sanitisation or escaping.
Impact
An authenticated attacker could execute arbitrary OS commands on the device, leading to full compromise.
What the attacker needed
Valid Basic authentication credentials; correct _http_id value
The fix
The vendor released a patch on 2022-11-24.
How it was found
- Send an HTTP POST request to /delfile.cgi with valid Basic authentication.
- Include the _filename parameter containing shell metacharacters and a command.
- Include the correct _http_id parameter.
- The device executes the injected command, causing it to reboot.
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 router has a web page for deleting files. When you ask it to delete a file, it builds a command for the underlying operating system using the name you supplied. Because it does not check that the name is safe, someone who can log in can include extra commands in the name, and the router will run them.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.