Automated Threat Modeling

Brief Summary: D-Link DIR-X1860Z CVE-2026-138279 Unauthenticated OS Command Injection (with PoC Analysis)

A brief summary of CVE-2026-138279, an unauthenticated OS command injection in the D-Link DIR-X1860Z telnet CGI that yields root. Includes a review of the public proof of concept and interim containment guidance.

CVE Analysis

9 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-29

Brief Summary: D-Link DIR-X1860Z CVE-2026-138279 Unauthenticated OS Command Injection (with PoC Analysis)

Introduction

A single unauthenticated HTTP GET request to a D-Link DIR-X1860Z can run arbitrary commands as root. The entry point is a management CGI script whose name, telnet, misdirects the obvious fix. The script hands attacker-controlled query string data straight to the shell eval builtin, so the compromise happens over HTTP before the Telnet service is ever involved.

The D-Link DIR-X1860Z is a consumer and small office Wi-Fi 6 router. D-Link is an international networking supplier headquartered in Taipei, Taiwan, with a portfolio spanning consumer, business, and industrial equipment. Routers like this sit at the network edge, which makes a root-level command injection on the management surface serious for every client behind the device.

Technical Information

The affected surface is the shell CGI script at /www/cgi-bin/telnet, exposed by uhttpd as /cgi-bin/telnet. This is an HTTP management script, not an exposed Telnet login service, and that distinction determines which component a workaround must disable.

The root cause is a source-to-sink failure. The script takes the first query string parameter, splits it into attacker-controlled key and val variables, and passes them to the shell eval builtin. There is no session check and no permission check anywhere on this path, so no authentication or user interaction is required. The weakness maps to CWE-77 (Command Injection) and CWE-78 (OS Command Injection).

The vulnerable source-to-sink code reproduced in the researcher report is:

# Line 21: URL decoding is commented out. # QUERY_STRING=`urldecode "$QUERY_STRING"` # Lines 22-27: both key and val originate from the request. param=${QUERY_STRING%%&*} QUERY_STRING=${QUERY_STRING#*&} val=${param#*=} key=${param%=*} eval "${key}='${val}'"

Two details make the injection work. First, URL decoding is disabled: the urldecode line is commented out, so a literal single quote and its encoded form %27 are not equivalent on the demonstrated path. Attackers must send literal single quotes, and spaces must be replaced with ${IFS}. Second, the eval "${key}='${val}'" construction wraps the attacker value in single quotes. A literal single quote in val closes that quoted assignment, after which injected shell commands run, and a trailing echo${IFS}' absorbs the final quote the script appends.

The injected command executes before the script reaches any Telnet configuration logic. Successful Telnet startup is unnecessary, which is why disabling the Telnet daemon alone does not address the documented HTTP execution path.

Attack flow

  1. The attacker reaches the device management interface over HTTP. The researcher describes adjacent network access by default, with remote exploitation possible when management is exposed.
  2. The attacker sends a crafted GET request to /cgi-bin/telnet with the x parameter carrying a single quote to break out of the quoted assignment, followed by shell commands using ${IFS} in place of spaces.
  3. The eval builtin executes the injected commands in /bin/sh as root.
  4. The attacker confirms execution independently, for example by writing a marker file and retrieving it with a second GET request.

Scoring note

The score presentations differ by source and should remain attributed. VulDB reports a CVSSv3 base score of 10.0, and the CNA CVSSv3.0 and CVSSv3.1 metrics reproduced by OpenCVE also show 10.0. NVD displays a CNA-supplied CVSSv4.0 score of 9.3 with a vector that includes E:P (Proof of Concept), while the CVSSv4.0 JSON reproduced by OpenCVE carries a baseScore of 10. NVD has not supplied its own independent assessment. Per the FIRST CVSS v4.0 specification, E:P denotes Proof of Concept and is distinct from an Attacked classification; neither a public exploit nor a maximum base score establishes that attacks have occurred.

Proof of Concept

A public, end-to-end proof of concept exists in the researcher's GitHub repository jiangnandiyishenqin/D-link-DIR-X1860Z, which NVD references as the exploit link. It consists of a detailed write-up (DIR-X1860Z-V1.0.7-telnet-eval-command-injection-RCE.EN.md) and a self-contained Python 3 script (DIR-X1860Z_oneclick_exp.py).

