CVE-2018-19986 Command injection in n/a

Critical 9.8 Published Updated

Attackers can execute arbitrary commands on D-Link routers by injecting shell metacharacters into the RemotePort parameter of the SetRouterSettings message.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2018-19986?

CVE-2018-19986 is a critical command injection vulnerability in n/a, published on 13 May 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In the /HNAP1/SetRouterSettings message, the RemotePort parameter is vulnerable, and the vulnerability affects D-Link DIR-818LW Rev.A 2.05.B03 and DIR-822 B1 202KRb06 devices. In the SetRouterSettings.php source code, the RemotePort parameter is saved in the $path_inf_wan1."/web" internal configuration memory without any regex checking. And in the IPTWAN_build_command function of the iptwan.php source code, the data in $path_inf_wan1."/web" is used with the iptables command without any regex checking. A vulnerable /HNAP1/SetRouterSettings XML message could have shell metacharacters in the RemotePort element such as the `telnetd` string.

Weakness: CWE-78

Which versions are affected by CVE-2018-19986?

It affects 2 products.

Products include D-Link Dir-818lw Firmware, D-Link Dir-822 Firmware.

How do I fix CVE-2018-19986?

No fix has been published for CVE-2018-19986 yet. Limit exposure of the affected software until one is available.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2018-19986 being exploited?

There is no known exploitation of CVE-2018-19986 in the wild and no public exploit code.

Sources

Also known as GHSA-3phf-fpc4-v2qv.

Is CVE-2018-19986 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free