Skip to content
RCE Write-up Intermediate

CVE-2022-30525 (FIXED): Zyxel Firewall Unauthenticated Remote Command Injection

The Zyxel firewall's administrative web interface passes unsanitised user input into an OS command, allowing an unauthenticated remote attacker to execute arbitrary commands as the nobody user. This could lead to full compromise of the device.

rapid7.com

Published on rapid7.com

Rapid7 discovered and reported a vulnerability that affects Zyxel firewalls supporting Zero Touch Provisioning (ZTP), which includes the ATP series, VPN series, and the USG FLEX series (including USG20-VPN and USG20W-VPN). The vulnerability, identified as CVE-2022-30525, allows an unauthenticated and remote attacker…

Rapid7, on rapid7.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application passes unsanitised attacker-controlled input from the mtu or data parameter directly into the os.system function, enabling command injection.

Impact

An unauthenticated remote attacker could execute arbitrary commands as the nobody user, potentially leading to a reverse shell and full device compromise.

What the attacker needed

Network access to the administrative web interface; Target runs affected firmware version

The fix

Apply the vendor patch and disable WAN access to the administrative web interface.

How it was found

  1. Send a POST request to the /ztp/cgi-bin/handler endpoint with a JSON body containing the setWanPortSt command and a malicious mtu parameter.
  2. The firewall executes the injected command as the nobody user.

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 write-up has not been written yet. The Original tab links to the source.

A firewall's web management page takes user input and runs it as a system command without checking it. An attacker can send a crafted request that includes extra commands, which the firewall then executes, giving the attacker control over the device.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.