Proof-of-concept and QEMU-mipsel lab for CVE-2026-129353, a pre-auth stack overflow in D-Link DIR-600L authentication.cgi, with crash and saved-RA control evidence.
authentication.cgi pre-auth stack buffer overflow via unbounded strcpy of id/password| CVE | CVE-2026-129353 (VDB-437416) |
| Component | D-Link DIR-600L hardware rev B, firmware 2.17 / 2.17b02 — authenticationcgi_main in htdocs/cgibin, served as /htdocs/web/authentication.cgi |
| Affected | DIR-600L B1 firmware 2.17, 2.17b02 (shared DIR-600Bx platform image) — EOL, no vendor fix will be released (D-Link SAP10393) |
| Fixed in | nothing; the device is end-of-life. This repository's differential uses a bounds-enforcing remediation instead (see §2) |
| CWE | CWE-121 (Stack-based Buffer Overflow), CWE-119 (Memory Corruption) |
| Impact | Pre-authentication memory corruption of the login CGI with demonstrated instruction-pointer control; crash of the CGI child per request (the httpd keeps serving) and, on exploitation, arbitrary code execution as the web server (root) on the device |
| Vector | Network, unauthenticated — a request whose URL query carries an over-long id (or password) parameter |
| Trigger | id of ≥ ~2100 bytes faults (si_addr=0x47474747); a NUL-free pointer-preserving fill of 2536 bytes reaches the saved $ra and sets it to an attacker-chosen value |
| CVSS | 10.0 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H (VulDB) — the exploitability metric on real hardware additionally requires knowledge of the target memory layout |
| Credit | ruanyi (VulDB user ruanyi101) — original advisory and emulated-evidence disclosure; this laboratory extends the proof to instruction-pointer control on the same MD5-verified firmware image |
The DIR-600L web login handler copies the request parameters id and
password into fixed stack buffers with unbounded strcpy calls that run
before any authentication or session check. Every parameter is taken from
the URL query string (REQUEST_URI), which the device's boa httpd sets for
GET and POST requests alike, so an unauthenticated LAN-side (or
WAN-side-with-management-exposed) client reaches both sinks with one request.
This laboratory re-hosts the real firmware binary — the exact
MD5-verified image the upstream advisory recorded — under qemu-mipsel
behind a front end that reproduces boa's CGI execution model, and proves the
complete chain: advisory-matching crash (0x47474747), crash threshold,
and saved-return-address control (faulting PC = 0x42424242).
main (0x00402a30) dispatches on the basename of argv[0]; the symlink
htdocs/web/authentication.cgi -> /htdocs/cgibin selects
authenticationcgi_main (0x0040c230). At the very top of that function,
before any credential or session validation (Ghidra 12.1.4 decompilation of
the shipped binary):
char local_820[1024]; /* id destination */
char local_420[1024]; /* password destination */
...
strcpy(local_820, sobj_get_string(parse_uri(FUN_0040bf8c, "id")));
strcpy(local_420, sobj_get_string(parse_uri(FUN_0040bf8c, "password")));
parse_uri (0x00403d84) reads getenv("REQUEST_URI"), takes everything
after the first ?, tokenises it on &/=, and hands each key/value pair
to the callback; there is no length limit anywhere on the path:
iVar1 = strchr(getenv("REQUEST_URI"), '?');
uVar2 = strlen(iVar1 + 1);
FUN_004039d4(&local_30, iVar1 + 1, uVar2); /* byte-wise sobj_add_char */
The saved $ra sits 2536 bytes above local_820, past several stack
pointers (local_e30, local_ba8, …). Consequences, all reproduced in
this lab:
'G' fill at si_addr=0x47474747, exactly the
signature in the upstream advisory's strace capture;$ra and the returning jr ra jumps to the
attacker-chosen address (0x42424242 in the PoC) — instruction-pointer
control, one step beyond the public advisory's evidence, which itself
noted a PC/RA snapshot was still missing.A second pair of the same strcpy calls into 128-byte buffers
(local_d28, local_ca8) exists further down the POST storage-account
branch — the same flaw at a shorter distance. The POST body is parsed by
cgibin_parse_request into a 128-byte buffer with a size argument of
0x1000; in this build the query-string sink fires first for every
request that carries parameters in the URL.
| service | image | role |
|---|---|---|
router-vuln | cve-2026-129353:lab with LAB_BOUNDS_SHIM=0 | the firmware rootfs (extracted at build from the MD5-verified vendor image) re-hosted under qemu-mipsel-static — the vulnerable side |
router-fixed | cve-2026-129353:lab with LAB_BOUNDS_SHIM=1 | the same binary with LD_PRELOAD=/usr/lib/bndshim.so (bounds-enforcing strcpy/sprintf, cap 256) — the remediation-shape side |
poc | cve-2026-129353-poc:local | stdlib-only Python driver |
The DIR-600L is end-of-life: D-Link's SAP10393 states all DIR-600/605/605L
revisions are EOL/EOS with no further firmware. No vendor patch exists or
will exist, so there is no "fixed version" to build. The differential in
this laboratory instead contrasts the shipped binary against the same
binary with the two dangerous libc entry points interposed by
lab/shim/bndshim.c — a freestanding mipsel .so with no DT_NEEDED
that loads under the firmware's own ld-uClibc.so.0 and bounds every
strcpy/sprintf destination at the smallest affected buffer (256). The
shim is a remediation shape, not a vendor patch: it demonstrates that
the crashes are exactly the unbounded copies and nothing else. On real
hardware the only available mitigations are retiring the device or strictly
isolating its management interface.
Provenance of the binary, verified twice: the firmware image
DIR-600Bx_FW217b02.bin (md5 2f953ec274caeab6bc643045da56ab29, matching
the hash recorded in the upstream research advisory) is downloaded at image
build, its vendor-LZMA squashfs is unpacked with sasquatch, and the
resulting htdocs/cgibin (md5 e7016496219d73b3be39cad163995fcc) is
byte-identical to an independent researcher's committed extraction of the
same image. The front end (lab/service.py) reproduces boa's CGI model:
one child process per request, headers as HTTP_* variables, REQUEST_URI
carrying the query, the POST body on stdin — so a guest crash is a reported
SIGSEGV with its si_addr, not a service outage.
./run-lab.sh build # firmware fetch+verify, extraction, lab + PoC images
./run-lab.sh up # cve129353lab network, router-vuln, router-fixed
./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
./run-lab.sh down
Single mode against one side:
podman run --rm --network cve129353lab cve-2026-129353-poc:local \
exploit --host=router-vuln
poc/poc.py (stdlib only; check / exploit / probe / mitigation):