---
id: CVE-2026-40033
title: >-
  FreeRDP before 3.26.0 contains a heap-buffer-overflow vulnerability in
  gdi_CacheToSurface that allows remote attackers to write out-of-bounds heap
  memory
summary: >-
  FreeRDP before 3.26.0 contains a heap-buffer-overflow vulnerability in
  gdi_CacheToSurface that allows remote attackers to write out-of-bounds heap
  memory. The vulnerability occurs because rectangle validation clamps
  coordinates to UINT16…
severity: high
cvss: 8.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'
cwe:
  - CWE-122
  - CWE-787
vendor: freerdp
product: freerdp
affected:
  - freerdp < 3.26.0
patched:
  - freerdp 3.26.0
published: '2026-05-26'
updated: '2026-07-08'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-40033'
references:
  - url: >-
      https://github.com/FreeRDP/FreeRDP/commit/d7508ebcd82842a691ae4941e5104d14240a89ae
    label: disclosure@vulncheck.com
  - url: 'https://github.com/FreeRDP/FreeRDP/pull/12713'
    label: disclosure@vulncheck.com
  - url: 'https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-p6r2-4hgm-m6ff'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/freerdp-heap-buffer-overflow-in-gdi-cachetosurface-via-rectangle-validation-bypass
    label: disclosure@vulncheck.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:36203'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: 'https://access.redhat.com/security/cve/CVE-2026-40033'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2481473'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: 'https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-p6r2-4hgm-m6ff'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40033.json
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
tags:
  - nvd
epss: 0.01062
epssPercentile: 0.63094
ingestedAt: '2026-07-08T13:51:10.770Z'
---

## Overview

FreeRDP before 3.26.0 contains a heap-buffer-overflow vulnerability in gdi_CacheToSurface that allows remote attackers to write out-of-bounds heap memory. The vulnerability occurs because rectangle validation clamps coordinates to UINT16_MAX but performs copy operations using unclamped cache entry dimensions, enabling malicious RDP servers to trigger large out-of-bounds writes and potentially achieve remote code execution or client crash.

## Affected

- `freerdp < 3.26.0`

## Remediation

Upgrade past the affected range:

- `freerdp 3.26.0`
