| Título | D-Link DSL-2640B 3.0.6.0.41 OS Command Injection (CWE-78) |
|---|
| Descrição | An OS command injection vulnerability was discovered in D-Link DSL-2640B firmware v3.0.6.0.41
(hardware revision A). The DMZ host page posts an address parameter to /scdmz.cmd; cgiScDmzHost()
(0x49278c) stores it and SecCfgMngr::setDmzHost() (0x458aa4) builds iptables rules with
sprintf(buf, "iptables -t nat -A PREROUTING -j DNAT -d %s --to-destination %s", wan_ip, address)
and sprintf(buf, "iptables -I FORWARD 1 -i %s -d %s -j ACCEPT", wan_if, address), each followed by
bcmSystemNoHang() (0x434f60), which executes the string with /bin/sh -c. The address is never parsed
or validated: inet_addr() is called only after both sprintf calls and its result is merely stored
into the configuration database (BcmPsi_objStore), while the raw string is what reaches the shell.
The only check is that the value is non-empty, and the web page's JavaScript IP validation is
client-side only. When the device has a WAN connection configured (any device in normal operation)
a request such as curl --get --data-urlencode 'address=x.x.x.x;mkdir /var/pwn;#' -u admin:admin
http://<device>/scdmz.cmd executes the injected command as root; the command is re-executed when the
DMZ policy is reapplied. Access also works with the hard-coded account (asus / 00202b004720) and
fails with 401 without credentials.
Proposed CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (8.8). |
|---|
| Fonte | ⚠️ https://github.com/dujiaode/DSL2640B/tree/main/03-scdmz-dmz-address-cmd-injection |
|---|
| Utilizador | qsc19995 (UID 102748) |
|---|
| Submissão | 04/11/2026 14h43 (há 24 dias) |
|---|
| Moderação | 28/11/2026 16h27 (24 days later) |
|---|
| Estado | Aceite |
|---|
| Entrada VulDB | 445114 [D-Link DSL-2640B 3.0.6.0.41 DMZ Host SecCfgMngr::setDmzHost address Elevação de Privilégios] |
|---|
| Pontos | 20 |
|---|