Introduction
A single timezone setting field in the D-Link R32 router turns an authenticated administrator session into root command execution. The TZLocation argument of the SetDeviceSettings action reaches an unquoted shell command inside a web service that already runs as root, and a public proof of concept confirms the path end to end in emulation.
The R32 is a consumer and small office wireless router from D-Link, a global networking brand founded in 1986 and listed on the Taiwan Stock Exchange since 1994. The company reports operations across 43 countries, and the R32 is part of a broadly distributed networking portfolio. That distribution matters because the affected firmware, 1.10B02 on hardware revision A1, is the current published build for the device.
Technical Information
The weaknesses are classified as CWE-77 (command injection) and CWE-78 (OS command injection). The affected component is the DHMAPI Action Handler in /usr/bin/httpd, specifically the SetDeviceSettings action and its TZLocation argument. The request endpoint is POST /DHMAPI/, and the HTTP/HTTPS service runs as root.
The SetDeviceSettings action is registered with auth=1, which means a valid DHMAPI administrator session is required. An unauthenticated request returns HTTP 401 and creates no marker, so the demonstrated attack is authenticated rather than an authentication bypass.
The root cause is a copy of the timezone value into a settings structure that truncates length without sanitizing shell metacharacters. The advisory identifies the copy as:
snprintf(destination + 0x8c, 0x21, "%s", value);
This permits 32 bytes plus a null terminator. The bounded length limits how long the injected value can be, but it does nothing to stop the shell from interpreting characters such as ;, >, and $(). The value is later read back from structure offset 0x8c, inserted into the unquoted command format fota -T %s&, and executed through the chain libutils.so::_exec_cmd then pox_system then system().
There is a critical distinction from a related issue: the sink in the SetDeviceSettings path is at 0x462218 and is independent of the SetTimeSettings sink at 0x45f124. An escaping routine (sub_416AD0) present in the function only applies to the DeviceName branch and does not protect TZLocation. The researcher explicitly warns that remediating only SetTimeSettings leaves this independent entry point exposed. This is a field-specific command construction problem, not evidence that every DHMAPI field or action is vulnerable.
Attack flow
Based on the published research, exploitation proceeds as follows:
- The attacker establishes a valid DHMAPI administrator session, completing the Login challenge and response protocol.
- The attacker signs an authenticated
SetDeviceSettingsrequest and setsTZLocationto a payload containing shell metacharacters. - The handler copies the value into the settings structure at offset
0x8cwithout sanitization. - The value is formatted into
fota -T %s&and passed tosystem()viapox_system, executing the injected command as root. - The attacker confirms execution by retrieving a marker file written into the web root.
The demonstrated outcome is authenticated root command execution with no separate privilege escalation step. The advisory describes possible broader compromise of router configuration, network traffic, integrity, and availability, but these are consequences of the execution path rather than separately observed field incidents.
Proof of Concept
The researcher Zzzhangxxx published a complete, self-contained Python proof of concept and validated it against the firmware image R32A1_FW110B02.bin (SHA-256 324bf9ad9a5066eed6244bb8b97a45f4ac99835d1f11606208ed6f9092ba7790). Rapid7's database confirms the exploit has been disclosed to the public and may be used, rating it CVSS 4.0 9.4 and CVSS 3.1 9.9.
The injection payload is sent in the SOAP field as <TZLocation>x;echo R32_OD >/tmp/www3/d</TZLocation>. This payload is 26 bytes, within the 32-byte limit. After shell parsing, the command after the semicolon writes a marker file (R32_OD) into the web root, which the PoC then retrieves via HTTP to confirm root command execution.
The PoC performs the full DHMAPI protocol end to end: a Login challenge request to obtain Challenge, Cookie, and PublicKey (plus an optional SaltHash for PBKDF2-HMAC-SHA256 password derivation at 5000 iterations); private-key derivation as HMAC-SHA256(PublicKey+password, Challenge) uppercased; login completion; request signing via the API-AUTH HMAC header and an AES-CTR API-CONTENT content signature; and finally the injected SetDeviceSettings request followed by marker verification.
The signing and content-signature logic from the PoC:
def digest(key, message): return hmac.new(key.encode(), message.encode(), hashlib.sha256).hexdigest().upper() def content_signature(body, private_key): iv = get_random_bytes(16) cipher = AES.new(bytes.fromhex(private_key), AES.MODE_CTR, nonce=b"", initial_value=iv) plaintext = pad(hashlib.md5(body).hexdigest().upper().encode(), 16) return cipher.encrypt(plaintext).hex().upper() + " " + iv.hex().upper()
The exploit request itself:
status, _ = client.call("SetDeviceSettings", { "DeviceName": "R32", "AdminPassword": "", "PresentationURL": "", "CAPTCHA": "false", "ChangePassword": "false", "TZLocation": f"x;echo {MARKER} >/tmp/www3/{filename}", })
Reproduction installs PyCryptodome (python3 -m pip install pycryptodome), saves the code as poc.py, and runs python3 poc.py http://127.0.0.1:10080 --password 'YOUR_PASSWORD', validated in a QEMU setup forwarding 127.0.0.1:10080 to guest port 80. On success the script prints [+] Authenticated root command execution confirmed. A negative control (--unauth) confirms HTTP 401 and no marker creation. Per the researcher, the PoC was validated in an emulated environment and not independently re-executed here.
Affected Systems and Versions
- Device: D-Link R32, hardware revision A1
- Firmware: 1.10B02 (image
R32A1_FW110B02.bin) - Vulnerable component: DHMAPI Action Handler in
/usr/bin/httpd,SetDeviceSettingsaction,TZLocationargument
The researcher's case study targets this specific hardware and firmware combination in a QEMU runtime. Physical device reproduction, default WAN accessibility, and affected versions beyond the tested combination are not established by the advisory.
A note on scoring
Three published scores describe different assessments and should be compared with their labels intact. The CVSS 3.1 base is 9.9 Critical (reported by the CVE record and Rapid7). The CVSS 4.0 base is 9.4 Critical. NVD displays an 8.6 High value as a VulDB-supplied CVSS-BT (Base plus Threat) score with E:P, and marks its own assessment as Not Scheduled. Under the CVSS 4.0 specification, E:P denotes proof of concept, distinct from E:A (attacked). A critical base severity and public exploit code alone do not supply evidence of a named campaign.
Vendor Security History
The FTC announced on July 2, 2019 that D-Link Systems, Inc. agreed to security enhancements to settle litigation arising from a 2017 complaint alleging inadequate secure software development, including hardcoded and readable stored credentials. The proposed settlement required a comprehensive software security program covering threat modeling, pre-release testing, ongoing monitoring, automatic firmware updates, acceptance of researcher reports, and independent assessments every two years for 10 years. These are historical allegations and obligations, not findings about this CVE.
D-Link has also shown corrective responses elsewhere. Advisory SAP10412 states patches were released within 90 days of report for COVR-X1870, DIR-X4860, and DIR-X5460, and SAP10398 documents automatically delivered fixes for the vulnerabilities it lists. These examples show response mechanisms rather than a confirmed response to CVE-2026-136822. The decisive missing item for the R32 remains a vendor statement identifying a corrected release and this specific vulnerable path.
References
- NVD: CVE-2026-136822
- CVE Record: CVE-2026-136822
- Researcher advisory and PoC (GitHub)
- Researcher advisory (raw)
- Rapid7 Vulnerability Database
- VulDB entry 443781
- VulDB CVE page
- D-Link SAP10398
- D-Link SAP10412
- R32 Firmware Release Notes
- FTC: D-Link settlement
- CISA Known Exploited Vulnerabilities Catalog
- CISA Home Network Security
- CVSS v4.0 Specification
- D-Link Brand Story



