Read the docs

Buffer overread in FreeRDP icon processing

Priority LOW 38CWE-126Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

FreeRDP through 3.22.0 has a buffer overread in icon processing. The function freerdp_image_copy_from_icon_data() does not check the size of the mask data before reading it, so crafted RDP Window Icon data with a small mask can make it read past the end of the buffer (CWE-126). A malicious RDP server, or an attacker in a man-in-the-middle position, can trigger it over the network when a client processes icon data.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

Description from the GitHub advisory

A buffer overread in `freerdp_image_copy_from_icon_data()` (libfreerdp/codec/color.c) can be triggered by crafted RDP Window Icon (TS_ICON_INFO) data. The bug is reachable over the network when a client processes icon data from an RDP server (or from a man-in-the-middle). ## Root Cause In `libfreerdp/codec/color.c`, inside `freerdp_image_copy_from_icon_data()`: **Color data is validated** (safe): ```c /* Ensure we have enough source data bytes for image copy. */ if (cbBitsColor < nWidth * nHeight * FreeRDPGetBytesPerPixel(format)) return FALSE; ``` **Mask data is never validated.** When the destination format has alpha, the code uses `bitsMask` with a stride derived from `nWidth`/`nHeight` but never checks that `cbBitsMask` is large enough: ```c /* apply alpha mask */ if (FreeRDPColorHasAlpha(DstFormat) && cbBitsMask) { /* ... */ stride = round_up(div_ceil(nWidth, 8), 4); for (UINT32 y = 0; y < nHeight; y++) { maskByte = &bitsMask[1ULL * stride * (nHeight - 1 - y)]; /* can read past end of bitsMask */ /* ... */ alpha = (*maskByte & nextBit) ? 0x00 : 0xFF; /* overread here */ /* ... */ } } ``` If the server sends a small `cbBitsMask` (e.g. 1) with large `nWidth`/`nHeight`, the loop accesses `bitsMask` beyond `cbBitsMask` bytes. The parser in `libfreerdp/core/window.c` (`update_read_icon_info()`) only ensures the stream has enough bytes for the declared sizes; it does not enforce that those sizes are consistent with this usage. --- ## Affected Code Paths - **Parsing:** `update_read_icon_info()` in `libfreerdp/core/window.c` reads TS_ICON_INFO from the RDP stream (MS-RDPERP 2.2.1.2.3). - **Vulnerable function:** `freerdp_image_copy_from_icon_data()` in `libfreerdp/codec/color.c` (mask loop around lines 474–499). - **Use in client:** `convert_rail_icon()` in `client/X11/xf_rail.c` (and equivalent paths on other clients) passes the parsed icon to `freerdp_image_copy_from_icon_data()`. --- ## Remote Trigger Icon data is received from the RDP server as part of Window Order (Rail) PDUs. A malicious server (or an attacker in a MITM position) can send a crafted Window Icon order with: - `width`, `height`, `bpp` (e.g. 32 for a format with alpha so the mask loop runs), - `cbBitsColor` large enough to pass the existing check, - `cbBitsMask` too small (e.g. 1), and the corresponding payload bytes. The client allocates and reads only `cbBitsMask` bytes for the mask, then the mask loop reads `stride * nHeight` bytes, causing an out-of-bounds read. ## Fixed with f5e20403d6e325e11b68129803f967fb5aeec1cb

Why it matters now

Fix Fixed FreeRDP (c): 3.23.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c)<= 3.22.03.23.0Patch availableGHSA-hr4m-ph4g-48j6
  • FreeRDP (c) Vendor— Affected <= 3.22.0 Fixed in 3.23.0 Patch available GHSA-hr4m-ph4g-48j6

Remediation

Upgrade FreeRDP to version 3.23.0, which fixes the issue.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

  • Fix · GHSA-hr4m-ph4g-48j6 FreeRDP (c) Fixed in 3.23.0 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-hr4m-ph4g-48j6

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences