FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.24.0, the gdi_surface_bits() function processes SURFACE_BITS_COMMAND 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.
The gdi_surface_bits() function handles SURFACE_BITS_COMMAND messages using the NSCodec encoder. The bmp.width and bmp.height values supplied by the RDP server are not properly validated against the actual desktop dimensions. A malicious server can pass specially crafted width and height values exceeding the expected surface size, which are then used during bitmap decoding and memory operations without proper bounds checking. Since the attacker also controls the transmitted pixel data, the overflow can enable overwriting adjacent heap memory areas.
An attacker controlling a malicious RDP server can cause a heap buffer overflow, which can result in arbitrary code execution (RCE) on the client machine establishing the connection or destabilization of the application.
FreeRDP should be updated to version 3.24.0 or later, in which the vulnerability has been fixed. Patch available in the project repository (commit 83d9aedea278a74af3e490ff5eeb889c016dbb2b). Until an update is applied, it is recommended to restrict RDP connections only to trusted servers.
FreeRDP in all versions before 3.24.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XFreerdp
APPFreerdp< 3.24.0
Related vulnerabilities
FreeRDP: heap-based buffer overflow w crypto_rsa_common() przed uwierzytelnieniem
Double-free w FreeRDP przy parsowaniu pola selectedmonitors pliku .rdp
FreeRDP: out-of-bounds read w klientach przed wersją 3.5.1
FreeRDP: out-of-bounds read przy zerowych wymiarach obrazu (RDP)
FreeRDP: integer overflow i out-of-bounds write w obsłudze GFX