| Título | D-Link DI-8100 16.07.26A1 Heap-based Buffer Overflow |
|---|
| Descripción | Unauthenticated heap-based buffer overflow in the HTTP request parser of jhttpd on D-Link DI-8100 A1 leads to remote code execution as root.
Affected product: D-Link DI-8100 A1
Firmware: 16.07.26A1 (MD5 e8b16772c8962db9609033d593fec712)
Component: /usr/sbin/jhttpd (vendor-embedded private HTTP server, MIPS32 little-endian, non-PIE)
Vulnerable function: httpd_do_recv @ 0x004110E4
Vulnerability type: CWE-190 / CWE-122 / CWE-94
Authentication required: none
Impact: remote code execution with root privileges (Uid 0)
Root cause
httpd_do_recv() allocates the request body buffer with
alloc = (Content-Length & ~0x3ff) + 0x401
and then copies the received body with
memcpy(dest, conn + 0x220 + recv_offset, n)
where n is the number of bytes actually received in this read. There is no comparison between n and Content-Length, nor between n and the allocated size. A request that declares "Content-Length: 2" (allocating only 0x401 bytes) while sending 3000 body bytes produces a linear heap overflow of about 1975 bytes. The body is parsed before URL routing and before any authentication check, so the overflow is reachable without credentials, on any POST route.
Exploitation
The overflow corrupts an adjacent httpd_conn structure. The overwritten hash_next / hash_prev fields are consumed by __httpd_out_hash() @ 0x412154, which performs an unguarded 4-byte write (*(hash_prev) = hash_next) without dlmalloc unlink checks. This primitive overwrites the GOT entry at 0x005D7AF0 (__httpd_conn_m_free), so the tail call in httpd_conn_close() @ 0x413624 jumps into shellcode placed in a previously allocated body buffer. The shellcode calls system@plt (0x00483FE0) with an attacker-controlled command, executed as root.
Reproduction (QEMU user-mode emulation with the official rootfs)
1. Start jhttpd under qemu-mipsel-static with a gdb stub.
2. Calibrate the first body buffer address with a breakpoint at 0x4116EC (observed 0x613468).
3. Run the provided PoC (three-connection heap grooming, six steps).
4. The command "cat /proc/self/status > /tmp/hole_pwn" runs as root; the file contains "Uid: 0 0 0 0" and "Gid: 0 0 0 0", and the jhttpd process stays alive.
CVSS 3.1: 8.1 High
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
(AC:H reflects the need to know/calibrate the heap address; on devices without ASLR this address is static)
Duplicate check (2026-11-05)
NVD keyword "httpd_do_recv": 0 results.
NVD keyword "DI-8100 heap": 0 results.
NVD "DI-8100": 34 results, all CGI-endpoint parameter-level stack overflows or command injections (e.g. CVE-2025-3538 auth.asp callback, CVE-2025-4544 ddos.asp, CVE-2025-5228 login.cgi notify).
NVD "jhttpd": 19 results, none is a request-parser heap overflow.
CNVD-2025-18430 (arp_sys.asp) and CNVD-2026-32586 through CNVD-2026-32595 are endpoint-level overflows or command injections.
Vendor advisories (SAP10465) only cover command injection issues.
No public record covers a Content-Length / httpd_do_recv heap overflow.
Note
The jhttpd binary contains WayOS platform strings (www.wayos.cn, wayos_version, jhl_*, wys), indicating a vendor/OEM platform origin. Other DI-series models sharing this code base may be affected but were not individually verified.
Suggested fix
Allocate the body buffer from the full Content-Length with an upper bound check (reject oversized bodies with 413), clamp the copy length to the remaining declared and allocated space, and limit recv() to the remaining Content-Length. Build with PIE, full RELRO, NX and FORTIFY_SOURCE, and run jhttpd as an unprivileged user. |
|---|
| Fuente | ⚠️ https://c0bn2osv604.feishu.cn/wiki/HEKQwg5ueixsoGkwhrQcC3xZnuf?from=from_copylink |
|---|
| Usuario | messi-yb (UID 89356) |
|---|
| Sumisión | 2026-11-06 16:12 (hace 23 días) |
|---|
| Moderación | 2026-11-29 16:01 (23 days later) |
|---|
| Estado | Aceptado |
|---|
| Entrada de VulDB | 445194 [D-Link DI-8100 16.07.26A1 /usr/sbin/jhttpd httpd_do_recv desbordamiento de búfer] |
|---|
| Puntos | 20 |
|---|