A leftover debug code vulnerability exists in the httpd shell.cgi functionality of Siretta QUARTZ-GOLD G22.214.171.124-210720-141020. A specially-crafted HTTP request can lead to remote code execution. An attacker can send an HTTP request to trigger this vulnerability.
The versions below were either tested or verified to be vulnerable by Talos or confirmed to be vulnerable by the vendor.
Siretta QUARTZ-GOLD G126.96.36.199-210720-141020
7.2 - CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
CWE-489 - Leftover Debug Code
The Siretta QUARTZ-GOLD is an industrial cellular router with several features and services, such as: SSH, UPNP, VPN, SNMP and many others.
Based on the web page shown, functionalities and the documentation publicly available, the QUARTZ-GOLD does not provide any way to directly access the linux system that runs on the router. The router’s web server is based on AdvancedTomato, which offers several debug APIs active by default. The developer, allegedly, forgot to disable those debug APIs. For instance, the AdvancedTomato’s
shell.cgi API is still active, allowing arbitrary command execution:
wo_shell is the function that is called when the
shell.cgi API is requested. This function will call the
_execute_command with the request’s
command parameter. This function will effectively execute the provided shell command. The leftover debug code allows arbitrary command execution.
Sending a request like the following:
POST /shell.cgi HTTP/1.1 Authorization: Basic <a valid basic auth> Content-Length: 52 command=cat /etc/passwd&_http_id=<the correct tid>
Will generate the following response:
The request will make the router execute the command
cat /etc/passwd and respond to the HTTP request with the output of the command back.
2022-10-14 - Initial Vendor Contact
2022-10-20 - Vendor Disclosure
2022-11-24 - Vendor Patch Release
2023-01-26 - Public Release
Discovered by Francesco Benvenuto of Cisco Talos.