What this actually is.
Technical background, root cause, and affected surface.
UltraVNC viewer through 1.8.2.2 contains an off-by-one stack buffer overflow in the RFB ServerInit message handler. In vncviewer/ClientConnection.cpp, when the server-supplied nameLength equals exactly 2024 the code declares a 2024-byte stack buffer _dn[2024] and calls ReadString(_dn, 2024). ReadString writes the NUL terminator at buf[length], i.e., _dn[2024], one byte past the end of the stack buffer. A malicious VNC server can trigger this condition by advertising a desktop name of length 2024 in its ServerInit message. On release builds without stack canaries the single-byte NUL overwrite adjacent stack data. On builds with /GS stack protection the canary is corrupted and the process terminates, resulting in denial of service. User interaction (connecting the viewer to the malicious server) is required.
- Vendor
- UltraVNC
- Product
- UltraVNC Viewer
- Severity
- High
- CVSS Score
- 7.5
- Status
- Fixed
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H
- CWE
- CWE-193: Off-by-one Error, CWE-787: Out-of-bounds Write
From one request
to root shell.
Reproduced in a sandboxed environment. Requires only LAN or WiFi adjacency.
Malicious RFB server sets nameLength=2024 in ServerInit. ASan: stack-buffer-overflow at offset 4216 (_dn base+2024). /GS canary: process terminates with security check failure. Crash-trigger only.
The bug, and the fix.
char _dn[2024]={0}; ReadString(_dn, m_si.nameLength); // reads 2024 bytes // Inside ReadString (ClientConnection.cpp:6954): buf[length] = '\0'; // writes _dn[2024] — 1 byte OOB
Root cause: ReadString writes buf[length]='\0' unconditionally. Caller declares char _dn[2024] and passes length=2024. Exact-2024 case is not clamped before calling ReadString.
When does this fire?
All conditions must be true for the exploit to succeed.
Victim viewer connects to malicious VNC server. 2. RFB handshake and authentication complete. 3. Server sends ServerInit with nameLength=2024 (exactly). 4. Viewer: ReadString(_dn, 2024) → NUL written at _dn[2024] — 1 byte OOB.
What an attacker does to you.
Post-exploitation outcomes mapped to CVSS impact metrics.
Reliable crash of vncviewer.exe via /GS canary on MSVC Release builds (DoS). On builds without stack canaries, 1-byte stack overwrite may allow partial control-flow manipulation.
C:L · I:L · A:H
CWE-193: Off-by-one Error, CWE-787: Out-of-bounds Write
Fix it. In this order.
A runbook, not a checklist. Sequence matters — assume compromise before you act.
Pass min(nameLength, sizeof(_dn)-1) to ReadString. Vendor fix: stack buffer enlarged to char _dn[2025] so _dn[2024] is a valid index.
disclose@securin.ioVendors moved in days.
Attackers in hours.
Reconstructed from vendor advisories, CISA bulletins, and Securin research records.
Discovered and ASan crash-confirmed
Reported to vendor
Fix validated
Planned public disclosure
Timeline recorded · Disclosure coordinated by Securin
Cite, verify, go deeper.
Primary sources — NVD, CISA KEV, and machine-readable IoC feed.