Unbounded memory growth in FreeRDP Progressive codec
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-400.
Summary
FreeRDP and libfreerdp from 2.11.2 before 3.33.0 are affected in the RDPGFX Progressive graphics codec. A malicious RDP server can send repeated progressive surface commands with a constant frame identifier, which makes the client grow its memory use without bound and its per-command processing cost quadratic (CWE-400). Under memory pressure, this growth can lead to a heap out-of-bounds write and a client crash.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary A malicious RDP server can drive an unmodified FreeRDP client into unboundedmemory growth with quadratic CPU cost, and — under realistic memory pressure —into a heap out-of-bounds write and a hard crash, using the standard RDPGFX"Progressive" graphics path. One CAPROGRESSIVE surface command of 82,325 bytes,repeated with a constant frameId (or without ever sending RDPGFX_START_FRAME),is sufficient. On a production-like build (RelWithDebInfo, no sanitizers) of the latest stablerelease 3.32.2: 12.3 MB of server traffic grows a stock xfreerdp client from2.2 MB to 2,290 MB RSS within ~9 seconds (≈186x wire-to-RAM amplification),with per-command processing cost growing 4.4x (quadratic, 20.4 ms → 89.7 ms percommand). Under a realistic 1.8 GB address-space budget the same attackcrashes the client with SIGSEGV (~145 commands). Deterministic: no faultinjection, no race, no heap grooming. ### Details Root cause (F1 — CWE-400/CWE-789/CWE-407) progressive_decompress() resets the per-frame tile update batch only when theframeId changes (libfreerdp/codec/progressive.c:2459-2463, 3.32.2): if (surface->frameId != frameId){ surface->frameId = frameId; surface->numUpdatedTiles = 0;} A RDPGFX_CAPROGRESSIVE WireToSurface2 PDU carries a complete progressive frame,and update_tiles() (called once per decompress, progressive.c:2502) blitsevery entry of updatedTileIndices[0..numUpdatedTiles) on each call. If theserver reuses a constant frameId — or never sends RDPGFX_START_FRAME, in whichcase gdi->frameId stays 0 (libfreerdp/gdi/gfx.c:328 is its only setter) — thebatch is never reset: numUpdatedTiles grows by the frame's tile count on every command(measured 0 → 6,630 over 30 identical 221-tile frames); every command re-blits the entire accumulated batch → O(N²) CPU(measured 20.4 ms → 89.7 ms per command over 150 commands; ~2 µs/tile); every 1,024 accumulated tiles trigger progressive_allocate_tile_cache()growth, allocating 1,024 new 65.6 KB tile buffers → ~65 KB client RAM per~370 bytes of wire (12.3 MB traffic → 2.25–2.30 GB RSS). Reachability chain (verified source + runtime): server W2S2 PDU →rdpgfx_recv_wire_to_surface2_pdu → gdi_SurfaceCommand →gdi_SurfaceCommand_Progressive (gfx.c:1243) → progressive_decompress(..., gdi->frameId) (gfx.c:1146). Memory corruption (F2 — CWE-787/CWE-690) progressive_allocate_tile_cache() (progressive.c:397-453) advancessurface->gridSize before the dependent sub-allocations are committed. Onany mid-growth allocation failure the guard inprogressive_surface_tile_replace() (numUpdatedTiles >= gridSize,progressive.c:528-536) no longer reflects the real capacity and the write surface->updatedTileIndices[surface->numUpdatedTiles++] = (UINT32)zIdx; goes out of bounds. ASAN-proven (fault injection): heap-buffer-overflowWRITE of size 4 at progressive.c:536, 0 bytes after a 940-byte regionallocated at progressive.c:451. Naturally triggered (no injection): undera ~700 MB address-space cap the growth allocation fails organically and theproduction non-ASAN binary SIGSEGVs in progressive_decompress (core dump:progressive_decompress+0x191d, add 0x80(%rbx),%edx,rbx = 0x0000007400000073 — corrupted tile pointer). F1 makes largeallocations fail deterministically under memory pressure, providing exactlythat pressure in real sessions. Aggravator (F3): on internal parse failures the decompressor returns success(rc=1) to the caller for several failure classes (goto fail paths never setan error code), so the client keeps consuming attacker data after statecorruption with no user-visible error. Affected versions Verified vulnerable: 2.11.2, 3.0.0, 3.6.0, 3.13.0, 3.20.0, 3.26.0, 3.31.0,3.32.2 (latest stable), master 41593321. git diff <any of these>..master -- libfreerdp/codec/progressive.c is empty for recent revisions — no fix existsupstream. Reproduction (end-to-end, real client) Patched sfreerdp-server (injection patch attached) + stock xfreerdp underXvfb over TCP/TLS, CAPROGRESSIVE V8, 1060x827 surface 1280x832: sfreerdp-server --port=13389 --cert=... --key=... \ --attack=150 --interval=20 --frame=attack_frame.binxfreerdp /v:127.0.0.1:13389 /u:tester /p:test /cert:ignore /sec:tls /gfx /rfx /size:1280x800 Result on 3.32.2 production build: client RSS 2.2 MB → 2,290 MB from 12.3 MBof traffic; 150/150 commands decoded "successfully" (rc=1); per-commandinterval 20.4 ms → 89.7 ms. With ulimit -v 1800000 the same attack SIGSEGVsthe client at ~145 commands. Control run with protocol-correctSTART_FRAME/END_FRAME and a fresh frameId per command stays flat at 110 MB RSSover 300 commands — isolating the root cause to the stale-frameId resetcondition. Attached: PoC source, attack frame, server patch, minimal fixpatch, results matrix (RESULTS.md), logs. Impact Remote DoS against any FreeRDP-based client connecting to anattacker-controlled server: memory exhaustion, frozen session (quadraticper-frame cost), hard SIGSEGV on memory-constrained systems (thin clients,VMs, containers, 2-4 GB devices). Heap out-of-bounds write (4 bytes) and wild-pointer dereference in thedecoder under realistic allocator pressure — memory corruption, not just DoS. No user interaction beyond connecting to the malicious server;deterministic. Suggested fix (verified patch attached — 95 lines, 2 hunks) progressive_decompress (progressive.c:2459): reset the tile update batchunconditionally per decompress call (one W2S2 PDU = one complete frame;update_tiles() already consumes the whole batch per call, so intra-framebatching is preserved; cross-call accumulation is never legitimate). progressive_allocate_tile_cache (progressive.c:397): compute the new gridsize locally and commit gridSize/tilesSize only after allsub-allocations succeed; roll back partial tile allocations so a failedgrowth leaves consistent state. Verified: with the patch, 300 attack commands keep the client at 110 MB flatRSS with 1.01x latency growth, the 1.8 GB cap no longer crashes the client,and TestFreeRDPCodecProgressive passes. ### Proof of concept Root cause (F1 — CWE-400/CWE-789/CWE-407) progressive_decompress() resets the per-frame tile update batch only when theframeId changes (libfreerdp/codec/progressive.c:2459-2463, 3.32.2): if (surface->frameId != frameId){ surface->frameId = frameId; surface->numUpdatedTiles = 0;} A RDPGFX_CAPROGRESSIVE WireToSurface2 PDU carries a complete progressive frame,and update_tiles() (called once per decompress, progressive.c:2502) blitsevery entry of updatedTileIndices[0..numUpdatedTiles) on each call. If theserver reuses a constant frameId — or never sends RDPGFX_START_FRAME, in whichcase gdi->frameId stays 0 (libfreerdp/gdi/gfx.c:328 is its only setter) — thebatch is never reset: numUpdatedTiles grows by the frame's tile count on every command(measured 0 → 6,630 over 30 identical 221-tile frames); every command re-blits the entire accumulated batch → O(N²) CPU(measured 20.4 ms → 89.7 ms per command over 150 commands; ~2 µs/tile); every 1,024 accumulated tiles trigger progressive_allocate_tile_cache()growth, allocating 1,024 new 65.6 KB tile buffers → ~65 KB client RAM per~370 bytes of wire (12.3 MB traffic → 2.25–2.30 GB RSS). Reachability chain (verified source + runtime): server W2S2 PDU →rdpgfx_recv_wire_to_surface2_pdu → gdi_SurfaceCommand →gdi_SurfaceCommand_Progressive (gfx.c:1243) → progressive_decompress(..., gdi->frameId) (gfx.c:1146). Memory corruption (F2 — CWE-787/CWE-690) progressive_allocate_tile_cache() (progressive.c:397-453) advancessurface->gridSize before the dependent sub-allocations are committed. Onany mid-growth allocation failure the guard inprogressive_surface_tile_replace() (numUpdatedTiles >= gridSize,progressive.c:528-536) no longer reflects the real capacity and the write surface->updatedTileIndices[surface->numUpdatedTiles++] = (UINT32)zIdx; goes out of bounds. ASAN-proven (fault injection): heap-buffer-overflowWRITE of size 4 at progressive.c:536, 0 bytes after a 940-byte regionallocated at progressive.c:451. Naturally triggered (no injection): undera ~700 MB address-space cap the growth allocation fails organically and theproduction non-ASAN binary SIGSEGVs in progressive_decompress (core dump:progressive_decompress+0x191d, add 0x80(%rbx),%edx,rbx = 0x0000007400000073 — corrupted tile pointer). F1 makes largeallocations fail deterministically under memory pressure, providing exactlythat pressure in real sessions. Aggravator (F3): on internal parse failures the decompressor returns success(rc=1) to the caller for several failure classes (goto fail paths never setan error code), so the client keeps consuming attacker data after statecorruption with no user-visible error. Affected versions Verified vulnerable: 2.11.2, 3.0.0, 3.6.0, 3.13.0, 3.20.0, 3.26.0, 3.31.0,3.32.2 (latest stable), master 41593321. git diff <any of these>..master -- libfreerdp/codec/progressive.c is empty for recent revisions — no fix existsupstream. Reproduction (end-to-end, real client) Patched sfreerdp-server (injection patch attached) + stock xfreerdp underXvfb over TCP/TLS, CAPROGRESSIVE V8, 1060x827 surface 1280x832: sfreerdp-server --port=13389 --cert=... --key=... \ --attack=150 --interval=20 --frame=attack_frame.binxfreerdp /v:127.0.0.1:13389 /u:tester /p:test /cert:ignore /sec:tls /gfx /rfx /size:1280x800 Result on 3.32.2 production build: client RSS 2.2 MB → 2,290 MB from 12.3 MBof traffic; 150/150 commands decoded "successfully" (rc=1); per-commandinterval 20.4 ms → 89.7 ms. With ulimit -v 1800000 the same attack SIGSEGVsthe client at ~145 commands. Control run with protocol-correctSTART_FRAME/END_FRAME and a fresh frameId per command stays flat at 110 MB RSSover 300 commands — isolating the root cause to the stale-frameId resetcondition. Attached: PoC source, attack frame, server patch, minimal fixpatch, results matrix (RESULTS.md), logs. Impact Remote DoS against any FreeRDP-based client connecting to anattacker-controlled server: memory exhaustion, frozen session (quadraticper-frame cost), hard SIGSEGV on memory-constrained systems (thin clients,VMs, containers, 2-4 GB devices). Heap out-of-bounds write (4 bytes) and wild-pointer dereference in thedecoder under realistic allocator pressure — memory corruption, not just DoS. No user interaction beyond connecting to the malicious server;deterministic. Suggested fix (verified patch attached — 95 lines, 2 hunks) progressive_decompress (progressive.c:2459): reset the tile update batchunconditionally per decompress call (one W2S2 PDU = one complete frame;update_tiles() already consumes the whole batch per call, so intra-framebatching is preserved; cross-call accumulation is never legitimate). progressive_allocate_tile_cache (progressive.c:397): compute the new gridsize locally and commit gridSize/tilesSize only after allsub-allocations succeed; roll back partial tile allocations so a failedgrowth leaves consistent state. Verified: with the patch, 300 attack commands keep the client at 110 MB flatRSS with 1.01x latency growth, the 1.8 GB cap no longer crashes the client,and TestFreeRDPCodecProgressive passes. ### Impact Remote DoS against any FreeRDP-based client connecting to anattacker-controlled server: memory exhaustion, frozen session (quadraticper-frame cost), hard SIGSEGV on memory-constrained systems (thin clients,VMs, containers, 2-4 GB devices). Heap out-of-bounds write (4 bytes) and wild-pointer dereference in thedecoder under realistic allocator pressure — memory corruption, not just DoS. No user interaction beyond connecting to the malicious server;deterministic.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | FreeRDP / libfreerdp (c) | >= 2.11.2 (verified: 2.11.2, 3.0.0, 3.6.0, 3.13.0, 3.20.0, 3.26.0, 3.31.0, 3.32.2, master 41593321). No fix exists upstream. | 3.33.0 | Patch available | GHSA-v7hr-xh82-79p7 |
- FreeRDP / libfreerdp (c) Vendor— Affected >= 2.11.2 (verified: 2.11.2, 3.0.0, 3.6.0, 3.13.0, 3.20.0, 3.26.0, 3.31.0, 3.32.2, master 41593321). No fix exists upstream. Fixed in 3.33.0 Patch available GHSA-v7hr-xh82-79p7
Remediation
Upgrade FreeRDP and libfreerdp to version 3.33.0 or later.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-v7hr-xh82-79p7 FreeRDP / libfreerdp (c) Fixed in 3.33.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-v7hr-xh82-79p7
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences