n2n Supernode Stack Buffer Overflow in REGISTER_SUPER_NAK (CVE-2026-136404)
Published: 2026-11-27 • Researcher: googlesky (PoC); ntop / n2n maintainers (fix)
- 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
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-11-25 |
| Author / Researcher | googlesky (PoC); ntop / n2n maintainers (fix) |
| CVE / Advisory | CVE-2026-136404 |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1) |
| Status | PoC (lab-validated differential; standalone exploit chain) |
| Tags | stack-buffer-overflow, n2n, supernode, UDP, unauthenticated, CWE-121, CWE-787, ASan |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | ntop n2n supernode (wire message decoder) |
| Versions Affected | n2n supernode 3.0 through 3.1.1; NVD fix commit 854fbbe. The upstream lab pins the wire.c fix at 537ae15 |
| Language / Platform | C; Linux |
| Authentication Required | No |
| Network Access Required | Yes (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
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, python3Setup Steps
| |
Proof of Concept
Step-by-Step Reproduction
- Build the vulnerable and fixed ASan harnesses with
./run-lab.sh build. - Start both supernode containers on the isolated lab network.
- Run
poc/poc.py check --host=n2n-vuln; the vulnerable side reports the ASan overflow, whilen2n-fixedrejects the oversized token. - Use
poc/poc.py exploitfor the narrated overflow chain, orexploit/exploit.pyfor the standalone chain. - Inspect
evidence/for captured runs of every mode on both sides.
Exploit Code
See
poc/poc.py,exploit/exploit.py, and the ASan harnesses inlab/.
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
| |
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_sizeaboveN2N_AUTH_MAX_TOKEN_SIZEor implausiblenum_snvalues. - 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):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade n2n to a build containing the wire decoder bounds fix (NVD: commit 854fbbe; upstream lab: 537ae15). |
| Workaround | Restrict the supernode UDP port to trusted edges, and filter malformed registration messages at the edge. |
| Config Hardening | Monitor 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.
| |