SecurinZero Days
    Email Us
    Zero-Day Research/CVE-2026-7838
    ▲ HighCVSS 8.8✓ Patched

    Malicious-Server Heap Overflow via reasonLen Integer Overflow (UltraVNC Viewer)

    UltraVNC viewer through 1.8.2.2 contains an integer overflow leading to a heap buffer overflow in the RFB protocol failure-response parsing path. In vncviewer/ClientConnection.cpp, the 4-byte network-supplied reasonLen field (type CARD32) is passed as reasonLen+1 to CheckBufferSize(). Because both operands are unsigned 32-bit, a reasonLen of 0xFFFFFFFF overflows to 0, causing CheckBufferSize to allocate only 256 bytes. The subsequent ReadString(m_netbuf, reasonLen) call then performs ReadExact for the original 4 GiB length into that 256-byte heap buffer. This overflow is reachable via rfbConnFailed (auth-scheme negotiation) and rfbVncAuthFailed (post-handshake) message types without successful authentication. A malicious VNC server, or any man-in-the-middle on the RFB stream, can trigger this condition when the victim viewer connects, potentially resulting in remote code execution as the user running the viewer. The crash was confirmed with AddressSanitizer on a portable reproduction harness (heap-buffer-overflow WRITE at offset 256).

    CVE IDCVE-2026-7838
    CVSS v3.18.8 High
    VendorUltraVNC
    CWECWE-190: Integer Overflow to Buffer Overflow, CWE-787: Out-of-bounds Write
    DisclosedJun 3, 2026
    StatusFixed
    All advisories
    • 01Description
    • 02Proof of Concept
    • 03Vulnerable Code
    • 04Trigger Conditions
    • 05Impact
    • 06Remediation
    • 07Timeline
    • 08References
    01/Description

    What this actually is.

    Technical background, root cause, and affected surface.

    In vncviewer/ClientConnection.cpp, the 4-byte network-supplied reasonLen is passed as reasonLen+1 to CheckBufferSize(). With reasonLen=0xFFFFFFFF, unsigned addition wraps to 0, allocating 256 bytes. ReadString(m_netbuf, reasonLen) then performs ReadExact for the original 4 GiB into the 256-byte buffer. ASan confirms heap-buffer-overflow WRITE at offset 256.

    Vendor
    UltraVNC
    Product
    UltraVNC Viewer
    Severity
    High
    CVSS Score
    8.8
    Status
    Fixed
    Vector
    CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
    CWE
    CWE-190: Integer Overflow to Buffer Overflow, CWE-787: Out-of-bounds Write
    02/Proof of Concept

    From one request
    to root shell.

    Reproduced in a sandboxed environment. Requires only LAN or WiFi adjacency.

    8.8CVSS 3.1
    VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
    ScopeUnchanged
    ImpactC:H / I:H / A:H
    SeverityHigh

    poc_finding010_viewer_vendor.py: minimal malicious RFB server sends rfbConnFailed with reasonLen=0xFFFFFFFF. ASan output: heap-buffer-overflow on 0x511000000140, WRITE of size 1 at offset 256. Crash-trigger only.

    03/Vulnerable Code

    The bug, and the fix.

    ReadExact((char *)&reasonLen, 4); // attacker source reasonLen = Swap32IfLE(reasonLen); // 0xFFFFFFFF CheckBufferSize(reasonLen+1); // UINT overflow → 0 → alloc 256 bytes ReadString(m_netbuf, reasonLen); // reads 4 GiB into 256-byte heap buffer

    Root cause: CheckBufferSize() parameter is UINT; reasonLen+1 causes unsigned integer overflow at 0xFFFFFFFF. Legacy dead-code guard (if bufsize<0) cannot trigger for UINT. ReadString uses original unmodified reasonLen.

    04/Trigger Conditions

    When does this fire?

    All conditions must be true for the exploit to succeed.

    01

    Victim viewer connects to attacker host:port (or clicks vnc://attacker link). 2. RFB version handshake completes. 3. Attacker sends authScheme=0x00000000 (rfbConnFailed). 4. Attacker sends reasonLen=0xFFFFFFFF. 5. UINT overflow → 256-byte alloc → ReadExact(4GB) → heap corruption.

    Required
    05/Impact

    What an attacker does to you.

    Post-exploitation outcomes mapped to CVSS impact metrics.

    Heap buffer overflow in vncviewer.exe. Controlled write of up to 4 GB into 256-byte heap allocation. RCE candidate. ASan-confirmed crash.

    06/Remediation

    Fix it. In this order.

    A runbook, not a checklist. Sequence matters — assume compromise before you act.

    Reject reasonLen > 4095 before CheckBufferSize. Change CheckBufferSize parameter to size_t. Audit all CheckBufferSize(x+n) sites. Vendor fix: if (reasonLen > 4095) throw guard added at both rfbConnFailed and rfbVncAuthFailed paths.

    Securin advisory — For coordinated remediation support or threat-actor briefings related to CVE-2026-7838, contact disclose@securin.io
    07/Disclosure Timeline

    Vendors moved in days.
    Attackers in hours.

    Reconstructed from vendor advisories, CISA bulletins, and Securin research records.

    2026-06-02: Discovered and ASan crash-confirmed; 2026-06-17: Reported to vendor; 2026-06-17: Fix validated; 2026-09-03: Planned public disclosure

    Timeline recorded · Disclosure coordinated by Securin

    08/References

    Cite, verify, go deeper.

    Primary sources — NVD, CISA KEV, and machine-readable IoC feed.

    NVD

    NVD — CVE-2026-7838

    nvd.nist.gov/vuln/detail/CVE-2026-7838 →
    SEC

    Securin VI — Full Technical Analysis

    vi.securin.io →
    REF

    CVE-2026-7838; vncviewer/ClientConnection.cpp:3032-3035; phase5_reproductions/finding010_repro.cpp; phase5_reproductions/evidence.txt; phase3_deep_analysis.md FINDING-010

    Let Securin level up your security posture.

    Get a live exposure assessment, threat-actor briefing tailored to your sector, and IoC mapping for your SIEM.

    Browse all advisories
    SecurinSecurinZero Days

    Securin's zero-day research operation combines frontier AI models with a decade of offensive expertise — discovering, validating, and coordinating the disclosure of high-impact vulnerabilities at a scale and speed no human team achieves alone.

    Glossary
    © 2026 Securin Inc · CVE Numbering Authority
    Privacy Policy·Data Processing Addendum