Skip to content
Exploit for CVE-2026

Exploit for CVE-2026

Sploitus • November 15, 2026

# CVE-2026-129354 — D-Link DIR-600L HNAP `hnap_main` pre-auth stack buffer overflow via the `SOAPAction` header

[![License: MIT](

[![Research status: validated](

| **CVE** | CVE-2026-129354 (VDB-437417) |

| **Component** | D-Link DIR-600L hardware rev B, firmware 2.17b02 — `hnap_main` in `htdocs/cgibin`, reached as `/usr/sbin/hnap` through boa's `/HNAP1/` mapping (HNAP Handler) |

| **Affected** | DIR-600L B1 firmware 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 HNAP 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 — an HTTP request whose `SOAPAction` header contains a whitelisted HNAP action name followed by `/` and an over-long suffix |

| **Trigger** | `SOAPAction: " — suffix ≥ ~260 bytes faults (`si_addr=0x45454545`); a NUL-free pointer-preserving suffix of 236 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 HNAP handler derives the action it executes from the client-supplied

`SOAPAction` header. Its pre-authentication whitelist is a **substring

test** — any header that merely *contains* `

or `…/GetWLanRadios` passes without credentials — and the action actually

used is everything after the **last slash** of that same attacker-controlled

header. The action string is then copied into a 256-byte stack buffer with

an unbounded `strcpy` (and re-formatted through an unbounded `sprintf`

shell-command template). One request from an unauthenticated LAN-side (or

exposed-WAN-management) client corrupts the CGI child's stack; this

laboratory proves the chain end to end on the **real firmware binary** —

the exact MD5-verified image the upstream advisory recorded — re-hosted

under `qemu-mipsel` with boa's CGI execution model: advisory-matching crash

(`0x45454545`), crash threshold, and saved-return-address control

`main` (`0x00402a30`) dispatches on the basename of `argv[0]`; boa maps

`/HNAP1/` to `/usr/sbin/hnap -> /htdocs/cgibin`, selecting `hnap_main`

(`0x00412a48`). Ghidra 12.1.4 decompilation of the shipped binary:

memset(auStack_228, 0, 0x100); /* 256-byte stack buffer */

soap = getenv("HTTP_SOAPACTION"); /* attacker controlled */

if (soap == NULL) soap = "

else if (strstr(soap, " == 0

&& strstr(soap, " == 0

&& hnap_auth_ok(auth) /dev/console[ &]",

"/var/run/", action); /* sink 2 — unbounded %s */

Two independent defects make the overflow pre-authentication reachable:

1. the whitelist is `strstr` — a substring match on the whole header, so

`"

satisfies it while the *checked* name and the *used* action are different

strings (the upstream advisory's observation);

2. the action used downstream is `strrchr(soap, '/') + 1` — the tail after

the last slash, fully attacker-controlled, of unbounded length.

The saved `$ra` sits 236 bytes above the destination buffer. Consequences,

all reproduced in this lab: `'E'` fill ≥ ~260 bytes faults at

`si_addr=0x45454545` (exactly the upstream advisory's strace signature);

a fill of **NUL-free pointers into the always-mapped uClibc text region**

keeps every intermediate dereference alive so the 236-byte offset lands on

the saved `$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

| `hnap-vuln` | `cve-2026-129354: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 |

| `hnap-fixed` | `cve-2026-129354: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-129354-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 affected buffer (256). The shim is a

**remediation shape, not a vendor patch**: it demonstrates that the crash

is exactly the unbounded copy and nothing else. On real hardware the only

available mitigations are retiring the device or strictly isolating its

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

for HNAP — one child per request, `SOAPAction` mapped to `HTTP_SOAPACTION`,

the URL in `REQUEST_URI`, the body on stdin, `/var/run/hnap.lock` creatable —

so a guest crash is a reported `SIGSEGV` with its `si_addr`, not a service

./run-lab.sh build # firmware fetch+verify, extraction, lab + PoC images

./run-lab.sh up # cve129354lab network, hnap-vuln, hnap-fixed

./run-lab.sh sweep # check / exploit / probe / mitigation on both sides

podman run --rm --network cve129354lab cve-2026-129354-poc:local \

`poc/poc.py` (stdlib only; `check` / `exploit` / `probe` / `mitigation`):

* **check** — one over-long whitelisted-prefixed `SOAPAction`; classifies

the target by the child's exit status and `si_addr`. Exit 1 vulnerable,

* **exploit** — stage 1 repeats the advisory's evidence (`'E'` fill →

`0x45454545`); stage 2 sweeps a pointer-preserving suffix to locate the

saved-`$ra` offset and proves instruction-pointer control with a

* **probe** — whitelist, quoting, method, header-shape and length matrix:

both whitelist entries, whitelist-name-as-suffix (substring match),

quoted vs unquoted, GET vs POST, absent header, and the

* **mitigation** — there is no vendor mitigation to test (EOL); the mode

demonstrates the front-end header cap as the effective mitigation and

| run | `hnap-vuln` (shipped binary) | `hnap-fixed` (bounds shim) |

| `check` | `VULNERABLE` — SIGSEGV, `si_addr=0x45454545` | clean, exit 255 |

| `exploit` stage 1 | SIGSEGV `0x45454545` | no crash |

| `exploit` stage 2 | saved `$ra` overwritten (offset 236), faulting PC `0x42424242` | no crash |

| `probe` suffix ≤ 250 | no crash | no crash |

| `probe` suffix 260 / 500 (quoted, unquoted, GET) | crash `0x45454545` | no crash |

| `probe` `GetWLanRadios` prefix + 500E | crash | no crash |

| `probe` whitelist name placed mid-header (`x/…GetDeviceSettings/…`) | crash (substring whitelist) | no crash |

| `probe` no `SOAPAction` header | clean, exit 255 | clean |

| `probe` bare whitelisted name without `/` | clean (no `strrchr` hit), exit 254 | clean |

| `mitigation` | 250-byte action: clean; service survives every crash | clean |

Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,

`evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,

`evidence/versions.txt`, `evidence/0day-sweep.txt`.

* Podman (or Docker) with network-creation rights; the lab creates

`cve129354lab` and bounds every container to `--cpus 2 --memory 4g`.

* Outbound HTTPS at image build (firmware download from the public mirror;

MD5 enforced — an unmatched image aborts the build).

* The vulnerable code runs only inside the container's chroot; nothing

executes on the host. The firmware belongs to D-Link and is fetched at

## 7. Additional findings (0-day sweep on the fixed line)

The HNAP surface was swept with every whitelist-bypass form reachable from

the decompilation — both whitelist entries, the whitelist name embedded

mid-header (pure substring match), an `Authorization` header present,

double-slash variants, GET and POST, quoted and unquoted — at 500-byte

suffixes, on both sides of the differential

* every form that reaches `hnap_main` with an over-long action crashes on

the shipped binary at `0x45454545` and runs clean on the remediated side;

* no form produced a memory-corruption signature that survives the bounds

shim — i.e. no distinct unfixed path beyond CVE-2026-129354 itself.

The sibling login-handler overflow in the same binary is

CVE-2026-129353, reproduced with its own laboratory in

[CVE-2026-129353]( the

remaining `*_main` handlers of `htdocs/cgibin` were swept there and show no

run-lab.sh environment driver (build / up / sweep / down)

poc/poc.py the PoC (check / exploit / probe / mitigation)

poc/Dockerfile runner image (python:3.12-alpine)

lab/lab.Dockerfile multi-stage lab image (extract stage + runtime stage)

lab/firmware/prepare.sh firmware fetch, MD5 gate, sasquatch extraction

lab/shim/bndshim.c bounds-enforcing interposition (the remediation side)

lab/service.py boa-model HNAP front end (qemu-mipsel-static, chroot)

evidence/ captured runs of every mode on both sides

TRACKING.md excluded (working record)

* CVE record —

* VulDB entry —

* Upstream research advisory (ruanyi101) —

* Firmware image (independent public mirror of the vendor file, MD5-matched) —