CVE-2018-20750

9.8 CRITICAL

📋 TL;DR

CVE-2018-20750 is a heap out-of-bounds write vulnerability in LibVNC server versions through 0.9.12. This allows remote attackers to execute arbitrary code or cause denial of service by sending specially crafted VNC protocol messages. Any system running vulnerable LibVNC server software is affected.

💻 Affected Systems

Products:
  • LibVNC
  • LibVNCServer
  • Any software using LibVNC libraries
Versions: All versions through 0.9.12
Operating Systems: Linux, Unix-like systems, Windows (if compiled with LibVNC)
Default Config Vulnerable: ⚠️ Yes
Notes: Affects both server and client implementations using vulnerable LibVNC libraries.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Denial of service causing VNC service crashes and disruption of remote access capabilities.

🟢

If Mitigated

Limited impact if network segmentation restricts VNC traffic and systems are patched.

🌐 Internet-Facing: HIGH - VNC servers exposed to the internet are directly vulnerable to remote exploitation.
🏢 Internal Only: MEDIUM - Internal VNC servers are still vulnerable but attack surface is reduced.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires network access to VNC port (default 5900). The incomplete fix for CVE-2018-15127 makes exploitation more reliable.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after commit 09e8fc02f59f16e2583b34fe1a270c238bd9ffec

Vendor Advisory: https://github.com/LibVNC/libvncserver/issues/273

Restart Required: Yes

Instructions:

1. Update LibVNC to version after the fix commit. 2. Recompile any applications using LibVNC. 3. Restart VNC services.

🔧 Temporary Workarounds

Network Segmentation

linux

Restrict VNC port access to trusted networks only

iptables -A INPUT -p tcp --dport 5900 -s trusted_network -j ACCEPT
iptables -A INPUT -p tcp --dport 5900 -j DROP

Use SSH Tunneling

all

Tunnel VNC connections through SSH to add encryption and authentication

ssh -L 5900:localhost:5900 user@vnc_server

🧯 If You Can't Patch

  • Implement strict network ACLs to allow VNC access only from trusted IP addresses
  • Replace VNC with alternative remote access solutions that don't use LibVNC

🔍 How to Verify

Check if Vulnerable:

Check LibVNC version: ldd /path/to/vncserver | grep libvnc, then check version in source or package manager

Check Version:

vncserver --version 2>&1 | grep -i libvnc || find / -name '*libvnc*' -exec strings {} \; | grep -i version

Verify Fix Applied:

Verify version is newer than 0.9.12 or includes commit 09e8fc02f59f16e2583b34fe1a270c238bd9ffec

📡 Detection & Monitoring

Log Indicators:

  • VNC service crashes
  • Unusual connection patterns to port 5900
  • Memory corruption errors in system logs

Network Indicators:

  • Malformed VNC protocol packets
  • Rapid connection attempts to VNC port
  • Traffic from unexpected sources to port 5900

SIEM Query:

destination_port=5900 AND (packet_size>threshold OR protocol_anomaly=true)

🔗 References

📤 Share & Export