CVE-2023-35138
📋 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
- Zyxel NAS326
- Zyxel NAS542
📦 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.
🎯 Exploit Status
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
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
linuxBlock 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
linuxTemporarily 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
- https://www.zyxel.com/global/en/support/security-advisories/zyxel-security-advisory-for-authentication-bypass-and-command-injection-vulnerabilities-in-nas-products
- https://www.zyxel.com/global/en/support/security-advisories/zyxel-security-advisory-for-authentication-bypass-and-command-injection-vulnerabilities-in-nas-products