Skip to content
RCE Write-up Advanced

D-Link DAP-1860 Vulnerability

The D-Link DAP-1860 access point's web admin interface had a command injection flaw in the HNAP_AUTH header handling, allowing unauthenticated remote code execution, and an authentication bypass in the HNAP timestamp verification, allowing access to all HNAP APIs without credentials.

chung96vn.wordpress.com

Published on chung96vn.wordpress.com

In september 2019, i found 2 vulnerabilities on D-Link Access Point (DAP-1860), there are command injection lead to unauthenticated remote code execution and authentication bypass. There are critical vulnerabilities because i can attack successfully without authentication.

The author, on chung96vn.wordpress.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the uhttpd server fails to sanitise user input in the HNAP_AUTH header, leading to command injection, and the timestamp verification logic can be bypassed by manipulating the stored timestamp.

Impact

An attacker could execute arbitrary commands on the device without authentication and bypass authentication to access all HNAP APIs, potentially compromising the device and network.

What the attacker needed

Access to the device's web interface; no authentication required

The fix

The vulnerabilities were fixed in a firmware update released by D-Link.

How it was found

  1. Send an HNAP request with a crafted HNAP_AUTH header containing a command injection payload in the HNAP_TIME value.
  2. For authentication bypass, first send a request to overwrite the server's current_timestamp.
  3. Then send a request with hnap_timestamp equal to the server's current_timestamp to bypass authentication and access all HNAP APIs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report describes two security holes in a D-Link Wi-Fi access point. One lets an attacker run commands on the device without logging in, and the other lets them bypass the login check entirely. Both are serious because they can be exploited remotely without any password.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.