CVE-2021-42785

9.8 CRITICAL

📋 TL;DR

A buffer overflow vulnerability in TightVNC Viewer allows remote attackers to execute arbitrary code by sending a specially crafted FramebufferUpdate packet from a VNC server. This affects users connecting to untrusted or compromised VNC servers with vulnerable TightVNC Viewer versions.

💻 Affected Systems

Products:
  • TightVNC Viewer
Versions: Versions prior to 2.8.59
Operating Systems: Windows, Linux, macOS
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects the viewer component, not VNC servers. Vulnerability is triggered when connecting to a malicious VNC server.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with remote code execution as the user running TightVNC Viewer, potentially leading to lateral movement, data theft, or ransomware deployment.

🟠

Likely Case

Remote code execution on client systems when users connect to malicious VNC servers, allowing attacker control over the client machine.

🟢

If Mitigated

Limited impact if users only connect to trusted VNC servers with proper network segmentation and endpoint protection.

🌐 Internet-Facing: MEDIUM - Exploitation requires user to connect to malicious server, but phishing or social engineering could trick users into connecting.
🏢 Internal Only: MEDIUM - Internal attackers could set up malicious VNC servers to exploit vulnerable clients.

🎯 Exploit Status

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

Exploitation requires the victim to connect to attacker-controlled VNC server. No authentication bypass needed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.8.59 and later

Vendor Advisory: https://www.tightvnc.com/whatsnew.php

Restart Required: No

Instructions:

1. Download TightVNC Viewer 2.8.59 or later from https://www.tightvnc.com/download.php
2. Uninstall previous version
3. Install new version
4. Verify version with 'tvnviewer.exe --version'

🔧 Temporary Workarounds

Network Segmentation

all

Restrict VNC connections to trusted servers only using firewall rules

Use Alternative VNC Client

all

Temporarily switch to a different VNC viewer that is not affected

🧯 If You Can't Patch

  • Only connect to trusted, verified VNC servers from known sources
  • Implement application whitelisting to prevent execution of unauthorized code

🔍 How to Verify

Check if Vulnerable:

Check TightVNC Viewer version. If version is below 2.8.59, it is vulnerable.

Check Version:

tvnviewer.exe --version (Windows) or tvnviewer --version (Linux/macOS)

Verify Fix Applied:

Verify version is 2.8.59 or higher using 'tvnviewer.exe --version' on Windows or 'tvnviewer --version' on Linux/macOS

📡 Detection & Monitoring

Log Indicators:

  • Unexpected process creation from tvnviewer.exe
  • Network connections to unknown VNC servers (port 5900+)
  • Crash logs from TightVNC Viewer

Network Indicators:

  • VNC connections to suspicious IP addresses
  • Unusual outbound traffic patterns after VNC sessions

SIEM Query:

Process Creation: Image='*tvnviewer.exe' AND ParentImage!='explorer.exe' OR Network Connection: DestinationPort>=5900 AND ProcessName='tvnviewer.exe'

🔗 References

📤 Share & Export