CVE-2019-16920

9.8 CRITICAL

📋 TL;DR

Unauthenticated remote code execution vulnerability in D-Link routers via command injection in the PingTest CGI interface. Attackers can send specially crafted requests to execute arbitrary commands with root privileges. Affects multiple D-Link router models including DIR-655C, DIR-866L, DIR-652, DHP-1565, and others.

💻 Affected Systems

Products:
  • DIR-655C
  • DIR-866L
  • DIR-652
  • DHP-1565
  • DIR-855L
  • DAP-1533
  • DIR-862L
  • DIR-615
  • DIR-835
  • DIR-825
Versions: All firmware versions prior to vendor patches
Operating Systems: Embedded Linux (router firmware)
Default Config Vulnerable: ⚠️ Yes
Notes: Affects web management interface, typically accessible on port 80/443. No authentication required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise allowing attacker to install persistent backdoors, intercept network traffic, pivot to internal networks, and brick devices.

🟠

Likely Case

Attacker gains root shell access to router, enabling traffic interception, DNS hijacking, credential theft, and lateral movement to connected devices.

🟢

If Mitigated

If properly segmented and monitored, impact limited to router compromise with potential for network reconnaissance and limited lateral movement.

🌐 Internet-Facing: HIGH - Routers are typically internet-facing devices with web interfaces exposed to WAN, making them directly accessible to attackers.
🏢 Internal Only: MEDIUM - If WAN access is blocked, attackers would need internal network access first, but once compromised, router provides privileged position.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Simple HTTP POST request with command injection payload to PingTest endpoint. Multiple public exploits available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Varies by model - check D-Link advisories for specific firmware versions

Vendor Advisory: https://supportannouncement.us.dlink.com/announcement/publication.aspx?name=SAP10147

Restart Required: Yes

Instructions:

1. Identify router model and current firmware version. 2. Visit D-Link support site for your specific model. 3. Download latest firmware. 4. Log into router web interface. 5. Navigate to firmware update section. 6. Upload and apply new firmware. 7. Wait for router to reboot.

🔧 Temporary Workarounds

Disable WAN access to web interface

all

Prevent external access to router management interface

Log into router → Administration → Remote Management → Disable

Network segmentation and firewall rules

linux

Isolate routers and restrict access to management interfaces

iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -p tcp --dport 443 -j DROP

🧯 If You Can't Patch

  • Replace affected routers with supported models from different vendors
  • Implement strict network segmentation and monitor for suspicious traffic to router management interfaces

🔍 How to Verify

Check if Vulnerable:

Check if router responds to crafted POST request to /ping.cgi or similar PingTest endpoint with command injection payload

Check Version:

Log into router web interface → Status or Tools → Firmware Version

Verify Fix Applied:

Attempt exploitation after patch - should no longer execute injected commands. Verify firmware version matches patched release.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to ping.cgi or similar endpoints
  • Commands like ';', '|', '&' in URL parameters
  • Multiple failed login attempts followed by ping.cgi access

Network Indicators:

  • HTTP POST requests to router IP on port 80/443 containing shell metacharacters
  • Outbound connections from router to suspicious IPs

SIEM Query:

source="router.log" AND (url="*ping.cgi*" AND (param="*;*" OR param="*|*" OR param="*&*"))

🔗 References

📤 Share & Export