Quantum Secular Labs / Blog / Advisories
CVE-2018-19987: D-Link DIR-822 Rev.B: Command injection
CVE-2018-19987 is rated critical with a CVSS v3.0 base score of 9.8 and NVD lists 7 affected products, including D Link Dir 818lw Firmware. Per its scoring, it can be exploited over the network, without authentication, without any user interaction. The scored impact on confidentiality, integrity and availability is the highest available.
Vulnerability description
D-Link DIR-822 Rev.B 202KRb06, DIR-822 Rev.C 3.10B06, DIR-860L Rev.B 2.03.B03, DIR-868L Rev.B 2.05B02, DIR-880L Rev.A 1.20B01_01_i3se_BETA, and DIR-890L Rev.A 1.21B02_BETA devices mishandle IsAccessPoint in /HNAP1/SetAccessPointMode. In the SetAccessPointMode.php source code, the IsAccessPoint parameter is saved in the ShellPath script file without any regex checking. After the script file is executed, the command injection occurs. A vulnerable /HNAP1/SetAccessPointMode XML message could have shell metacharacters in the IsAccessPoint element such as the `telnetd` string.
Severity breakdown
CVSS v3.0 9.8: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector: Network. Exploitable remotely over the network, with no need for local or physical access.
- Attack complexity: Low. No special conditions; the attack can be repeated reliably.
- Privileges required: None. No account or prior access is needed.
- User interaction: None. No action from any user is needed.
- Scope: Unchanged. Impact stays within the vulnerable component.
- Confidentiality impact: High. Total loss of confidentiality; sensitive data can be fully disclosed.
- Integrity impact: High. Total loss of integrity; data or system state can be fully modified.
- Availability impact: High. Total loss of availability; the component can be shut down.
Underlying weakness
CWE-78: Improper Neutralization of Special Elements used in an OS Command
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command before it is sent to a downstream component.
Affected products
- D Link Dir 818lw Firmware: 2.05.b03
- D Link Dir 822 Firmware: 202krb06
- D-Link Dir 822 Firmware: 3.10b06
- D Link Dir 860l Firmware: 2.03.b03
- D Link Dir 868l Firmware: 2.05b02
- D Link Dir 880l Firmware: 1.20b01_01_i3se beta
- D Link Dir 890l/R Firmware: 1.21b02 beta