Unauthenticated OS Command Injection in QNAP quick.cgi
CVE-2023-50358 is an unauthenticated OS command injection vulnerability in the quick.cgi component of QNAP NAS operating systems, including QTS, QuTS hero, and QuTScloud. The vulnerable code path is reachable via the quick.cgi handler when the HTTP request parameter todo=set_timeinfo is supplied. In the described flow, attacker-controlled input from the SPECIFIC_SERVER parameter is written into /tmp/quick/quick_tmp.conf as the "NTP Address" value. quick.cgi then initiates time synchronization using ntpdate, constructs a command line by reading that stored value, and executes the resulting command through system(). Because the SPECIFIC_SERVER value is not properly sanitized before being incorporated into a shell command, a remote attacker can inject arbitrary OS commands. The issue is network-reachable and does not require authentication on exposed vulnerable systems.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows remote arbitrary command execution in the context of the affected QNAP device. An attacker can execute shell commands over the network, which can lead to full compromise of the NAS, including deployment of malware or ransomware, modification of system configuration, data access or destruction, and use of the device as a foothold for further activity. The supporting content characterizes the flaw as low attack complexity with critical impact for affected IoT/NAS deployments.
If you can’t patch tonight, do this now.
Until patching is completed, reduce or eliminate network exposure to the quick.cgi endpoint and restrict access to NAS management interfaces to trusted administrative networks only. QNAP indicates administrators can test exposure by requesting /cgi-bin/quick/quick.cgi on the NAS system port: an HTTP 404 response indicates the system is not vulnerable or has been remediated, while an empty HTTP 200 response indicates the system remains vulnerable. Where available, network security controls can be used to block exploit traffic; the supporting content notes Palo Alto Networks Threat Prevention/Advanced Threat Prevention coverage via signature 94969. If the device is uninitialized, note the supporting content also states quick.cgi is present on uninitialized QNAP NAS devices and disabled after successful initialization, which may reduce exposure in some deployments.
Patch, then assume compromise.
Upgrade affected QNAP systems to fixed releases. The vendor states the issue is fixed in: QTS 5.1.5.2645 build 20240116 and later; QTS 4.5.4.2627 build 20231225 and later; QTS 4.3.6.2665 build 20240131 and later; QTS 4.3.4.2675 build 20240131 and later; QTS 4.3.3.2644 build 20240131 and later; QTS 4.2.6 build 20240131 and later; QuTS hero h5.1.5.2647 build 20240118 and later; QuTS hero h4.5.4.2626 build 20231225 and later; and QuTScloud c5.1.5.2651 and later. Apply the latest available firmware for the relevant product line and verify that the quick.cgi exposure is no longer present.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
3 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.