Read the docs

Use after free in FreeRDP RDP2TCP client worker during disconnect

Priority LOW 39CWE-362Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
High
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 3.1 · GHSA-3664-pr8r-3254. Fix status from GitHub. Impact type from CWE-416 and the CVSS impact.

Summary

FreeRDP channels/rdp2tcp/client up to and including 3.33.0 is affected. When a client enables the optional RDP2TCP channel with a local helper, channel teardown frees the worker's owner object without stopping or joining the worker thread, which causes a use after free (CWE-416). A malicious RDP server can send channel data and close the connection while the helper is active, so the worker accesses freed memory during disconnect.

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

Description from the GitHub advisory

### Summary When a FreeRDP client explicitly enables the optional RDP2TCP channel with a local helper, channel teardown closes the copy-worker handle without stopping or joining the worker, then frees the worker's Plugin owner. A controlled RDP server can send channel data and close the connection while the helper is active. In two full FreeRDP 3.32.2 ASan client sessions, an echo helper and a silent helper both reached ACTIVE, received the same synthetic channel packet and produced a heap-use-after-free in copyThread during disconnect. A matched no-RDP2TCP session and two test-only stop/join sessions were ASan-clean. ### Details `channels/rdp2tcp/client/rdp2tcp_main.c::channel_initialized()` starts `copyThread()` with a raw pointer to a heap `Plugin`. `channel_terminated()` calls `CloseHandle(copyThread)` but does not join or stop the thread; it then closes the worker's event and pipes, terminates the helper and frees `Plugin`. `copyThread()` can continue to access the freed owner. The 3.32.2 ASan stack identifies a read at `rdp2tcp_main.c:156:34`, after free through `freerdp_channels_close` in `libfreerdp/core/client.c:995:4`. The client must locally configure `/rdp2tcp:<helper command>`; a remote server cannot select a helper. In the isolated loopback lab, the peer completed ACTIVE, sent one exact 14-byte synthetic channel payload on the advertised RDP2TCP static channel (MCS ID 1007), held for 25 ms and closed. Both echo and silent helpers received the packet. Both unchanged-client cases showed the same ASan UAF. The silent case showed helper output was unnecessary. A same-client no-feature control reached ACTIVE without advertising RDP2TCP and had no ASan finding. A separate test-only stop/join build used the original peer packet and helper behavior in echo and silent modes; both were ASan-clean without a join timeout. The patch stops and unblocks the worker and joins before owner destruction. It is evidence for the lifetime cause, not a production fix review. The exact 3.32.2 source commit is `97eff6ddfbbfaa8e42a126d362686bd001ff8bdc`. A reviewed master source snapshot `dae0390a42ab271fa07a35979dfcd5671f83a949` retained the same RDP2TCP source hash on 31 October 2026. Historical commit `c522a4d35d6ad3ab667243fa29fa3708c37947d8` appears to introduce the bare-handle-close path, first included in 3.14.1; 3.14.0 predates it. The complete affected-version range and any private duplicate are unknown. A bounded public review found no matching RDP2TCP teardown UAF; GHSA-rq8f-9xjh-pr3m concerns a separate `.rdp` file command-line problem. Please assess the stop/join ordering and supported helper behavior, including partial initialization, helper descendants, callback teardown and normal-release availability. ### Proof of concept Use only the attached verified D-165 synthetic packet in an authorized isolated lab. Its source-pinned image recipe enables RDP2TCP and ASan on FreeRDP 3.32.2; the local peer listens on 127.0.0.1 inside a container with `--network none`. Run the documented `echo` and `silent` modes as separately tracked, resource-limited cases with a 35-second watchdog. Each sends the same 36-byte static-channel PDU (SHA-256 `665871afc07bee30e4fdb58bd2157d5c70bb47e94dd12cd852642a871ef149ed`), reaches ACTIVE and reports an ASan heap use after free in `copyThread()`. The packet also contains a no-RDP2TCP control recipe and a clearly test-only stop/join patch/build recipe. The no-feature run sends no candidate PDU. The fixed echo and silent runs use the same original packet and helper input, with no ASan diagnostic or join timeout. `VERIFY.py` checks every packet byte and `verify_receipts.py` checks exact transport, helper, source-frame, log-hash and control gates; these checks do not run FreeRDP. Two pre-ACTIVE setup attempts are labeled partial and excluded from the full-session claim. ### Impact Demonstrated: an ASan-detected heap use after free in a full client session after a remote-controlled disconnect, requiring the user to enable optional RDP2TCP and a local helper. The ASan target aborts; a corresponding uninstrumented release-build crash and its frequency are not measured. Potential client availability loss is therefore an inference.

Why it matters now

Fix Fixed channels/rdp2tcp/client (c): 3.33.1

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—channels/rdp2tcp/client (c)<= 3.33.03.33.1Patch availableGHSA-3664-pr8r-3254
  • channels/rdp2tcp/client (c) Vendor— Affected <= 3.33.0 Fixed in 3.33.1 Patch available GHSA-3664-pr8r-3254

Remediation

The fixed version for channels/rdp2tcp/client is 3.33.1.

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

  • Fix · GHSA-3664-pr8r-3254 channels/rdp2tcp/client (c) Fixed in 3.33.1 Advisory →

Timeline

  1. 2026-11-17 Threatist record created from GHSA-3664-pr8r-3254

References

Sources

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