Automated Threat Modeling

D-Link R95 CVE-2026-138227: Unauthenticated OS Command Injection in DHMAPI SetTimeSettings

A summary of CVE-2026-138227, an unauthenticated OS command injection in the D-Link R95 DHMAPI SetTimeSettings handler, with the public proof of concept and recommended containment measures.

CVE Analysis

8 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-29

D-Link R95 CVE-2026-138227: Unauthenticated OS Command Injection in DHMAPI SetTimeSettings

Introduction

A publicly disclosed command injection in the D-Link R95 BE9500 Wi-Fi 7 Smart Router lets an unauthenticated attacker who can reach the management interface execute commands as root. The researcher who reported it showed full uid=0 execution in firmware emulation from nothing more than a crafted timezone value in a single HTTP request.

The R95 is a consumer and small office Wi-Fi 7 mesh router, managed through D-Link's AQUILA PRO AI application and a web interface. D-Link describes its presence as 90 operating and sales locations across 43 countries. Because the flaw lives in the device's management SOAP interface and needs no authentication in the documented exploit path, whether that interface is reachable decides your exposure.

Technical Information

The vulnerability is tracked as CVE-2026-138227 and classified under CWE-77 (Command Injection) and CWE-78 (OS Command Injection). It affects D-Link R95 firmware 1.04B04Beta, with the researcher identifying the A1 hardware and the image R95A1_FW104B04Beta.bin.

Root cause: unsanitized TZLocation reaches a shell

The DHMAPI SOAP interface is served by the executable /bin/ssi. When it processes the SetTimeSettings action, it takes the attacker controlled TZLocation parameter and substitutes it into a fixed shell command template:

cp /usr/share/zoneinfo/%s /etc/localtime

The value goes in without shell escaping and without any check against the set of legitimate timezone entries. The researcher traces TZLocation into a 64 byte buffer with a 63 byte extraction limit, then into a _system call. The vulnerable handler is sub_6C548, with the command execution sink at address 0x6C980. Two clarifications from the report: the fixed format string is not itself a format string vulnerability, and the 63 byte input length limit does not prevent command injection.

A value such as x;id;# terminates the path argument with a semicolon, runs the injected command, and comments out the rest of the template with #. The result is command execution as root.

Second weakness: an authentication bypass through action dispatch

On its own, a command injection behind an authenticated endpoint would be far less severe. The researcher documents a dispatch inconsistency that removes the authentication barrier entirely. DHMAPI exempts an outer request whose header is API-ACTION: GetDeviceSettings from API-CONTENT validation. But it dispatches the actual SOAP action from the XML request body independently of that outer action.

So an outer GetDeviceSettings request can carry an inner SetTimeSettings action inside its SOAP body. A SOAPAction header satisfies an earlier request gate, and per the researcher no session cookie and no API-CONTENT value are required. The vulnerable dispatch logic is attributed to sub_5472C, sub_54118, and sub_5305C.

Because two distinct weaknesses combine here, unsafe shell construction plus inconsistent authorization of the dispatched action, correcting only one visible request field would not close the exploit path.

Attack flow

  1. The attacker reaches the device's DHMAPI endpoint at /DHMAPI/ on the management interface.
  2. The attacker sends a POST with headers API-ACTION: GetDeviceSettings and SOAPAction: GetDeviceSettings, which pass the outer validation gate without any session cookie or API-CONTENT value.
  3. The SOAP body contains an inner SetTimeSettings action whose TZLocation element carries injected shell syntax, for example x;id;#.
  4. /bin/ssi dispatches the inner SetTimeSettings action, substitutes TZLocation into the cp command template, and runs the injected command as root.
  5. The response returns HTTP 200 with SetTimeSettingsResult=OK and, in the researcher's test, the output of the injected command.

Proof of Concept

