Remote command injection in D-Link legacy DNS/DNR NAS devices

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2024-8129?

CVE-2024-8129 is a vulnerability classified as Improper Neutralization of Special Elements used in a Command, affecting DNS-120 (affected versions: 20240814), DNR-202L (affected versions: 20240814), DNS-315L (affected versions: 20240814), and 17 more products. This vulnerability is rated Medium, with a CVSS score of 5.3. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

A vulnerability, which was classified as critical, was found in D-Link DNS-120, DNR-202L, DNS-315L, DNS-320, DNS-320L, DNS-320LW, DNS-321, DNR-322L, DNS-323, DNS-325, DNS-326, DNS-327L, DNR-326, DNS-340L, DNS-343, DNS-345, DNS-726-4, DNS-1100-4, DNS-1200-05 and DNS-1550-04 up to 20240814. Affected is the function cgi_s3_modify of the file /cgi-bin/s3.cgi of the component HTTP POST Request Handler. The manipulation of the argument f_job_name leads to command injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. NOTE: This vulnerability only affects products that are no longer supported by the maintainer. NOTE: Vendor was contacted early and confirmed that the product is end-of-life. It should be retired and replaced.

Affected products and scope

  • Affected models: D-Link DNS-120, DNR-202L, DNS-315L, DNS-320, DNS-320L, DNS-320LW, DNS-321, DNR-322L, DNS-323, DNS-325, DNS-326, DNS-327L, DNR-326, DNS-340L, DNS-343, DNS-345, DNS-726-4, DNS-1100-4, DNS-1200-05, and DNS-1550-04. The record identifies the affected scope through 20240814; D-Link lists all hardware revisions for these models.
  • Support status: The products are end-of-life or end-of-service. No supported fixed release or security update is identified in the available evidence.

Technical details

The flaw is located in the HTTP POST Request Handler component, specifically the cgi_s3_modify function in /cgi-bin/s3.cgi. Manipulation of the f_job_name argument can lead to command injection when attacker-controlled data is processed by this component. The attack is remotely reachable, but the available evidence does not provide the complete request format, command construction, escaping behavior, execution context, or affected process privilege. The supplied assessments disagree about the authentication requirement: one assessment indicates that a low-privilege session is needed, while another indicates that no authentication is needed; the vulnerability narrative does not resolve this difference. D-Link confirms that the scope covers the listed legacy models and all hardware revisions identified in its EOL/EOS advisory.

Exploitability

The vulnerability is remotely exploitable, and the record states that an exploit or proof-of-concept has been publicly disclosed. Devices that remain reachable from untrusted networks should therefore be treated as exposed. The authentication requirement is unresolved because the supplied assessments conflict, while the narrative does not indicate a requirement for user interaction. The available evidence does not establish whether exploitation has been observed in the wild.

Technical impact

Successful exploitation could result in command execution on the device through the HTTP POST Request Handler, with potential effects on the confidentiality, integrity, and availability of NAS data or services. An attacker could potentially alter configuration, interfere with stored data, or disrupt operations, depending on the execution context that has not been documented. The evidence does not establish the process privilege, whether privilege escalation is possible, or whether compromise can extend to other systems. Because the products are unsupported, organizations should not rely on a future vendor patch as a condition for continued production use.

Business impact

If successfully exploited, the flaw could cause the affected service to process unintended commands in its execution context. Possible consequences include access to or modification of NAS data, configuration changes, and disruption of storage or surveillance services. The evidence does not establish the impact on connected systems, the possibility of privilege escalation, or whether the attack can cross a trust boundary. Operational risk is increased because the affected models are no longer supported and no confirmed security fix is available.

Remediation

  1. Retire and replace: D-Link recommends retiring and replacing all affected devices. This is the primary remediation because no confirmed patch or fixed release is available.
  2. Reduce exposure during transition: Remove the devices from Internet exposure and restrict access to their management interfaces from untrusted networks. If immediate replacement is not possible, isolate them from networks containing sensitive systems or data. These measures reduce risk temporarily but do not remove the command injection flaw.
  3. Investigate before disposal: Because a public exploit is available, review logs and unexpected device changes before retiring or replacing the equipment. No specific IOC is confirmed by the available evidence.
  4. Control replacement assets: Record the model, hardware revision, firmware, and network location of replacement equipment so that EOL products are not left in production.

Detection

  1. Inventory D-Link DNS and DNR devices, including their model and hardware revision; D-Link's advisory lists all hardware revisions within the affected scope.
  2. Compare recorded firmware or build information with the affected version boundary identified in the advisory and vulnerability record.
  3. Review HTTP access logs, reverse proxy logs, and device telemetry for requests to /cgi-bin/s3.cgi, activity associated with cgi_s3_modify, or references to the f_job_name argument.
  4. Investigate unexpected changes to NAS configuration, stored data, or services that correlate with suspicious requests. These are investigation leads, not confirmed indicators of compromise.
  5. Do not treat the absence of matching log entries as proof of safety, especially because the products are end-of-life and a public exploit is available.
Sources (27)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.