# CVE-2020-9054: Zyxel Multiple NAS Devices OS Command Injection

> Remote unauthenticated attackers can execute arbitrary code with root privileges on ZyXEL NAS devices via command injection in weblogin.cgi.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 25 Mar 2022 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 4 Mar 2020
- **Updated:** 7 Oct 2026
- **Also known as:** GHSA-w6h5-rjp3-hxvc

## What is CVE-2020-9054?

CVE-2020-9054 is a critical command injection vulnerability in ZyXEL NAS326, published on 4 Mar 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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 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

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2020-9054?

It affects 27 products.


Products: Zyxel Atp100 Firmware, Zyxel Atp200 Firmware, Zyxel Atp500 Firmware, Zyxel Atp800 Firmware, Zyxel Nas326 Firmware, Zyxel Nas520 Firmware, Zyxel Nas540 Firmware, Zyxel Nas542 Firmware, Zyxel Usg1100 Firmware, Zyxel Usg110 Firmware, Zyxel Usg1900 Firmware, Zyxel Usg20-Vpn Firmware, Zyxel Usg20w-Vpn Firmware, Zyxel Usg210 Firmware, Zyxel Usg2200 Firmware, Zyxel Usg310 Firmware, Zyxel Usg40 Firmware, Zyxel Usg40w Firmware, Zyxel Usg60 Firmware, Zyxel Usg60w Firmware and 7 more.

## How do I fix CVE-2020-9054?

No fix has been published for CVE-2020-9054 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 15 Apr 2022.

## Is CVE-2020-9054 being exploited?

Yes. Attackers have exploited CVE-2020-9054 in the wild since at least 25 Mar 2022.

Public exploit code:

- CVE-2020-9054 PoC for Zyxel (github_poc): https://github.com/darrenmartyn/CVE-2020-9054
- Zyxel NAS Firmware 5.21- Remote Code Execution (nuclei): http/cves/2020/CVE-2020-9054.yaml

## Other vulnerabilities in ZyXEL NAS326

- [CVE-2023-33009](https://insights.sbomify.com/CVE-2023-33009/): Zyxel Multiple Firewalls Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2023-33010](https://insights.sbomify.com/CVE-2023-33010/): Zyxel Multiple Firewalls Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2023-28771](https://insights.sbomify.com/CVE-2023-28771/): Zyxel Multiple Firewalls OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2022-30525](https://insights.sbomify.com/CVE-2022-30525/): Zyxel Multiple Firewalls OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2020-29583](https://insights.sbomify.com/CVE-2020-29583/): Zyxel Multiple Products Use of Hard-Coded Credentials (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-9054 and fix it if it is affected.

What it is: CVE-2020-9054 is a critical command injection vulnerability in ZyXEL NAS326, published on 4 Mar 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2020-9054 in the wild since at least 25 Mar 2022.

Affected product: ZyXEL NAS326. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-9054/ (Markdown: https://insights.sbomify.com/CVE-2020-9054/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-9054
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-9054
- OSV: https://osv.dev/vulnerability/CVE-2020-9054

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-9054/
Summaries are generated and may contain mistakes; the official description above is the record.
