# CVE-2026-7838: UltraVNC viewer heap buffer overflow via integer overflow in RFB connection-failure reason length

> A malicious VNC server can trigger a heap buffer overflow in UltraVNC viewer via integer overflow, potentially allowing remote code execution.

- **Severity:** High 8.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 1 Jul 2026
- **Updated:** 9 Jul 2026
- **Also known as:** GHSA-wxqv-4fpj-f62j

## What is CVE-2026-7838?

CVE-2026-7838 is a high-severity vulnerability in uvnc UltraVNC, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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).

Weakness: CWE-787 (Out-of-bounds Write), CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2026-7838?

It affects 1 product.


Products: Uvnc Ultravnc.

## How do I fix CVE-2026-7838?

No fix has been published for CVE-2026-7838 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-7838 being exploited?

There is no known exploitation of CVE-2026-7838 in the wild and no public exploit code.

## Other vulnerabilities in uvnc UltraVNC

- [CVE-2019-8264](https://insights.sbomify.com/CVE-2019-8264/): Memory corruption in UltraVNC (critical 9.8)
- [CVE-2019-8265](https://insights.sbomify.com/CVE-2019-8265/): Memory corruption in UltraVNC (critical 9.8)
- [CVE-2019-8266](https://insights.sbomify.com/CVE-2019-8266/): Memory corruption in UltraVNC (critical 9.8)
- [CVE-2019-8280](https://insights.sbomify.com/CVE-2019-8280/): Memory corruption in UltraVNC (critical 9.8)
- [CVE-2018-15361](https://insights.sbomify.com/CVE-2018-15361/): Memory corruption in UltraVNC (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-7838 and fix it if it is affected.

What it is: CVE-2026-7838 is a high-severity vulnerability in uvnc UltraVNC, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-7838 in the wild and no public exploit code.

Affected product: uvnc UltraVNC. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-7838/ (Markdown: https://insights.sbomify.com/CVE-2026-7838/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-7838
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-7838
- OSV: https://osv.dev/vulnerability/CVE-2026-7838

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-7838/
Summaries are generated and may contain mistakes; the official description above is the record.
