Read the docs

Client-side heap out-of-bounds read in FreeRDP AVC444 chroma combine

Priority MEDIUM 40CWE-125Published · Updated

Key facts

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

Attack profile from CVSS 3.1 · GHSA-57h7-vw2f-2f9x. Fix status from GitHub.

Summary

FreeRDP through 3.30.0 has an out-of-bounds heap read in general_ChromaV1ToYUV444, which rebuilds chroma from the AVC444v1 auxiliary stream. When the region rect touches the bottom edge of a frame whose height is a multiple of 16, the loop reads source rows past the end of the luma plane. A malicious RDP server can trigger the read by sending a crafted RFX_AVC444_BITMAP_STREAM. The flaw is classified as CWE-125 and the CVSS 3.1 base score is 5.4 (MEDIUM), with low confidentiality and availability impact.

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

Description from the GitHub advisory

`general_ChromaV1ToYUV444` in FreeRDP's primitives library reads past the end of the luma plane buffer. The loop that reconstructs chroma from the AVC444v1 auxiliary stream runs the source row index up to a 16-aligned padded height, but it only checks bounds on the destination row. The source read just keeps going. When the region rect touches the bottom edge of a frame whose height is already a multiple of 16, the read overshoots the allocation. The bug is in `libfreerdp/primitives/prim_YUV.c` and duplicated in the NEON and SSE copies. CWE-125 (heap OOB read), server-to-client direction. A malicious RDP server triggers it by sending a crafted `RFX_AVC444_BITMAP_STREAM` with the right frame geometry. We tested against 3.30.0 and `master` at `9415f2d11`. No published CVE or GHSA references this function as of 2026-08-05. ## Root cause Here's the relevant code from `general_ChromaV1ToYUV444` (`prim_YUV.c:97`): ```c const UINT32 nHeight = roi->bottom - roi->top; const UINT32 padHeigth = nHeight + 16 - nHeight % 16; /* round up to 16 */ const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, ... }; for (size_t y = 0; y < padHeigth; y++) { const BYTE* Ya = pSrc[0] + y * srcStep[0]; ... if (pos >= nHeight) /* only bounds the DESTINATION write */ continue; ... memcpy(pX, Ya, nWidth); /* reads source row (roi->top + y) */ } ``` The `pos >= nHeight` guard skips the output write, but the source read at `pSrc[0] + y * srcStep` already happened. When `nHeight` is a multiple of 16, `padHeigth` becomes `nHeight + 16`. That's 16 extra source rows the loop reads past `roi->bottom`. The luma plane is allocated tight. `yuv_ensure_buffer` (`h264.c:41`) rounds up to 16 but doesn't add any slack beyond that: ```c if (stride % 16) stride += 16 - stride % 16; if (pheight % 16) pheight += 16 - pheight % 16; h264->pYUVData[x] = winpr_aligned_recalloc(..., h264->iStride[x], pheight, 16); ``` So when `roi->bottom == frameHeight` and `frameHeight % 16 == 0`: no spare rows, read goes past the allocation. Up to ~15 rows times the stride. `check_rect` (`yuv.c:440`) doesn't help. It rejects `bottom > height` but lets `bottom == height` through. That's exactly the case that triggers the bug. ### Which H.264 backends are affected Depends on who owns the luma plane. MediaFoundation (Windows) and mediacodec (Android) let FreeRDP own it through `yuv_ensure_buffer`, so the allocation is tight and the OOB is real. OpenH264 and FFmpeg write their own plane pointers into `pYUVData`, and their internal buffers usually have padding rows that absorb the extra reads. The code is still wrong on those backends, but it's unlikely to cross a page boundary. ## Proof of concept `chroma_v1_oob_read.c` calls the primitives API directly with a tight luma plane matching what `yuv_ensure_buffer` would allocate. No H.264 decoder involved. - 64x64 frame (both multiples of 16). Luma allocation = 4096 bytes. Tight, no slack. - Rect `{0, 24, 64, 64}`. Passes `check_rect`. - `nHeight = 40`, `padHeigth = 48`. - At `y = 40`: reads source row 64, which is `base + 64*64 = base + 4096`. One byte past the end. ### ASan output (from `asan_report.txt`) ``` ==791==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x521000001100 READ of size 64 at 0x521000001100 thread T0 #0 __asan_memcpy #1 neon_ChromaV1ToYUV444 libfreerdp/primitives/neon/prim_YUV_neon.c:671:3 #2 neon_YUV420CombineToYUV444 libfreerdp/primitives/neon/prim_YUV_neon.c:814:11 #3 main poc/avc444_read/chroma_v1_oob_read.c:99:17 0x521000001100 is located 0 bytes after 4096-byte region [0x521000000100,0x521000001100) allocated by calloc (the tight luma plane) ``` ## Reproducing it ```sh docker build -t avc444-read . docker run --rm avc444-read ``` Builds FreeRDP with ASan, compiles the harness, runs it. ASan trace prints to stderr and the container exits non-zero. `--build-arg FREERDP_REF=master` for a different revision. ## Impact The over-read bleeds heap data into the rendered chroma. Whatever was after the luma plane ends up on screen as color artifacts. If you're looking at a screen share or recording, that's a leak channel from server to client. If the read crosses a page boundary, the client crashes. The attacker controls frame geometry and the region rect, so they choose where the over-read starts and how far it goes. CVSS 3.1: `AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:L`, 5.4 Medium. PR:N because no auth is needed on the server side. UI:R because the victim has to connect. C:L because heap bytes leak but the attacker can't precisely target which ones. A:L because a crash is possible but depends on the page layout. ## Suggested fix Bound the source read to the actual plane height. Either move the `pos >= nHeight` check before the source `memcpy` so rows past the plane are never read, or just loop `y` over `[0, nHeight)` and handle the 16-row padding separately without reading past the end. Needs to be fixed in all three implementations: generic, NEON, SSE. ## Files in this package - `report.md` -- this report - `Dockerfile` -- builds FreeRDP with ASan, compiles and runs the harness - `chroma_v1_oob_read.c` -- the PoC harness (calls the primitives API directly with a tight luma plane) - `asan_report.txt` -- ASan crash trace [avc444-chroma-read.zip](https://github.com/user-attachments/files/30973146/avc444-chroma-read.zip)

Why it matters now

Fix Fixed FreeRDP (freerdp): 3.31.0

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (freerdp)<= 3.30.03.31.0Patch availableGHSA-57h7-vw2f-2f9x
  • FreeRDP (freerdp) Vendor— Affected <= 3.30.0 Fixed in 3.31.0 Patch available GHSA-57h7-vw2f-2f9x

Remediation

Upgrade FreeRDP to version 3.31.0 or later.

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

  • Fix · GHSA-57h7-vw2f-2f9x FreeRDP (freerdp) Fixed in 3.31.0 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-57h7-vw2f-2f9x

References

Sources

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