CVE-2023-41221
JSON

6.8medium

D-Link DIR-3040 prog.cgi SetWLanRadioSecurity Stack-Based Buffer Overflow Remote Code Execution Vulnerability

Severity
6.8medium CVSS:3.0 by zdi
Exploit likelihood
0.87% (higher than 59% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
zdi

Description

D-Link DIR-3040 prog.cgi SetWLanRadioSecurity 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-3040 routers. Authentication is required to exploit this vulnerability. The specific flaw exists within the prog.cgi binary, 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 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. Was ZDI-CAN-21621.

Affected

Product or packageVersionsReported by
D-Link DIR-3040120B03CVE List
dlink dir-3040_firmware1.20b03, up to 1.20b03CVE List, NVD

All scores

zdi6.8medium CVSS:3.0CVSS:3.0/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NVD6.8medium CVSS:3.1CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-121CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

D-Link DIR-3040 prog.cgi SetWLanRadioSecurity 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-3040 routers. Authentication is required to exploit this vulnerability. The specific flaw exists within the prog.cgi binary, 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 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. Was ZDI-CAN-21621.

NVD (es)

D-Link DIR-3040 prog.cgi SetWLanRadioSecurity Vulnerabilidad de ejecución remota de código de desbordamiento de búfer en la región stack de la memoria. Esta vulnerabilidad permite a atacantes adyacentes a la red ejecutar código arbitrario en instalaciones afectadas de enrutadores D-Link DIR-3040. Se requiere autenticación para aprovechar esta vulnerabilidad. La falla específica existe dentro del binario prog.cgi, que maneja las solicitudes HNAP realizadas al servidor web lighttpd que escucha en los puertos TCP 80 y 443. El problema se debe a la falta de validación adecuada de una cadena proporcionada por el usuario antes de copiarla en un búfer basado en pila de tamaño fijo. Un atacante puede aprovechar esta vulnerabilidad para ejecutar código en el contexto de la raíz. Era ZDI-CAN-21621.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-41221 changed 2024-08-02CVE Terms of Use
NVDCVE-2023-41221 changed 2026-06-17Public domain