CVE-2024-42057

8.1 HIGH

📋 TL;DR

This CVE describes a command injection vulnerability in Zyxel firewall devices that allows unauthenticated attackers to execute operating system commands. The vulnerability affects multiple Zyxel firewall series when configured with User-Based-PSK authentication and specific username conditions. Attackers can exploit this to gain unauthorized access and control over affected devices.

💻 Affected Systems

Products:
  • Zyxel ATP series
  • Zyxel USG FLEX series
  • Zyxel USG FLEX 50(W) series
  • Zyxel USG20(W)-VPN series
Versions: ATP: V4.32 through V5.38, USG FLEX: V4.50 through V5.38, USG FLEX 50(W): V4.16 through V5.38, USG20(W)-VPN: V4.16 through V5.38
Operating Systems: Zyxel firmware
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when configured with User-Based-PSK authentication mode and a valid user with username exceeding 28 characters exists.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete device compromise leading to network infiltration, data exfiltration, and use as a pivot point for further attacks.

🟠

Likely Case

Unauthorized command execution allowing configuration changes, credential harvesting, or installation of persistence mechanisms.

🟢

If Mitigated

Limited impact due to specific configuration requirements and proper network segmentation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires specific configuration conditions but is straightforward once those conditions are met.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after V5.38

Vendor Advisory: https://www.zyxel.com/global/en/support/security-advisories/zyxel-security-advisory-for-multiple-vulnerabilities-in-firewalls-09-03-2024

Restart Required: Yes

Instructions:

1. Download latest firmware from Zyxel support portal. 2. Backup current configuration. 3. Upload and install firmware update via web interface or CLI. 4. Reboot device. 5. Verify firmware version.

🔧 Temporary Workarounds

Disable User-Based-PSK Authentication

all

Switch to alternative authentication methods that don't trigger the vulnerability.

Username Length Restriction

all

Ensure no usernames exceed 28 characters in User-Based-PSK configurations.

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate affected devices
  • Deploy network-based IPS/IDS rules to detect and block exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check firmware version via web interface (System > Maintenance > Firmware) or CLI command 'show version'. Verify if User-Based-PSK is enabled and if any usernames exceed 28 characters.

Check Version:

show version

Verify Fix Applied:

Confirm firmware version is above V5.38 and test with crafted usernames to ensure no command execution occurs.

📡 Detection & Monitoring

Log Indicators:

  • Unusual authentication attempts with long usernames
  • Unexpected command execution in system logs
  • Failed login attempts with crafted usernames

Network Indicators:

  • Traffic patterns indicating command injection attempts
  • Unusual outbound connections from firewall devices

SIEM Query:

source="zyxel_firewall" AND (username_length>28 OR "command injection" OR "os command")

🔗 References

📤 Share & Export