Integer underflow in FreeRDP shadow server crashes the shared session
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-369.
Summary
FreeRDP through 3.31.1 has a flaw in its shadow server (freerdp-shadow-cli) where a client-supplied Frame Acknowledge id is stored without a range check. An authenticated remote client that acknowledges a frame id one past the last sent frame causes an integer underflow (CWE-191) that leads to a division by zero, which crashes the whole freerdp-shadow-cli process and disconnects every viewer of the shared session. The impact is limited to availability.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
This issue was found by Anthropic using Claude to study the security of open-source software, validated manually by Ada Logics. ### Summary FreeRDP's shadow server (`freerdp-shadow-cli`) tracks how many encoded frames are outstanding by subtracting the frame id the client last acknowledged from the frame id the server last sent. The acknowledged id is taken verbatim from the client's Frame Acknowledge PDU with no monotonicity or range check. A connected client that acknowledges `frameId + 1` makes the UINT32 subtraction wrap to `0xFFFFFFFF`; on the next encoded frame `shadow_encoder_create_frame_id()` computes `100 / (inFlightFrames + 1)`, where the addend wraps back to `0`, and the process takes SIGFPE. That kills the entire `freerdp-shadow-cli` process, dropping every concurrently connected viewer of the shared session. The impact is availability only (no out-of-bounds memory access), and in the default configuration the attacker is a client already authenticated to view the desktop. ### Affected component `server/shadow` — `freerdp-shadow-cli`, at current master commit `43e8453d121709811051522d1d383b265c0bb63c` (2026-09-14; the vulnerable lines are unchanged from `a0114ebd`). The same code is present on the `stable-3.0` branch. - `server/shadow/shadow_client.c:815-828` — `shadow_client_common_frame_acknowledge()` - `server/shadow/shadow_encoder.c:38-49` — `shadow_encoder_inflight_frames()` - `server/shadow/shadow_encoder.c:52-77` — `shadow_encoder_create_frame_id()`, faulting division at `:64` ### Root cause The shadow server derives the number of outstanding frames by subtracting the frame id the client last acknowledged from the frame id the server last sent: ```c /* shadow_encoder.c:47 */ return (encoder->queueDepth == SUSPEND_FRAME_ACKNOWLEDGEMENT) ? 0 : encoder->frameId - encoder->lastAckframeId; ``` `encoder->lastAckframeId` is whatever the client put in the acknowledge PDU. Both entry points — the legacy SURFACECMD path (`shadow_client_surface_frame_acknowledge`, registered at `shadow_client.c:2660`, fed from `libfreerdp/core/peer.c:396`) and the RDPGFX path (`shadow_client_rdpgfx_frame_acknowledge`) — call `shadow_client_common_frame_acknowledge()`, which stores the wire value verbatim: ```c /* shadow_client.c:827 */ client->encoder->lastAckframeId = frameId; ``` Nothing enforces `lastAckframeId <= frameId`. If a client acknowledges `frameId + 1`, the UINT32 subtraction wraps to `0xFFFFFFFF`. That value satisfies the `> 1` guard in `shadow_encoder_create_frame_id()`, and the addend then wraps back to zero: ```c /* shadow_encoder.c:62-64 */ if (inFlightFrames > 1) { encoder->fps = (100 / (inFlightFrames + 1) * encoder->maxFps) / 100; } ``` `100 / 0` raises SIGFPE on the client's worker thread, which terminates the whole `freerdp-shadow-cli` process and therefore every concurrently connected viewer. The `SUSPEND_FRAME_ACKNOWLEDGEMENT` short-circuit does not prevent this. On the legacy path `shadow_client_surface_frame_acknowledge()` resets `queueDepth = QUEUE_DEPTH_UNAVAILABLE` on every acknowledge (`shadow_client.c:840`), so the subtracting branch is always taken; on the RDPGFX path `queueDepth` is itself copied from the client PDU (`shadow_client.c:859`), so the client chooses any value other than `SUSPEND_FRAME_ACKNOWLEDGEMENT`. The server discloses the frame id the attacker needs: it is carried in every Surface Frame Marker PDU, so the attack is deterministic rather than a guess. ### Primitive shape | Property | Value | |---|---| | Direction | neither read nor write — integer division fault | | Attacker-controlled bytes | 4 (the `frameId` field of TS_FRAME_ACKNOWLEDGE_PDU / RDPGFX_FRAME_ACKNOWLEDGE_PDU) | | What it influences | the divisor of an integer division | | Impact | process termination of `freerdp-shadow-cli`; all connected sessions dropped | | Reachability | default configuration; surface frame markers are enabled unconditionally at `shadow_client.c:303` | CWE-369 (Divide By Zero), reached via CWE-191 (Integer Underflow). ### Scope and caveats Availability only — no memory is read or written out of bounds, and the attacker's four bytes only select the divisor. In the default configuration `freerdp-shadow-cli` requires authentication (`server->authentication = TRUE`, `shadow_server.c:1173`), so the baseline attacker position is a client permitted to view the shared desktop; the impact extends to all other viewers of that session. ### Validated evidence From a run of the attached reproducer against the unmodified `freerdp-shadow-cli` built with AddressSanitizer at current master `43e8453d121709811051522d1d383b265c0bb63c`: ``` [rogue-client] server frame id 17 -> acknowledging 18 ... AddressSanitizer:DEADLYSIGNAL ==13==ERROR: AddressSanitizer: FPE on unknown address 0x7b6f213e35da (pc 0x7b6f213e35da bp 0x776f162ae950 sp 0x776f162ae950 T4) #0 0x7b6f213e35da in shadow_encoder_create_frame_id build/./server/shadow/shadow_encoder.c:64:23 #1 0x7b6f213de16f in shadow_client_send_surface_bits build/./server/shadow/shadow_client.c:1861:13 #2 0x7b6f213d64c6 in shadow_client_send_surface_update build/./server/shadow/shadow_client.c:2356:9 #3 0x7b6f213d64c6 in shadow_client_thread build/./server/shadow/shadow_client.c:2741:11 SUMMARY: AddressSanitizer: FPE build/./server/shadow/shadow_encoder.c:64:23 in shadow_encoder_create_frame_id === shadow server process state === shadow exited rc=1 ``` Register dump at the fault: `rax = 0x0000000000000064` (the literal 100), `rcx`/`rdx` = 0 — the divisor is zero at the `div` instruction. ### Reproduction [ANT-2026-EJ1Z5MY5-e2e.zip](https://github.com/user-attachments/files/32200924/ANT-2026-EJ1Z5MY5-e2e.zip) ``` unzip ANT-2026-EJ1Z5MY5-e2e.zip && cd ANT-2026-EJ1Z5MY5 docker build -t ant-ej1z5my5 docker-e2e/ docker run --rm ant-ej1z5my5 ``` No special `docker run` flags are needed. The image builds FreeRDP from source at `ARG TARGET_COMMIT` (default `43e8453d121709811051522d1d383b265c0bb63c`, current master; overridable with `--build-arg TARGET_COMMIT=<sha>`) with `-fsanitize=address`, starts `Xvfb` plus a colour-flip loop to generate screen damage, starts `freerdp-shadow-cli /port:33389 -auth /sec:tls`, and connects a client built on the public libfreerdp3 client API whose only deviation from the upstream sample client is that its Surface Frame Marker handler calls the public `update->SurfaceFrameAcknowledge(context, frameId + 1)`. Authentication is disabled in the container only to avoid provisioning a SAM file; it does not affect the code path. Runtime is about 20 seconds after the build. Reproducer attached as `ANT-2026-EJ1Z5MY5-e2e.zip`. ### Disclosure Found by Anthropic using Claude to study the security of open-source software, validated manually by Ada Logics. Handled under Anthropic's coordinated vulnerability disclosure policy (https://www.anthropic.com/coordinated-vulnerability-disclosure, 90 days). Please credit Claude and Ada Logics in any advisory.
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.31.1 | 3.32.0 | Patch available | GHSA-6vjv-4hm3-6698 |
- FreeRDP (c) Vendor— Affected <= 3.31.1 Fixed in 3.32.0 Patch available GHSA-6vjv-4hm3-6698
Remediation
Upgrade FreeRDP to version 3.32.0 or later, which fixes this issue.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-6vjv-4hm3-6698 FreeRDP (c) Fixed in 3.32.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-6vjv-4hm3-6698
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences