Skip to content
RCE Advisory Beginner CVE-2021-21820

D-LINK DIR-3040 Libcli test environment hard-coded password vulnerability

The D-LINK DIR-3040 router contains a hidden telnet service that can be started without authentication via a specific URL, and this service uses a hard-coded default password for the 'libcli test environment'. An attacker who can reach the router's web interface can start the telnet service and log in using the default password, gaining access to a command-line interface that allows executing various system commands, potentially leading to code execution.

Dave McDaniel Follow

Originally disclosed on Cisco Talos

Critical 10.0 View original

A hard-coded password vulnerability exists in the Libcli Test Environment functionality of D-LINK DIR-3040 1.13B03. A specially crafted network request can lead to code execution.

Dave McDaniel, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The firmware includes a hidden telnet service that can be enabled without authentication and uses a hard-coded default password for the 'libcli test environment'.

Impact

An attacker could execute arbitrary commands on the router, leading to full compromise of the device.

What the attacker needed

Network access to the router's web interface; No authentication required to start telnet

The fix

The vendor patched the vulnerability, likely by removing the hidden telnet service or changing the hard-coded password.

How it was found

  1. Send a request to the router's /start_telnet endpoint to start the hidden telnet service.
  2. Connect to the router's telnet service on port 23.
  3. Log in with the username 'admin' and the hard-coded default password.
  4. Interact with the libcli test environment to run system commands.

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 report has not been written yet. The Original tab links to the source.

This router has a secret backdoor: a special web address turns on a remote command-line service (telnet) that lets someone log in with a password that is the same for every device. Because the password is fixed and publicly known, anyone who can reach the router's web page can take control of it. The report shows how to start the service and log in with the default password.

What is RCE?

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

More by Dave McDaniel

View all

23 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

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.