Reachable assertion in FreeRDP remdesk channel aborts freerdp-shadow-cli
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-9r9q-9r7p-4mr6. Fix status from GitHub. Impact type from CWE-617.
Summary
In FreeRDP versions from 3.0.0 up to and including 3.32.2, the remdesk server channel read loop loses its read position when one client message is longer than the 4096-byte buffer and the PDU header declares a shorter length. The next read calls Stream_Seek past the buffer capacity, and in a default build WINPR_ASSERT calls abort(). One message from any authenticated client therefore terminates freerdp-shadow-cli and every session it serves. The weaknesses are CWE-130 and CWE-617, with a CVSS 3.1 base score of 6.5 (MEDIUM).
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
[remdesk-server-seek-past-capacity-abort-reproducer.zip](https://github.com/user-attachments/files/33658305/remdesk-server-seek-past-capacity-abort-reproducer.zip) ### Summary The server side of the Remote Assistance (`remdesk`) static virtual channel loses track of its read position when a single client message is longer than its 4096-byte buffer and the PDU header declares a shorter length. The next read calls `Stream_Seek` past the buffer's capacity. In a default build `WINPR_ASSERT` then calls `abort()`, so one message from any authenticated client kills `freerdp-shadow-cli` and every session it is serving. --- Found by Anthropic using Claude and manually validated by Ada Logics. Please credit both Claude and Ada Logics in any advisory. We adhere to Anthropic's [coordinated vulnerability disclosure policy](https://www.anthropic.com/coordinated-vulnerability-disclosure) (90 days). ### Details `remdesk_server_thread` (`channels/remdesk/server/remdesk_main.c`, line numbers as of 3.32.2 / `master`) reads every chunk to the **start** of its buffer, but advances the position **from where the previous read left it**: ```c 473 wStream* s = Stream_New(nullptr, 4096); ... 540 if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, Stream_BufferAs(s, char), 541 (UINT32)len, &BytesReturned)) /* len = capacity, offset 0 */ ... 544 Stream_Seek(s, BytesReturned); /* from the current position */ ... 567 const UINT64 PduLength = LengthLow + LengthHigh + 8ull; 569 if (PduLength >= pos) ... /* only here: process the PDU, then Stream_ResetPosition(s) */ ``` `WTSProcessChannelData` (`libfreerdp/core/server.c:479-566`) reassembles the client's fragments into one queued message of the client-declared `totalLength`. `FreeRDP_WTSVirtualChannelRead` (`server.c:1702`) hands out at most `BufferSize` bytes per call and keeps the rest queued. If a client sends one 4100-byte message whose first 8 bytes are zero: 1. The first read copies 4096 bytes to offset 0. `Stream_Seek(s, 4096)` sets pos = 4096 = capacity. 2. `PduLength` = 8 < 4096, so the PDU is neither processed nor reset. pos stays at 4096. 3. The channel event is still signalled. The second read copies the remaining 4 bytes to offset 0, then `Stream_Seek(s, 4)` with 0 bytes remaining fails `WINPR_ASSERT(Stream_GetRemainingCapacity(s) >= _offset)` at `winpr/include/winpr/stream.h:159`, which calls `abort()`. These guards are on the path but do not stop it. The `len > UINT32_MAX` check (:535) does not look at the position. `Stream_EnsureRemainingCapacity` (:548) runs only when a read *fails*. `Stream_SetPosition(s, pos)` (:562) checks the position only after the seek has already asserted. Reassembly in `server.c` correctly allows messages longer than 4096 bytes. Any path that skips the reset (`PduLength < pos`, or `pos < 8`) leaves a stale position. A two-message variant (4 bytes, then 4096) should therefore also trigger it, but that was not run. Suggested fix: read into `Stream_Pointer(s)` with `Stream_GetRemainingCapacity(s)` after `Stream_EnsureRemainingCapacity`, process the PDU only once `pos >= PduLength`, and reset or compact afterwards. At minimum, use `Stream_SafeSeek` and treat failure as a protocol error. `channels/encomsp/server/encomsp_main.c:219-253` uses the same read-to-buffer-start pattern and is worth fixing at the same time. ### Proof of concept A self-contained Docker reproducer, attached as `remdesk-server-seek-past-capacity-abort-reproducer.zip` (Dockerfile, `run.sh`, a README and a small libfreerdp client in `driver/`). Requires only Docker: no arguments, no volumes, no privileged mode, no host configuration. ```bash unzip remdesk-server-seek-past-capacity-abort-reproducer.zip cd remdesk-server-seek-past-capacity-abort-reproducer docker build -t repro . docker run --rm repro ``` The image clones FreeRDP `3.32.2` (`97eff6dd`) from unmodified upstream source and builds it with AddressSanitizer (used here only to symbolize the abort) and default security options (`WITH_VERBOSE_WINPR_ASSERT=ON`). It then starts the stock `freerdp-shadow-cli /sam-file:...` (default NLA) on Xvfb. A client written against libfreerdp's public API (`LoadChannels`, `SendChannelData`) logs in with valid credentials, joins `remdesk` and sends one all-zero 4100-byte message. All traffic stays on loopback. Expected output (abridged, from a real run): ``` FreeRDP 3.32.2 97eff6ddfbbfaa8e42a126d362686bd001ff8bdc [FATAL][com.freerdp.winpr.assert] - [winpr_int_assert]: ((Stream_GetRemainingCapacity(s) >= _offset)) [winpr/include/winpr/stream.h:Stream_Seek:159] ==24==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000018 (pc 0x74bdb3bf2c0c bp 0x74bdaafa49c0 sp 0x74bdaafa4980 T5) #2 0x74bdb3b7c8fe in abort (/lib/x86_64-linux-gnu/libc.so.6+0x288fe) #3 0x74bdb40c7fbf in winpr_int_assert winpr/libwinpr/crt/assert.c:30:2 #4 0x74bdb4cc9707 in Stream_Seek winpr/include/winpr/stream.h:159:3 #5 0x74bdb4cc8e33 in remdesk_server_thread channels/remdesk/server/remdesk_main.c:544:6 #6 0x74bdb407e498 in thread_launcher winpr/libwinpr/thread/thread.c:540:7 client: authenticated, sent one 4100-byte remdesk message REPRODUCED - F-001: one authenticated remdesk message aborted freerdp-shadow-cli ``` Exit code `0` means the vulnerability reproduced, `1` means it did not, so the container also works as a regression test once a fix lands. It reproduced on every run (3/3 from the archive, including once with `--network none`). The same client sending exactly 4096 bytes leaves the server running and the container exits `1`. In a build without AddressSanitizer the process dies with the same assertion and exit status 134. ### Impact Denial of service of the shadow server. Any user who can log in to `freerdp-shadow-cli` can abort the whole process with one channel message and repeat it at will, ending every other session served by that process. With the default NLA configuration this requires valid credentials. If the operator disables authentication (`-auth`), anyone who can reach the port can do it. Other servers that use the shipped remdesk server channel (`remdesk_server_context_new`) are probably affected the same way, but only `freerdp-shadow-cli` was tested. What was not established: this is a reachable assertion, not memory corruption. An AddressSanitizer build reports no invalid access before the abort, and from reading the code every read writes at offset 0 with size ≤ capacity. No information disclosure or code execution is claimed. Builds with `WITH_VERBOSE_WINPR_ASSERT=OFF` were not run. In those builds, code reading suggests `Stream_SetPosition` (:562) fails on the next iteration and only the remdesk channel thread exits. Termination of concurrent sessions follows from the process exiting, but it was not exercised with a second live session. This affects the supported 3.x line and `master` (SECURITY.md: "3.x.x | stable-3.0 | :white_check_mark:"), not only the development branch.
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, <= 3.32.2 | 3.33.0 | Patch available | GHSA-9r9q-9r7p-4mr6 |
- FreeRDP (c) Vendor— Affected >= 3.0.0, <= 3.32.2 Fixed in 3.33.0 Patch available GHSA-9r9q-9r7p-4mr6
Remediation
Upgrade FreeRDP to 3.33.0, the release that fixes this issue.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-9r9q-9r7p-4mr6 FreeRDP (c) Fixed in 3.33.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-9r9q-9r7p-4mr6
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences