Skip to content
Path traversal Advisory Intermediate CVE-2022-39045

Siretta QUARTZ-GOLD httpd upload.cgi file write vulnerability

The upload.cgi endpoint of the router's web server takes a filename parameter and uses it to build a file path without sanitising it, so an attacker can write outside the intended upload folder. By overwriting a system file such as the password file, an attacker with valid credentials could add their own login and then run commands on the device.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 7.2 View original

A file write vulnerability exists in the httpd upload.cgi functionality of Siretta QUARTZ-GOLD G5.0.1.5-210720-141020. A specially-crafted HTTP request can lead to arbitrary file upload.

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 filename parameter from the request is concatenated into a file path and passed to fopen without any check that it stays inside the intended upload directory.

Impact

An attacker who already holds valid credentials could overwrite arbitrary files and gain command execution on the device.

What the attacker needed

Valid basic auth credentials; network access to the web interface

The fix

The filename should be sanitised and confined to the upload directory before it is used to build a path; the vendor released a patch.

How it was found

  1. Send an authenticated POST request to upload.cgi with a filename parameter containing directory traversal sequences pointing at a target system file.
  2. Include a multipart body whose content becomes the new contents of that file.
  3. Log in to the device with the credentials that were written into the overwritten file.

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 uploading files. The program that handles the upload trusts the file name the browser sends and simply sticks it onto a folder path. By putting '..' sequences in the name, which mean 'go up one folder', someone can make the router save the file somewhere it should not, such as a system file that controls logins.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

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.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.