Because URL decoding is disabled, single quotes are sent literally and spaces are replaced with ${IFS}. The trigger request writes a marker file, and an independent GET retrieves it:

GET /cgi-bin/telnet?x=';echo${IFS}DIRX1860Z_RCE_VALIDATED>/tmp/dirx_rce_proof;echo${IFS}DIRX1860Z_RCE_VALIDATED>/www/dirx_rce_proof.txt;echo${IFS}'&user=a&pwd=b&enable=false HTTP/1.1 Host: 192.168.135.137:23355 Connection: close
GET /dirx_rce_proof.txt HTTP/1.1 Host: 192.168.135.137:23355 Connection: close

The ';...;echo${IFS}' wrapper closes the quoted x='' assignment, runs the injected commands, and absorbs the trailing quote appended by the script.

The Python script reproduces the issue with no third-party dependencies. It performs a web frontend and ubus backend preflight, sends the CGI injection, then validates execution by retrieving a per-run random marker file via a separate HTTP GET:

python DIR-X1860Z_oneclick_exp.py --only cgi python DIR-X1860Z_oneclick_exp.py --only cgi --command "uname -a"

The script's exploit_cgi function builds the injection path /cgi-bin/telnet?x=';<payload>;echo${IFS}'&user=a&pwd=b&enable=false, where the payload runs the chosen command, redirects output to a /www/dirx_cgi_<token>.txt proof file, and appends the random token. fetch_proof then confirms the token appears in the retrieved file.

The same script also contains a second, distinct exploit (exploit_rop, invoked with --only rop) targeting a routerd get_rand_key/key_index stack overflow with a hardcoded ROP chain (LIBC_BASE = 0x3F6B7000, SYSTEM_PLT = 0x1260C, COMMAND_OFFSET = 132). That corresponds to the separate CVE-2026-138278 and is not the telnet injection flaw.

Validation status and caveats

The author rates the evidence as VALIDATED end to end, but only in a QEMU user-mode ARM chroot emulation (with uhttpd, ubusd, and routerd running), not on physical hardware. The reported command output confirmed uid=0(root) gid=0(root) groups=0(root). One emulation-only change (usleep(1) to usleep(1024) in liboss.so) was made to avoid a QEMU startup race and did not touch the vulnerable CGI path. The write-up does not explicitly cite the CVE number itself; the association rests on NVD's reference plus the matching firmware version and vulnerability details. VulDB independently labels the linked exploit as a proof of concept. The PoC was reviewed against source but not independently executed for this briefing. The researcher also describes potential consequences such as reading or modifying configuration, stealing credentials, changing DNS and routing, controlling services, denial of service, and attacking connected LAN clients. These are described consequences, not documented outcomes from an observed victim campaign.

Affected Systems and Versions

  • Product: D-Link DIR-X1860Z, identified by the researcher as hardware Rev A.
  • Affected firmware: V1.0.7.260821.161908, described in the researcher report as a hotfix build.
  • Vulnerable component: /www/cgi-bin/telnet, exposed over HTTP as /cgi-bin/telnet, affected argument x.

One model distinction matters. D-Link's SAP10513 states that the DIR-X1860Z remains active, while the similarly named DIR-X1860 has reached the end of its service life. The retirement status of the latter should not be applied to the affected Z variant. The cited sources do not identify a safe downgrade or a later fixed build specific to this CVE.

Vendor Security History

D-Link advisory SAP10513 identifies V1.0.7.260821.161908 as the fix for earlier administrator password and wireless configuration issues on the DIR-X1860Z. The new CVE and researcher report identify that same firmware as affected by the Telnet CGI injection, so SAP10513 does not establish remediation for CVE-2026-138279. A genuine security hotfix can remain vulnerable through a different interface, because the two advisories share a firmware identifier but address different vulnerable paths.

In July 2019, the US Federal Trade Commission announced that D-Link Systems agreed to implement a comprehensive software security program to settle litigation. The required program included threat modeling, testing before product release, continuing vulnerability monitoring, automatic firmware updates, acceptance of researcher vulnerability reports, and independent assessments every two years for ten years. These were allegations and obligations underlying the settlement, not evidence about the DIR-X1860Z specifically.

Separately, CISA added CVE-2022-37055, a D-Link router buffer overflow, to its Known Exploited Vulnerabilities Catalog based on evidence of active exploitation. That is a concrete element of D-Link's history but does not establish exploitation of CVE-2026-138279.

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