PoC Archive PoC Archive
CVE-2026-136404 category: network CVSS 9.8 (CRITICAL)
Patched

n2n Supernode Stack Buffer Overflow in REGISTER_SUPER_NAK (CVE-2026-136404)

Published: 2026-11-27 • Researcher: googlesky (PoC); ntop / n2n maintainers (fix)

Target software ntop n2n supernode (wire message decoder)
Affected versions n2n supernode 3.0 through 3.1.1; NVD fix commit 854fbbe. The upstream lab pins the wire.c fix at 537ae15
Status PoC (lab-validated differential; standalone exploit chain)
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-136404
Category
network
Affected product
ntop n2n supernode (wire message decoder)
Affected versions
n2n supernode 3.0 through 3.1.1; NVD fix commit 854fbbe. The upstream lab pins the wire.c fix at 537ae15
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-11-25
Author / Researchergooglesky (PoC); ntop / n2n maintainers (fix)
CVE / AdvisoryCVE-2026-136404
Categorynetwork
SeverityCritical
CVSS Score9.8 (CVSSv3.1)
StatusPoC (lab-validated differential; standalone exploit chain)
Tagsstack-buffer-overflow, n2n, supernode, UDP, unauthenticated, CWE-121, CWE-787, ASan
RelatedN/A

Affected Target

FieldValue
Software / Systemntop n2n supernode (wire message decoder)
Versions Affectedn2n supernode 3.0 through 3.1.1; NVD fix commit 854fbbe. The upstream lab pins the wire.c fix at 537ae15
Language / PlatformC; Linux
Authentication RequiredNo
Network Access RequiredYes (UDP wire messages)

Summary

CVE-2026-136404 is a stack-based buffer overflow in the n2n supernode’s wire message decoder. The decoder reads the auth token size and supernode count fields from attacker-controlled registration messages and uses them as copy lengths, bounded only by the remaining input rather than the fixed-size destination fields. An unauthenticated peer can therefore write past the 32-byte auth token field and the backup-supernode buffer, leaking stack canaries and pointers, overwriting the return address, or crashing the supernode. The included lab runs vulnerable and fixed harnesses under AddressSanitizer and demonstrates the differential; a standalone exploit chain is also included.

Vulnerability Details

Root Cause

decode_REGISTER_SUPER, decode_UNREGISTER_SUPER, decode_REGISTER_SUPER_ACK and decode_REGISTER_SUPER_NAK copy attacker-supplied length fields into fixed-size stack buffers without capping the length at the destination capacity (CWE-121 / CWE-787). A token_size greater than N2N_AUTH_MAX_TOKEN_SIZE, or a num_sn large enough that num_sn * entry_size exceeds the payload space, overflows the destination.

Attack Vector

An unauthenticated attacker sends a crafted UDP wire message to the supernode. The PoC’s chain registers an edge in a chosen community and then sends an oversized token_size in a REGISTER_SUPER_NAK message, producing the overflow. No credentials or prior edge registration are required for the vulnerable decoder.

Impact

Memory disclosure (stack canaries and pointers), controlled return-address overwrite leading to code execution, or denial of service via supernode crash. The lab demonstrates the overflow with AddressSanitizer; real-world exploitation requires network reachability to the supernode’s UDP port.

Environment / Lab Setup

Output
OS:          Linux with Podman or Docker
Target:      n2n supernode (vulnerable / fixed harness) in Docker
Attacker:    Python 3 client inside the lab network
Tools:       Podman, gcc 14 with ASan, python3

Setup Steps

Shell script
1
2
3
4
5
6
7
./run-lab.sh build
./run-lab.sh up
./run-lab.sh sweep

make build up sweep

./run-lab.sh down

Proof of Concept

Step-by-Step Reproduction

  1. Build the vulnerable and fixed ASan harnesses with ./run-lab.sh build.
  2. Start both supernode containers on the isolated lab network.
  3. Run poc/poc.py check --host=n2n-vuln; the vulnerable side reports the ASan overflow, while n2n-fixed rejects the oversized token.
  4. Use poc/poc.py exploit for the narrated overflow chain, or exploit/exploit.py for the standalone chain.
  5. Inspect evidence/ for captured runs of every mode on both sides.

Exploit Code

See poc/poc.py, exploit/exploit.py, and the ASan harnesses in lab/.

The PoC is a lab-validated differential, not a production exploit: it proves the overflow and the guard, and the standalone chain demonstrates the memory-corruption primitive under the pinned harness.

Expected Output

Output
1
2
3
4
5
6
7
================ check / n2n-vuln ================
AddressSanitizer: stack-buffer-overflow ... WRITE of size ...
exit: 1

================ check / n2n-fixed ================
GUARD token_size rejected
exit: 0

Detection & Indicators of Compromise

  • n2n supernode crashes or ASan reports a stack-buffer-overflow in the wire decoder.
  • REGISTER_SUPER / REGISTER_SUPER_NAK messages with token_size above N2N_AUTH_MAX_TOKEN_SIZE or implausible num_sn values.
  • Repeated malformed UDP registrations from a single peer, followed by process restarts.
  • Supernode disconnects or memory-corruption symptoms on an internet-facing edge.

SIEM / IDS rule (example):

Output
1
2
alert udp any any -> any 7654 (msg:"n2n oversized token_size"; \
  content:"|00|"; depth:1; sid:9002631;)

Remediation

ActionDetail
PatchUpgrade n2n to a build containing the wire decoder bounds fix (NVD: commit 854fbbe; upstream lab: 537ae15).
WorkaroundRestrict the supernode UDP port to trusted edges, and filter malformed registration messages at the edge.
Config HardeningMonitor supernode crash/restart loops and validate registration message sizes at the network boundary.

References

Notes

Reviewed from the 2026-11-27 watchlist. The repository is a genuine, MIT-licensed lab with vulnerable and fixed harnesses, captured evidence and an explicit check/exploit/probe/mitigation flow; it is not a detector or scanner. The NVD affected range says 3.0 through 3.1.1 with fix commit 854fbbe, while the upstream lab pins the wire.c fix at 537ae15; both are recorded above rather than silently reconciled.

The PoC was not executed during preparation. Run only against supernodes you own or have written authorization to test; the lab is isolated and uses ASan.

run-lab.sh
1
2
3
4
5
6
7
8
#!/usr/bin/env bash
set -euo pipefail
NET="cve136404lab"; HERE="$(cd "$(dirname "$0")" && pwd)"
build(){ for s in vuln fixed; do sudo -n podman build -q -f "$HERE/lab/lab.Dockerfile" --target "$s" -t "cve-2026-136404:$s" "$HERE" >/dev/null; done; sudo -n podman build -q -t cve-2026-136404-poc:local "$HERE/poc" >/dev/null; }
up(){ sudo -n podman network create "$NET" 2>/dev/null||true; for s in vuln fixed; do sudo -n podman run -d --name "n2n-$s" --network "$NET" --cpus 2 --memory 1g "cve-2026-136404:$s" >/dev/null; done; }
sweep(){ for mode in check exploit probe mitigation; do for side in vuln fixed; do echo "================ $mode / n2n-$side ================"; set +e; sudo -n podman run --rm --network "$NET" --cpus 1 --memory 256m cve-2026-136404-poc:local "$mode" "--host=n2n-$side" | tee "$HERE/evidence/${mode}-${side}-run.txt"; echo "exit: $?"; set -e; done; done; }
down(){ sudo -n podman rm -f n2n-vuln n2n-fixed 2>/dev/null||true; sudo -n 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";;esac