CVE-2026-44040 Overview
CVE-2026-44040 affects UltraVNC through version 1.8.2.2. The vulnerability stems from the use of a cryptographically weak pseudo-random number generator (PRNG) when producing VNC authentication challenge bytes. The vncRandomBytes() function in rfb/vncauth.c seeds libc rand() with predictable values and generates a 16-byte challenge used during authentication. An attacker able to observe the authentication exchange can enumerate the seed space and predict the challenge within seconds. This enables forgery of authentication responses or offline brute-forcing of client credentials. The weakness is categorized under CWE-338: Use of Cryptographically Weak PRNG.
Critical Impact
Predictable authentication challenges allow network-based attackers to forge VNC authentication responses or brute-force credentials offline, undermining confidentiality and integrity of remote sessions.
Affected Products
- UltraVNC versions up to and including 1.8.2.2
- Builds compiled with the vncauth.c code path active
- Deployments where the Windows CryptGenRandom path in vncEncryptBytes2.cpp is not reached
Discovery Timeline
- 2026-07-01 - CVE-2026-44040 published to NVD
- 2026-07-02 - Last updated in NVD database
Technical Details for CVE-2026-44040
Vulnerability Analysis
UltraVNC generates VNC authentication challenges using the C standard library rand() function. In rfb/vncauth.c lines 119-129, the vncRandomBytes() function seeds rand() with the expression time(0) + getpid() + rand(). It then produces a 16-byte challenge that the server sends to authenticating clients. VNC challenge-response authentication assumes this challenge is unpredictable. Attackers who defeat this assumption can compute valid DES-encrypted responses without knowing the password, or reduce password guessing to offline work.
The combined entropy of the seed is approximately 31 bits, limited by the internal state of libc rand(). All three seed components are derived from publicly observable values. Wall-clock time is known to any network observer, process ID space on most systems is small, and the residual rand() call inherits from the same weak generator. A note in the advisory indicates that on Windows the vncEncryptBytes2.cpp path may call CryptGenRandom instead, but reachability on shipped binaries remains under investigation.
Root Cause
The root cause is the use of a non-cryptographic PRNG (libc rand()) for security-sensitive challenge generation, combined with a seed built entirely from low-entropy, externally observable values [CWE-338]. Cryptographic protocols require a cryptographically secure random number generator such as /dev/urandom, getrandom(2), or CryptGenRandom on Windows.
Attack Vector
An attacker on the network initiates or observes a VNC handshake to obtain the 16-byte challenge. The attacker then enumerates candidate seed values across plausible time(0) and getpid() ranges, reproducing the same rand() output stream. Once the seed is identified, the attacker predicts subsequent challenges or replays valid responses. Because the challenge is predictable, offline brute-forcing of captured responses against candidate passwords becomes practical. See the UltraVNC repository for source context.
Detection Methods for CVE-2026-44040
Indicators of Compromise
- Repeated failed VNC authentication attempts from a single source, indicating password brute-forcing against captured challenges
- Successful VNC authentications from unexpected source addresses or outside normal operational hours
- Packet captures showing repeated short-lived VNC handshakes followed by disconnection, consistent with challenge harvesting
Detection Strategies
- Inspect network traffic on TCP port 5900 and adjacent ports for anomalous handshake patterns and connection frequency
- Correlate UltraVNC server logs with authentication outcomes to identify sessions that succeed after abnormal probing
- Inventory UltraVNC installations and flag any version at or below 1.8.2.2 as vulnerable
Monitoring Recommendations
- Enable verbose authentication logging on UltraVNC servers and forward logs to a central SIEM for correlation
- Alert on VNC connections originating from outside approved management networks
- Track process ID and start time metadata on VNC server hosts to identify short-lived restarts that could be leveraged for seed narrowing
How to Mitigate CVE-2026-44040
Immediate Actions Required
- Restrict UltraVNC exposure to trusted management networks using firewall rules or VPN-only access
- Require strong, unique VNC passwords and rotate any password used on exposed servers
- Layer transport security by tunneling VNC over SSH or TLS to prevent challenge observation
Patch Information
No fixed version has been published in the NVD entry at the time of writing. Monitor the UltraVNC official website and the UltraVNC GitHub repository for updated releases that replace rand()-based challenge generation with a cryptographically secure PRNG such as CryptGenRandom, getrandom(2), or /dev/urandom.
Workarounds
- Disable UltraVNC on systems where it is not required and remove the service to reduce attack surface
- Bind the UltraVNC listener to localhost and require an authenticated SSH tunnel for remote access
- Deploy network access control lists that permit VNC only from a small set of administrator source addresses
# Configuration example: restrict VNC to localhost and tunnel over SSH
# On the UltraVNC host, bind to loopback (via server configuration)
# Then from the client:
ssh -L 5900:127.0.0.1:5900 admin@vnc-host.example.com
# Connect the VNC client to 127.0.0.1:5900
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

