PT-2023-5828 · D Link · D-Link Dir-3040
Nicholas Zubrisky
·
Published
2023-07-12
·
Updated
2025-05-15
·
CVE-2023-41224
CVSS v2.0
7.7
High
| Vector | AV:A/AC:L/Au:S/C:C/I:C/A:C |
Name of the Vulnerable Software and Affected Versions
D-Link DIR-3040 (affected versions not specified)
Description
The issue is related to a stack-based buffer overflow in the SetDeviceSettings() function of the D-Link DIR-3040 wireless router's firmware. This can be exploited by sending specially crafted HNAP requests to TCP ports 80 and 443, allowing a remote attacker to execute arbitrary code. The flaw exists within the prog.cgi binary, which handles HNAP requests made to the lighttpd webserver. The issue results from the lack of proper validation of a user-supplied string before copying it to a fixed-size stack-based buffer. An attacker can leverage this vulnerability to execute code in the context of root.
Recommendations
As a temporary workaround, consider disabling the
SetDeviceSettings() function until a patch is available.
Restrict access to the prog.cgi binary to minimize the risk of exploitation.
Avoid using the HNAP requests in the affected API endpoint until the issue is resolved.
At the moment, there is no information about a newer version that contains a fix for this vulnerability.RCE
Stack Overflow
Memory Corruption
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
D-Link Dir-3040