Skip to content
RCE Advisory Advanced CVE-2022-38459

Siretta QUARTZ-GOLD httpd downfile.cgi stack-based buffer overflow vulnerability

A stack-based buffer overflow in the downfile.cgi of the Siretta QUARTZ-GOLD router occurs because the _filename parameter is copied into a fixed-size buffer without length checking. An attacker can send a crafted HTTP request to potentially achieve remote code execution.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 7.2 View original

A stack-based buffer overflow vulnerability exists in the httpd downfile.cgi functionality of Siretta QUARTZ-GOLD G5.0.1.5-210720-141020. A specially-crafted HTTP request can lead to remote code execution.

Francesco Benvenuto, on Cisco Talos

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-supplied _filename parameter into a fixed-size stack buffer without any bounds checking.

Impact

A specially-crafted HTTP request can lead to remote code execution, allowing an attacker to execute arbitrary code on the device.

What the attacker needed

Valid basic authentication credentials; Correct _http_id parameter

The fix

The vendor released a patch on 2022-11-24.

How it was found

  1. Send an HTTP POST request to /downfile.cgi with a valid Basic Authorization header.
  2. Include a _filename parameter with a very long string and the correct _http_id parameter.
  3. The server processes the request and the long filename causes a stack buffer overflow, potentially leading to 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.

This report describes a bug in a router's web server. When you ask to download a file, the server takes the filename you provide and copies it into a small memory space without checking if it fits. If the filename is too long, it spills over and can crash the server or let an attacker run their own code.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Francesco Benvenuto

View all

152 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.