What this actually is.
Technical background, root cause, and affected surface.
UltraVNC through 1.8.2.2 uses a cryptographically weak pseudo-random number generator to produce VNC authentication challenge bytes. In rfb/vncauth.c:119-129, the vncRandomBytes() function seeds libc rand() with time(0) + getpid() + rand() and generates a 16-byte challenge. The combined seed space is approximately 31 bits (libc rand() internal state) and is entirely determined by publicly-observable values (wall-clock time and process ID). An attacker who can observe the authentication exchange can enumerate the seed space and predict the challenge within seconds, enabling forgery or offline brute-forcing of responses. Note: on Windows, the active code path may use vncEncryptBytes2.cpp which calls CryptGenRandom; reachability on shipped Windows binaries requires compile-graph verification and is under investigation.
- Vendor
- UltraVNC
- Product
- UltraVNC Server
- Severity
- Medium
- CVSS Score
- 4.8
- Status
- Fixed
- Vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
- CWE
- CWE-338: Use of Cryptographically Weak PRNG
From one request
to root shell.
Reproduced in a sandboxed environment. Requires only LAN or WiFi adjacency.
predict_challenge.py demonstrates deterministic challenge prediction from time-based seed. Private PoC; not released publicly.
The bug, and the fix.
// rfb/vncauth.c:119-129 vncRandomBytes(unsigned char *bytes) { srand((unsigned int) time(0) + getpid() + rand()); for (i=0; i<CHALLENGESIZE; i++) bytes[i] = (unsigned char)(rand() & 0xff); }
Root cause: Legacy cross-platform code uses libc rand() with low-entropy time-based seed. vncEncryptBytes2.cpp with CryptGenRandom was added for Windows but compile-graph verification needed to confirm this file shadows vncauth.c on shipped Windows binaries.
When does this fire?
All conditions must be true for the exploit to succeed.
VNC server sends auth challenge generated by vncRandomBytes(). 2. Attacker observes connection timestamp (passive sniff). 3. Enumerates seed space with time(0)+pid+rand(). 4. Predicts 16-byte challenge; forges valid DES-encrypted response.
What an attacker does to you.
Post-exploitation outcomes mapped to CVSS impact metrics.
Predictable VNC auth challenge. With connection timing, attacker brute-forces valid auth responses offline. Impact limited if Windows builds use CryptGenRandom (verification pending).
C:L · I:L · A:N
CWE-338: Use of Cryptographically Weak PRNG
Fix it. In this order.
A runbook, not a checklist. Sequence matters — assume compromise before you act.
Use CryptGenRandom (Windows) or getrandom() (Unix) exclusively. Vendor fix: CryptGenRandom as primary, /dev/urandom as fallback, legacy srand path unreachable last resort.
disclose@securin.ioVendors moved in days.
Attackers in hours.
Reconstructed from vendor advisories, CISA bulletins, and Securin research records.
Discovered during audit
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.