# CVE-2019-8318: D-Link DIR-878 - RCE

> Live exploitation tracking for CVE-2019-8318 by the CrowdSec Live Exploit Tracker, built from real-world attack data crowdsourced from CrowdSec's global network.

Page: https://tracker.crowdsec.net/cves/CVE-2019-8318

## Key facts

- **Exploitation phase:** Background Noise. Continuous low-level scanning or exploitation attempts are observed, mostly opportunistic and automated.
- **CVSS score:** 8.8
- **Public exploit available:** Yes
- **Affected products:** D-Link DIR-878
- **Weaknesses:** CWE-78 (Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'))
- **Tags:** firewall, iot

## Description

An issue was discovered on D-Link DIR-878 devices with firmware 1.12A1. This issue is a Command Injection allowing a remote attacker to execute arbitrary code, and get a root shell. A command Injection vulnerability allows attackers to execute arbitrary OS commands via a crafted /HNAP1 POST request. This occurs when any HNAP API function triggers a call to the twsystem function with untrusted input from the request body for the SetSysEmailSettings API function, as demonstrated by shell metacharacters in the SMTPServerPort field.

## CrowdSec analysis

[CVE-2019-8318](https://euvd.enisa.europa.eu/vulnerability/CVE-2019-8318) is a command injection vulnerability affecting certain D-Link router models, enabling remote attackers to execute arbitrary OS commands on the device and gain unauthorized root access.

CrowdSec has been tracking this vulnerability and its exploits since 3rd of July 2024.

CrowdSec network data shows that most actors exploiting CVE-2019-8318 rely on broad, untargeted scans with minimal filtering. The activity is largely automated and opportunistic in nature.
Telemetry from the CrowdSec network also shows that exploitation activity for CVE-2019-8318 remains steady week-over-week. Attack volumes are consistent with long-term trends, indicating sustained interest from threat actors. CVE-2019-8318 continues to be an active part of the threat landscape and will likely remain this way for the forseeable future.

Observed exploitation attempts are characterized by requests directed to URLs containing `/hnap1`.

## Timeline

- 2019-02-13: CVE Published. CVE-2019-8318 is published to NVD.
- 2024-07-03: Rule Released. CrowdSec releases a rule to detect CVE-2019-8318 exploitation attempts against the CrowdSec Network.
- 2024-07-03: CrowdSec First Seen. CrowdSec observes in-the-wild exploitation of CVE-2019-8318 for the first time.

## References

- https://github.com/leonW7/D-Link/blob/master/878/mail.md

## Live exploitation data

The [Live Exploit Tracker page](https://tracker.crowdsec.net/cves/CVE-2019-8318) follows observed exploitation activity for CVE-2019-8318. [Request an API key](https://tracker.crowdsec.net/request-api-key) for full access to its exploitation timeline, attacking IP addresses and blocklists.
