# Here We Go Again (Citrix NetScaler DTLS Preauth Memory Overflow CVE-2026-88772)

DTLS handshake reassembly in Citrix NetScaler nsppe copies an oversized NSB chain into a 35,840-byte scratch buffer, giving preauth heap overflow to RCE.

- Payout: Real-world hack
- Severity: critical
- Program: Citrix
- Analysis by: Sina Kheirkhah
- Disclosed: 2026-09-29
- CVE: CVE-2026-88772
- Write-up quality: 9/10
- Original: https://labs.watchtowr.com/here-we-go-again-citrix-netscaler-dtls-preauth-memory-overflow-cve-2026-88772/
- Library page: https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-here-we-go-again-citrix-netscaler-dtls-preauth-memory-overflow-cve-2026-88772
- Tags: area:devices domain:network impact:dos impact:rce kind:incident platform:research sev:critical tech:linux technique:chained technique:reverse-engineering technique:source-review vuln:memory-corruption vuln:rce

**Target:** NetScaler nsppe DTLS handshake reassembly (9462/UDP)
**Root cause:** Reassembly trusts the primary handshake header's length=120 to locate the next header but uses fragment_length=1 for reassembly, so each record's full ~1,459-byte NSB is retained; the NSB-chain copy into the 0x8c00 scratch buffer lacks a total-size check.
**Steps:**
1. Complete DTLS cookie exchange: send small ClientHello, receive HelloVerifyRequest cookie, resend ClientHello with cookie on same UDP socket.
2. Craft record: 13-byte DTLS header + 12-byte primary handshake header (`length=120`, `message_seq=2`, `fragment_offset=N`, `fragment_length=1`) + 120-byte primary area + 12-byte hidden header (`length=1434`, `message_seq=3`, `fragment_length=1434`) + 1315 bytes filler.
3. Send 120 records with fragment_offset 0..119, all message_seq=2, fragment_length=1.
4. Server marks 120-byte message complete but NSB chain holds ~173,652 bytes; copy into 0x8c00 scratch buffer overflows by ~137,825 bytes.
5. Overwrite global list pointer at 0x357f820 to avoid early crash, then fake object at 0x355c800 with method table at 0x355d800 and virtual method slot at +0xd0.
6. ROP: `pop rdi ; ret`, `pop rsi ; ret`, `pop rdx ; ret`, `mprotect(0x355e000,0x1000,7)` then ret into shellcode at 0x355e100.
**How found:** Patch-diffed nsppe between 14.1-73.30 and 14.1-73.37, spotting the added space_left check (cmp r15d, edx / jb reject) before memcpy in the NSB-chain copy loop; then reasoned about DTLS header length vs fragment_length discrepancy to build the oversized chain.
**Exploitation:** Preauth attacker on UDP 9462 completes cookie handshake, sends 120 crafted DTLS records to overflow the scratch buffer, repairs the crashing list pointer with constant 0x357f820, fakes an object whose virtual method is invoked by a background thread, and uses a mprotect ROP chain (no PIE, NX on) to mark the overflow page RWX and jump to shellcode.
**Escalation:** Crash-to-RCE: pointer repair, fake vtable hijack of a periodically-called background-thread method, then mprotect ROP to bypass NX.
**Insight:** When a parser uses one length field to walk to the next header but a different field to account for bytes, look for reassembly buffers that retain whole records rather than the declared fragment; patch-diffing the copy loop's missing bounds check pinpoints the sink.

## Proof of concept (copied exactly from the original report)

**Malicious DTLS record layout with hidden handshake header**

```
13-byte DTLS record header

1,459-byte record body
├── 12-byte primary handshake header
│ length = 120
│ message_seq = 2
│ fragment_offset = record number, from 0 to 119
│ fragment_length = 1
├── 120-byte primary area
├── 12-byte hidden handshake header
│ length = 1434
│ message_seq = 3
│ fragment_offset = 0
│ fragment_length = 1434
└── 1,315 remaining bytes

The unusual part is the first handshake header. It claims two things at once:

- length=120: the complete message is 120 bytes long.
- fragment_length=1: this record supplies only one byte of that message.NSPPE uses length=120 when it moves through the packet looking for the next handshake header. That makes it step over the 120-byte primary area and find the hidden header.
The hidden header is there to satisfy the record's size accounting. The two 12-byte headers and their declared fragment sizes add up to the complete 1,459-byte body:

12 + 1 + 12 + 1434 = 1459

At the same time, the bytes actually placed in the packet also add up to 1,459:

12 + 120 + 12 + 1315 = 1459
```

**120 repeated fragments with incrementing offsets**

```
record 1 fragment_offset = 0
record 2 fragment_offset = 1
record 3 fragment_offset = 2
...
record 120 fragment_offset = 119
```

**ROP chain calling mprotect then shellcode**

```
pop rdi ; ret │ RDI -> page to change
pop rsi ; ret │ RSI -> 0x1000
pop rdx ; ret │ RDX -> 0x7 (R | W | X)
mprotect │ mprotect(rdi, rsi, rdx)
shellcode address │ ret -> shellcode
```

## Write-ups of the same bug (oldest first)
- 2026-09-29: [Here We Go Again (Citrix NetScaler DTLS Preauth Memory Overflow CVE-2026-88772)](https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-here-we-go-again-citrix-netscaler-dtls-preauth-memory-overflow-cve-2026-88772) — Sina Kheirkhah (this one)
- 2026-09-30: [Threat Brief: NetScaler Zero Days CVE-2026-88771 and CVE-2026-88772 Exploited in the Wild (Updated September 30)](https://bugbountylibrary.com/r/blog%3Aunit42-paloaltonetworks-com-netscaler-zero-days-exploited) — Unit 42

