CVE-2021-43722

9.8 CRITICAL

📋 TL;DR

This vulnerability in D-Link DIR-645 routers allows remote attackers to execute arbitrary code via a buffer overflow in the HNAP service. Attackers can exploit this by sending specially crafted SOAPAction headers to trigger the overflow. All users of affected DIR-645 router versions are at risk.

💻 Affected Systems

Products:
  • D-Link DIR-645 Wireless N300 Router
Versions: Version 1.03 A1
Operating Systems: Embedded Linux firmware
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerable HNAP service runs on port 80 by default and is typically accessible from both WAN and LAN interfaces.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with root privileges leading to complete device compromise, network infiltration, and persistent backdoor installation.

🟠

Likely Case

Remote code execution allowing attackers to modify router settings, intercept traffic, or join the device to a botnet.

🟢

If Mitigated

Denial of service if exploit fails or is blocked, potentially crashing the router service.

🌐 Internet-Facing: HIGH - The vulnerable HNAP service is typically exposed to WAN interfaces by default.
🏢 Internal Only: MEDIUM - The service is also accessible from LAN, but requires internal network access.

🎯 Exploit Status

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

Public exploit code exists in GitHub repositories. The vulnerability requires no authentication and has straightforward exploitation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check D-Link support for latest firmware

Vendor Advisory: https://www.dlink.com/en/security-bulletin/

Restart Required: Yes

Instructions:

1. Visit D-Link support website. 2. Download latest firmware for DIR-645. 3. Log into router admin interface. 4. Navigate to firmware update section. 5. Upload and apply new firmware. 6. Reboot router.

🔧 Temporary Workarounds

Disable Remote Management

all

Prevent external access to the vulnerable HNAP service

Log into router admin -> Advanced -> Remote Management -> Disable

Block HNAP Service

linux

Use firewall rules to block access to port 80 on the router

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

🧯 If You Can't Patch

  • Segment the router on isolated network segment with strict firewall rules
  • Replace with a supported router model that receives security updates

🔍 How to Verify

Check if Vulnerable:

Check router firmware version in admin interface matches affected version 1.03 A1

Check Version:

Log into router admin interface and check System Info or Status page

Verify Fix Applied:

Verify firmware version has been updated to a version after the patch release

📡 Detection & Monitoring

Log Indicators:

  • Unusual SOAPAction header lengths in HTTP requests
  • Router service crashes or restarts

Network Indicators:

  • HTTP requests with abnormally long SOAPAction headers to router port 80
  • Exploit pattern matches in network traffic

SIEM Query:

source="router_logs" AND (http_user_agent="*overflow*" OR http_request="*SOAPAction:*" AND length(http_request)>500)

🔗 References

📤 Share & Export