CVE-2024-10915 Overview
A critical OS command injection vulnerability has been identified in multiple D-Link Network Attached Storage (NAS) devices, affecting the DNS-320, DNS-320LW, DNS-325, and DNS-340L models. The vulnerability exists in the cgi_user_add function within the /cgi-bin/account_mgr.cgi endpoint, where improper handling of the group parameter allows attackers to inject and execute arbitrary operating system commands remotely.
This vulnerability is particularly concerning as it affects network-accessible storage devices that often contain sensitive data and operate within trusted network segments. The exploit has been publicly disclosed, increasing the risk of active exploitation in the wild.
Critical Impact
Remote attackers can execute arbitrary commands on vulnerable D-Link NAS devices without authentication, potentially leading to complete device compromise, data theft, or use as a pivot point for lateral movement within the network.
Affected Products
- D-Link DNS-320 and DNS-320 Firmware (up to 20241028)
- D-Link DNS-320LW and DNS-320LW Firmware (up to 20241028)
- D-Link DNS-325 and DNS-325 Firmware (up to 20241028)
- D-Link DNS-340L and DNS-340L Firmware (up to 20241028)
Discovery Timeline
- November 6, 2024 - CVE-2024-10915 published to NVD
- November 8, 2024 - Last updated in NVD database
Technical Details for CVE-2024-10915
Vulnerability Analysis
This vulnerability falls under CWE-78 (Improper Neutralization of Special Elements used in an OS Command) and CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component). The affected D-Link NAS devices fail to properly sanitize user-supplied input in the group parameter when processing requests to the account management CGI script.
When a user account creation request is submitted to /cgi-bin/account_mgr.cgi?cmd=cgi_user_add, the group parameter value is incorporated into a system command without adequate validation or escaping. This allows an attacker to break out of the intended command context and inject malicious shell commands.
While the attack complexity is noted as high due to certain exploitation prerequisites, the fact that exploitation can be performed remotely without authentication significantly elevates the risk. The publicly available exploit further compounds this threat by lowering the barrier to entry for potential attackers.
Root Cause
The root cause of this vulnerability is insufficient input validation and sanitization in the cgi_user_add function. The CGI script directly passes user-controlled data from the group parameter to underlying system commands without properly escaping shell metacharacters or validating the input against an allowlist of expected values.
This is a classic injection vulnerability pattern where trusted and untrusted data are concatenated and passed to a command interpreter. The lack of parameterized command execution or proper input encoding enables attackers to inject additional commands using shell metacharacters such as semicolons, pipes, backticks, or command substitution syntax.
Attack Vector
The attack vector is network-based, targeting the web management interface of vulnerable D-Link NAS devices. An attacker can craft a malicious HTTP request to the /cgi-bin/account_mgr.cgi endpoint with the cmd=cgi_user_add parameter and inject OS commands through the group parameter.
The attack can be executed by sending specially crafted HTTP requests to the device's web interface. The injected commands execute with the privileges of the web server process, which typically runs with elevated permissions on embedded devices.
For detailed technical information about the exploitation mechanism, see the NetSecFish Command Injection Report.
Detection Methods for CVE-2024-10915
Indicators of Compromise
- Unexpected HTTP requests to /cgi-bin/account_mgr.cgi with cmd=cgi_user_add containing special characters or shell metacharacters in the group parameter
- Unusual processes spawned by the NAS web server, particularly shell processes or commands not associated with normal device operation
- Outbound network connections from NAS devices to unexpected external IP addresses
- Modified system files or new user accounts on the NAS device not created through legitimate administrative actions
- Log entries showing failed or successful command execution attempts through the CGI interface
Detection Strategies
- Implement network intrusion detection rules to identify HTTP requests targeting /cgi-bin/account_mgr.cgi with suspicious patterns in query parameters
- Monitor NAS device web access logs for requests containing shell metacharacters (;, |, `, $(), &&, ||) in URL parameters
- Deploy network segmentation monitoring to detect unusual traffic patterns from NAS devices to other network segments or external hosts
- Use endpoint detection solutions capable of monitoring embedded device behavior for anomalous process execution
Monitoring Recommendations
- Enable comprehensive logging on D-Link NAS devices and forward logs to a centralized SIEM solution for analysis
- Implement network traffic analysis to baseline normal NAS device communication patterns and alert on deviations
- Configure firewall rules to alert on any unexpected outbound connections from NAS devices
- Establish regular integrity monitoring of NAS device configurations and user account lists
How to Mitigate CVE-2024-10915
Immediate Actions Required
- Isolate affected D-Link NAS devices from direct internet exposure by placing them behind a firewall with strict access controls
- Restrict access to the web management interface to trusted IP addresses only using network ACLs or firewall rules
- Disable remote management features if not required for business operations
- Audit existing NAS device user accounts and remove any unauthorized or suspicious accounts
- Implement network segmentation to limit the potential impact if a device is compromised
Patch Information
At the time of publication, users should check the D-Link Official Website for the latest security advisories and firmware updates for affected models. Given that some of these NAS models may be end-of-life products, D-Link may not release patches for all affected devices.
For devices that are no longer supported, organizations should strongly consider replacing them with actively maintained alternatives that receive regular security updates.
Workarounds
- Block external access to the NAS web interface (typically ports 80/443) at the network perimeter
- Use a VPN to access the NAS management interface instead of exposing it directly to untrusted networks
- Implement a reverse proxy with web application firewall (WAF) capabilities to filter malicious requests
- If possible, disable the CGI functionality or the specific vulnerable endpoint through device configuration
- Consider deploying network-based intrusion prevention systems (IPS) with signatures for command injection attacks
# Example firewall rule to restrict NAS web access (iptables)
# Replace 192.168.1.100 with your NAS IP and 192.168.1.0/24 with trusted network
iptables -A INPUT -p tcp -d 192.168.1.100 --dport 80 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp -d 192.168.1.100 --dport 80 -j DROP
iptables -A INPUT -p tcp -d 192.168.1.100 --dport 443 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp -d 192.168.1.100 --dport 443 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


