CVE-2026-31806: FreeRDP has a Heap Buffer Overflow in nsc_process_message() via Unchecked SURFACE_BITS_COMMAND Bitmap Dimensions
FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.24.0, the gdisurfacebits() function processes SURFACEBITSCOMMAND messages sent by the RDP server. When the command is handled using NSCodec, the bmp.width and bmp.height values provided by the server are not properly validated against the actual desktop dimensions. A malicious RDP server can supply crafted bmp.width and bmp.height values that exceed the expected surface size. Because these values are used during bitmap decoding and memory operations without proper bounds checking, this can lead to a heap buffer overflow. Since the attacker can also control the associated pixel data transmitted by the server, the overflow may be exploitable to overwrite adjacent heap memory. This vulnerability is fixed in 3.24.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
FreeRDPto a version that resolves this vulnerability.Fixed in 3.24.0 - Compensating control
If you cannot upgrade to FreeRDP 3.24.0 immediately, prevent exposure to untrusted/malicious RDP servers by restricting outbound RDP connections to trusted hosts only (e.g., via network ACL/firewall).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31806?
CVE-2026-31806 describes a Heap Buffer Overflow vulnerability in FreeRDP that can lead to potential code execution.
How do I fix CVE-2026-31806?
To fix CVE-2026-31806, upgrade FreeRDP to version 3.24.0 or later where the vulnerability has been addressed.
What versions of FreeRDP are affected by CVE-2026-31806?
FreeRDP versions prior to 3.24.0 are affected by CVE-2026-31806.
What components of FreeRDP are impacted by CVE-2026-31806?
CVE-2026-31806 impacts the gdi_surface_bits() function within FreeRDP that processes SURFACE_BITS_COMMAND messages.
Can CVE-2026-31806 be exploited remotely?
Yes, CVE-2026-31806 can be exploited remotely if an attacker sends malicious SURFACE_BITS_COMMAND messages to a vulnerable FreeRDP installation.