Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2024-5293: CWE-121: Stack-based Buffer Overflow in D-Link DIR-2640

0
High
VulnerabilityCVE-2024-5293cvecve-2024-5293cwe-121
Published: Thu May 23 2024 (05/23/2024, 21:29:44 UTC)
Source: CVE Database V5
Vendor/Project: D-Link
Product: DIR-2640

Description

D-Link DIR-2640 HTTP Referer Stack-Based Buffer Overflow Remote Code Execution Vulnerability. This vulnerability allows network-adjacent attackers to execute arbitrary code on affected installations of D-Link DIR-2640-US routers. Authentication is not required to exploit this vulnerability. The specific flaw exists within prog.cgi, which handles HNAP requests made to the lighttpd webserver listening on TCP ports 80 and 443. The issue results from the lack of proper validation of the length of user-supplied data prior to copying it to a fixed-length stack-based buffer. An attacker can leverage this vulnerability to execute code in the context of root. Was ZDI-CAN-21853.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 02/26/2026, 02:30:25 UTC

Technical Analysis

CVE-2024-5293 is a stack-based buffer overflow vulnerability identified in the D-Link DIR-2640-US router firmware version 1.11B02_BETA02. The vulnerability resides in the prog.cgi script, which processes Home Network Administration Protocol (HNAP) requests served by the embedded lighttpd webserver listening on TCP ports 80 and 443. The root cause is the absence of proper bounds checking on the length of user-supplied data before it is copied into a fixed-length stack buffer, leading to a classic stack buffer overflow (CWE-121). This flaw allows a remote attacker, positioned on the same network segment (network-adjacent), to send specially crafted HTTP Referer headers or HNAP requests that overflow the buffer and overwrite the stack, enabling arbitrary code execution with root privileges. No authentication or user interaction is required, which significantly lowers the barrier to exploitation. The vulnerability was assigned CVSS v3.0 base score 8.8, reflecting high impact on confidentiality, integrity, and availability. Although no known exploits are currently in the wild, the critical nature of the flaw and the ease of exploitation make this a significant threat to affected devices. The vulnerability was disclosed by the Zero Day Initiative (ZDI) under identifier ZDI-CAN-21853. No official patches or firmware updates have been published at the time of disclosure, increasing the urgency for mitigations.

Potential Impact

The impact of CVE-2024-5293 is severe for organizations using the D-Link DIR-2640-US router, especially those running the affected firmware version 1.11B02_BETA02. Successful exploitation grants attackers root-level remote code execution capabilities, allowing full control over the device. This can lead to interception or manipulation of network traffic, deployment of persistent malware, lateral movement within internal networks, and disruption of network availability. Confidential information passing through the router could be compromised, and the integrity of network operations undermined. Since the router often serves as a gateway device, compromise can facilitate attacks against connected systems and critical infrastructure. The lack of authentication requirement and the exposure of HTTP/HTTPS management interfaces increase the risk of exploitation by both internal and external threat actors positioned on the local network or VPN. Organizations relying on this router in enterprise, SMB, or home environments face significant operational and security risks until the vulnerability is remediated.

Mitigation Recommendations

1. Immediate mitigation should focus on network segmentation and access control: restrict access to the router's management interfaces (ports 80 and 443) to trusted IP addresses only, ideally via firewall rules or VLAN segmentation. 2. Disable remote management features if enabled, especially over WAN interfaces, to reduce exposure. 3. Monitor network traffic for unusual or malformed HNAP requests or HTTP Referer headers targeting the router. 4. Employ intrusion detection/prevention systems (IDS/IPS) with signatures or heuristics capable of detecting exploitation attempts targeting this vulnerability. 5. Regularly check for and apply official firmware updates or patches from D-Link as soon as they become available. 6. If patching is delayed, consider replacing affected devices with models not vulnerable to this issue. 7. Conduct internal audits to identify all instances of the DIR-2640 router and verify firmware versions to prioritize remediation. 8. Educate network administrators about the vulnerability and the importance of limiting administrative interface exposure. These steps go beyond generic advice by focusing on network-level controls and proactive monitoring tailored to the specific vulnerability vectors.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.1
Assigner Short Name
zdi
Date Reserved
2024-05-23T21:22:42.170Z
Cvss Version
3.0
State
PUBLISHED

Threat ID: 699f6be3b7ef31ef0b55bd4d

Added to database: 2/25/2026, 9:38:43 PM

Last enriched: 2/26/2026, 2:30:25 AM

Last updated: 4/12/2026, 5:06:46 PM

Views: 11

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses