CVE-2020-9054
Published: 04 March 2020
Summary
CVE-2020-9054 is a critical-severity OS Command Injection (CWE-78) vulnerability in Zyxel Nas326 Firmware. Its CVSS base score is 9.8 (Critical).
Operationally, ranked in the top 0.1% of CVEs by exploit likelihood; CISA has added it to the Known Exploited Vulnerabilities catalog; a public proof-of-concept is referenced.
The strongest mitigations our analysis identified are NIST 800-53 SI-10 (Information Input Validation) and SI-2 (Flaw Remediation).
Deeper analysis
Multiple ZyXEL network-attached storage devices running firmware version 5.21 are affected by a pre-authentication command injection vulnerability tracked as CVE-2020-9054. The flaw resides in the weblogin.cgi component responsible for authentication, which fails to sanitize the username parameter. This permits injection of shell metacharacters that are executed with web-server privileges; because the devices include a setuid utility, an attacker can escalate to root. Affected models include NAS326, NAS520, NAS540, and NAS542 prior to the listed firmware revisions, along with several end-of-support NSA-series products. The vulnerability carries a CVSS 3.1 base score of 9.8.
A remote, unauthenticated attacker can exploit the issue by sending a crafted HTTP POST or GET request containing malicious username values. Successful exploitation yields arbitrary command execution with root privileges on the device. The attack can be mounted directly against an exposed NAS or indirectly when a user’s browser is induced to issue the malicious request to any reachable vulnerable device.
ZyXEL has released updated firmware (V5.21(AAZF.7)C0 and later for NAS326, V5.21(AASZ.3)C0 for NAS520, V5.21(AATB.4)C0 for NAS540, and V5.21(ABAG.4)C0 for NAS542). The vendor advisory and CERT coordination artifacts recommend applying these updates immediately and note that no workarounds exist for the affected firmware versions.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2020-29883
Vulnerability details
Multiple ZyXEL network-attached storage (NAS) devices running firmware version 5.21 contain a pre-authentication command injection vulnerability, which may allow a remote, unauthenticated attacker to execute arbitrary code on a vulnerable device. ZyXEL NAS devices achieve authentication by using the weblogin.cgi…
more
CGI executable. This program fails to properly sanitize the username parameter that is passed to it. If the username parameter contains certain characters, it can allow command injection with the privileges of the web server that runs on the ZyXEL device. Although the web server does not run as the root user, ZyXEL devices include a setuid utility that can be leveraged to run any command with root privileges. As such, it should be assumed that exploitation of this vulnerability can lead to remote code execution with root privileges. By sending a specially-crafted HTTP POST or GET request to a vulnerable ZyXEL device, a remote, unauthenticated attacker may be able to execute arbitrary code on the device. This may happen by directly connecting to a device if it is directly exposed to an attacker. However, there are ways to trigger such crafted requests even if an attacker does not have direct connectivity to a vulnerable devices. For example, simply visiting a website can result in the compromise of any ZyXEL device that is reachable from the client system. Affected products include: NAS326 before firmware V5.21(AAZF.7)C0 NAS520 before firmware V5.21(AASZ.3)C0 NAS540 before firmware V5.21(AATB.4)C0 NAS542 before firmware V5.21(ABAG.4)C0 ZyXEL has made firmware updates available for NAS326, NAS520, NAS540, and NAS542 devices. Affected models that are end-of-support: NSA210, NSA220, NSA220+, NSA221, NSA310, NSA310S, NSA320, NSA320S, NSA325 and NSA325v2
- CWE(s)
- KEV Date Added
- 25 March 2022
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Directly requires applying the vendor firmware updates (V5.21 AA*.*C0 and later) that eliminate the weblogin.cgi command-injection flaw.
Mandates validation and sanitization of the username parameter passed to weblogin.cgi, blocking the shell-metacharacter injection that enables unauthenticated RCE.
Boundary-protection mechanisms can restrict direct exposure of the NAS web interface or block crafted requests originating from compromised browsers, limiting the attack surface.