A public, self contained proof of concept exists in the researcher's GitHub repository (jiangnandiyishenqin/D-link-R95A1), referenced by the NVD/CNA record and VulDB (vuln/445096) as the exploit source. The repository holds both a technical write-up (R95-V1.04B04Beta-SetTimeSettings-TZLocation-command-injection-RCE.md) and a working Python 3 exploit (r95_oneclick_exp.py). The affected image is R95A1_FW104B04Beta.bin with SHA-256 e68fb1e04e915876e5dc32137ea54dee107f6465ee9f3e3d8eaab8bf69d4b604.

The report provides this single request reproduction, run against emulated firmware at 192.168.135.132:8080 (the original firmware HTTP port is 80; port 8080 was substituted only to avoid a host port conflict):

curl -i 'http://192.168.135.132:8080/DHMAPI/' \ -H 'User-Agent: Mozilla' \ -H 'API-ACTION: GetDeviceSettings' \ -H 'SOAPAction: GetDeviceSettings' \ -H 'Content-Type: application/xml' \ --data-binary '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><SetTimeSettings><TZLocation>x;id;#</TZLocation></SetTimeSettings></soap:Body></soap:Envelope>'

The reported observed result:

HTTP 200 SetTimeSettingsResult=OK uid=0(root) gid=0(root) groups=0(root)

A second test using id|tee /tmp/r95_tz reportedly created /tmp/r95_tz owned by UID/GID 0, which is further runtime evidence of command execution.

The repository also ships r95_oneclick_exp.py, a dependency free Python 3 tool that automates four DHMAPI injection chains: tz (SetTimeSettings/TZLocation), doh (SetSecureDNSSettings/URI), pppoe (SetTriggerPPPoEValidate/Username), and qos (SetQoSHostInfo/Hostname). For CVE-2026-138227, the tz chain applies:

python3 r95_oneclick_exp.py -t http://TARGET -v tz python3 r95_oneclick_exp.py -t http://TARGET -v tz -c "id|tee /tmp/r95_tz"

The script builds the injected value as x;{command};#, enforces the 63 byte TZLocation length cap, sends the POST to /DHMAPI/ with the GetDeviceSettings bypass headers, and parses the *Result element plus any uid=0(root) echo to confirm success.

The author marks the evidence level as VALIDATED through end to end testing in QEMU user mode ARM chroot emulation. These are laboratory configuration details. They do not establish that deployed routers expose port 8080 or that a production attack has occurred. The exploit was not independently executed as part of the underlying review.

Affected Systems and Versions

  • Vendor: D-Link
  • Product: R95 (researcher identifies R95 A1 hardware)
  • Affected firmware: 1.04B04Beta; researcher identifies image R95A1_FW104B04Beta.bin and runtime version 1.04.04Beta
  • Component: DHMAPI SOAP interface
  • Executable: /bin/ssi
  • Vulnerable function: SetTimeSettings, attacker controlled parameter TZLocation

The evidence identifies the listed firmware specifically. It does not establish an exhaustive range of affected releases or every hardware revision. Note that D-Link release 1.04.B04_Hotfix (release notes dated September 29, 2026, advisory SAP10518, covering CVE-2026-93958) addresses a command injection issue involving NTPServer, not TZLocation or CVE-2026-138227. The same executable and component can hold multiple unsafe input paths, so a fix documented for one parameter says nothing about the status of another. The defensible status is that no confirmed fix for CVE-2026-138227 appears in the reviewed sources.

Vendor Security History

D-Link has a documented security program commitment that comes out of a July 2, 2019 FTC settlement with D-Link Systems. The FTC complaint alleged that vulnerabilities in routers and Internet connected cameras exposed sensitive consumer information, with examples including hard coded camera credentials and readable storage of mobile application credentials. Under the agreement, D-Link committed to a comprehensive software security program covering security planning, threat modeling, pre release testing, ongoing monitoring, automatic firmware updates, and acceptance of researcher vulnerability reports, along with independent assessments every two years for 10 years. Those are historical allegations about other products, not findings about the R95.

Separately, D-Link advisory SAP10518 and the associated 1.04.B04_Hotfix show a published response to a different R95 command injection report (CVE-2026-93958, involving NTPServer). That precedent is relevant context, but it does not establish a vendor response or resolution for CVE-2026-138227 itself.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization