CVE-2026-7831: UltraVNC viewer off-by-one stack overflow in ServerInit desktop name parsing
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
UltraVNC viewerto a version that resolves this vulnerability.Fixed in 1.8.2.2Patch UltraVNC viewer through 1.8.2.2 contains an off-by-one stack buffer overflow in the RFB ServerInit message handler. - Compensating control
Prevent/limit connections to untrusted VNC servers (user must connect viewer to the malicious server), e.g., restrict which hosts/servers UltraVNC viewer can connect to via network ACL/firewall.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-7831?
The severity of CVE-2026-7831 is classified as high with a score of 7.6.
What is CVE-2026-7831?
CVE-2026-7831 is a vulnerability in UltraVNC viewer that involves an off-by-one stack overflow in the ServerInit desktop name parsing.
How do I fix CVE-2026-7831?
To fix CVE-2026-7831, you should update to the latest version of UltraVNC that addresses this vulnerability.
What are the potential impacts of CVE-2026-7831?
Exploitation of CVE-2026-7831 could lead to a stack overflow, which may allow an attacker to execute arbitrary code.
Which versions of UltraVNC are affected by CVE-2026-7831?
UltraVNC viewer versions up to and including 1.8.2.2 are affected by CVE-2026-7831.