HIGH 7.6

CVE-2026-7831: UltraVNC Viewer Stack Buffer Overflow (Off-by-One) – HIGH Severity

UltraVNC viewer versions up to 1.8.2.2 contain a stack buffer overflow vulnerability triggered when connecting to a malicious VNC server. The flaw occurs in how the viewer processes the server's desktop name during the initial connection handshake. If a server advertises a desktop name exactly 2024 bytes long, the viewer's buffer handling code writes a null terminator one byte beyond its allocated stack buffer. On systems without stack protection, this single-byte overflow can corrupt adjacent data; on systems with stack canary protection enabled, the corrupted canary causes the viewer to crash. An attacker must trick a user into connecting to their malicious VNC server to trigger the vulnerability.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.6 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H
Weaknesses (CWE)
CWE-193, CWE-787
Affected products
1 configuration(s)
Published / Modified
2026-07-01 / 2026-07-09

NVD description (verbatim)

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.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in vncviewer/ClientConnection.cpp's ServerInit message handler. When processing the RFB protocol's ServerInit message, the code allocates a fixed 2024-byte stack buffer (_dn[2024]) for the desktop name. The ReadString function writes input data followed by a NUL terminator at position buf[length]. When nameLength equals exactly 2024, ReadString writes the terminator at _dn[2024], which is one byte past the buffer boundary. This off-by-one error (CWE-193) results in a stack buffer overflow (CWE-787). The single-byte NUL write overwrites whatever stack data immediately follows the buffer. Builds compiled with /GS stack canary protection will detect the canary corruption and terminate the process; unprotected builds may allow memory corruption without immediate detection.

Business impact

This vulnerability affects any organization using UltraVNC viewer for remote system administration or technical support. An attacker controlling a network service (or positioned to intercept VNC connections) can crash the viewer application, disrupting remote access workflows and potentially locking administrators out of critical systems. The denial-of-service impact is certain on canary-protected builds. On unprotected builds, while a single-byte overflow is limited, it could enable stack data corruption or in carefully crafted scenarios potentially lead to more serious consequences. The requirement for user interaction—connecting to a malicious server—limits the attack surface but remains credible in social engineering or man-in-the-middle scenarios.

Affected systems

UltraVNC viewer through version 1.8.2.2 is affected. Organizations running this version or earlier on Windows systems (where /GS stack protection may or may not be enabled depending on build configuration) should assume they are vulnerable. Remote desktop access workflows using UltraVNC are the primary exposure vector. Users of newer versions should verify they are running a patched release per the vendor advisory.

Exploitability

Exploitation requires user interaction—the victim must initiate a connection to the attacker's malicious VNC server. Network access is required, but no authentication is needed at the VNC protocol level; the overflow occurs during the initial ServerInit handshake before authentication. The attack is deterministic: a nameLength of exactly 2024 bytes reliably triggers the condition. An attacker can easily craft a malicious RFB ServerInit message with the required desktop name length. On canary-protected builds, reliable denial of service is achievable; on unprotected builds, the single-byte overwrite outcome depends on adjacent stack layout but poses meaningful risk.

Remediation

Upgrade UltraVNC viewer to a patched version released after this vulnerability's public disclosure. Consult the UltraVNC project's advisory for the specific patched release. Until patching is possible, restrict users from connecting to untrusted or unverified VNC servers, and use network controls (firewall, VPN, host-based filtering) to ensure VNC connections only reach known, trusted infrastructure. Monitor for unexpected viewer crashes, which may indicate exploitation attempts.

Patch guidance

Check the UltraVNC project's official release notes and advisories for the first patched version following 1.8.2.2. Apply patches to all systems running the vulnerable viewer version. Verify in your environment that the viewer version has been updated by checking the application's About dialog or version properties. Test remote access workflows after patching to ensure continuity. If you are responsible for distributing UltraVNC within your organization, update your deployment baseline and prioritize rollout to users in sensitive or high-availability roles.

Detection guidance

Monitor for UltraVNC viewer process crashes on your endpoints, particularly crashes occurring immediately after VNC connection initiation. Check application event logs for unexpected termination of vncviewer.exe. Network-based detection is limited but possible: observe for VNC ServerInit messages with unusual desktop name lengths (near 2024 bytes). Endpoint detection and response (EDR) tools can alert on abnormal process termination patterns correlated with remote desktop activity. Conduct an inventory of UltraVNC viewer installations to identify systems still running versions through 1.8.2.2.

Why prioritize this

This vulnerability rates HIGH priority (CVSS 7.6) because it is easily exploitable with user interaction, affects confidentiality and integrity on unprotected builds, and guarantees denial of service on canary-protected systems. The requirement for user interaction (connection to a malicious server) moderates the risk but does not eliminate it, especially in environments where users may be socially engineered or where network segmentation is weak. Remote access tooling is critical infrastructure; disruption has immediate operational impact. Patch this vulnerability promptly in your deployment schedule.

Risk score, explained

The CVSS 7.6 HIGH score reflects network accessibility (AV:N), low attack complexity (AC:L), no privilege requirement (PR:N), user interaction required (UI:R), impacts to confidentiality (C:L) and integrity (I:L), and high availability impact (A:H). The availability impact is high because denial of service (process crash) is reliable and certain on protected builds and potential on unprotected builds. The presence of CWE-193 (off-by-one) and CWE-787 (out-of-bounds write) justifies the integrity and confidentiality concerns, though the single-byte overwrite limits their immediate exploitability in most configurations.

Frequently asked questions

Will patching UltraVNC viewer disrupt my remote access workflows?

No. Patching to a newer, corrected version of UltraVNC viewer is a drop-in replacement and does not change protocol compatibility or authentication methods. Update during a maintenance window if you wish, but the patch itself should not cause workflow disruption. Thorough testing in a non-production environment before broad deployment is still a best practice.

Can this vulnerability be exploited without user action?

No. The vulnerability requires a user to initiate a VNC connection to a malicious server. The overflow occurs during the ServerInit message handshake, which happens only after the user explicitly connects. Passive network monitoring or server compromise alone cannot exploit this flaw.

Does this vulnerability allow remote code execution?

The single-byte NUL terminator overflow on a stack buffer is limited in its exploitability. On systems with stack canaries (/GS), it causes immediate process termination (denial of service). On systems without canaries, the single-byte write could corrupt adjacent stack data, but achieving reliable code execution from a one-byte overwrite is extremely difficult and context-dependent. The threat model is primarily denial of service and potential minor data corruption.

What should I do if I cannot patch immediately?

Implement compensating controls: (1) Restrict users' ability to connect to untrusted VNC servers via policy or firewall rules; (2) Monitor for unexpected VNC viewer crashes in your logs; (3) Ensure your build of UltraVNC has stack canary protection enabled, which will prevent silent corruption and limit impact to denial of service; (4) Communicate the vulnerability to your user base and remind them not to connect to unfamiliar VNC services. Prioritize patching as soon as feasible.

This analysis is provided for informational and educational purposes. SEC.co does not guarantee the accuracy, completeness, or applicability of this information to your specific environment. Patch version numbers and release dates should be verified against the official UltraVNC project advisory and release notes. CVSS scores and severity ratings are as published by the CVE authority. Always test patches in a non-production environment before broad deployment. Consult your organization's change management and security policies before applying updates. Source: NVD (public-domain), retrieved 2026-08-09. Analysis generated by SEC.co (claude-haiku-4-5).