CVE-2023-35138

9.8 CRITICAL

📋 TL;DR

This critical command injection vulnerability in Zyxel NAS devices allows unauthenticated attackers to execute arbitrary operating system commands via crafted HTTP POST requests. Affected users include anyone running vulnerable Zyxel NAS326 or NAS542 firmware versions, potentially leading to complete system compromise.

💻 Affected Systems

Products:
  • Zyxel NAS326
  • Zyxel NAS542
Versions: NAS326 firmware V5.21(AAZF.14)C0 and NAS542 firmware V5.21(ABAG.11)C0
Operating Systems: Embedded Linux on Zyxel NAS devices
Default Config Vulnerable: ⚠️ Yes
Notes: All devices running these specific firmware versions are vulnerable by default. No special configuration required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system takeover, data theft, ransomware deployment, lateral movement to other network devices, and persistent backdoor installation.

🟠

Likely Case

Unauthenticated remote code execution leading to data exfiltration, cryptocurrency mining, or device integration into botnets.

🟢

If Mitigated

Limited impact if devices are behind firewalls with strict ingress filtering and network segmentation.

🌐 Internet-Facing: HIGH - Unauthenticated remote exploitation makes internet-facing devices immediate targets for attackers.
🏢 Internal Only: MEDIUM - Still vulnerable to internal threats, but attack surface is reduced compared to internet exposure.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability requires sending a crafted HTTP POST request to the vulnerable endpoint. Public exploit code exists, making exploitation trivial for attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Update to latest firmware versions from Zyxel

Vendor Advisory: https://www.zyxel.com/global/en/support/security-advisories/zyxel-security-advisory-for-authentication-bypass-and-command-injection-vulnerabilities-in-nas-products

Restart Required: Yes

Instructions:

1. Log into Zyxel NAS web interface. 2. Navigate to System > Firmware Update. 3. Check for and apply available updates. 4. Reboot the device after update completes.

🔧 Temporary Workarounds

Network Isolation

linux

Block external access to NAS web interface and restrict internal access to trusted IPs only

iptables -A INPUT -p tcp --dport 80 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -p tcp --dport 443 -j DROP

Disable Web Interface

linux

Temporarily disable the web management interface if not required

service httpd stop
systemctl disable httpd

🧯 If You Can't Patch

  • Immediately isolate affected devices from internet and untrusted networks
  • Implement strict network segmentation and monitor for suspicious HTTP POST requests to NAS devices

🔍 How to Verify

Check if Vulnerable:

Check firmware version in web interface: System > Information > Firmware Version

Check Version:

ssh admin@nas_ip 'cat /etc/version' or check web interface

Verify Fix Applied:

Verify firmware version is updated beyond vulnerable versions and test that crafted POST requests no longer execute commands

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /cgi-bin/weblogin.cgi or similar endpoints
  • Unexpected command execution in system logs
  • Failed authentication attempts followed by successful command execution

Network Indicators:

  • HTTP POST requests with shell metacharacters or command injection patterns
  • Outbound connections from NAS to suspicious IPs

SIEM Query:

source="nas_logs" AND (http_method="POST" AND (uri="*weblogin*" OR uri="*cgi-bin*") AND (content="*;*" OR content="*|*" OR content="*`*" OR content="*$(*"))

🔗 References

📤 Share & Export