Read the docs

Use after free in FreeRDP URBDRC during USB transfer teardown

Priority LOW 39CWE-416Published · 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-v85m-wg84-5ffh. Fix status from GitHub. Impact type from CWE-416 and the CVSS impact.

Summary

FreeRDP up to and including 3.32.1 frees a libusb transfer that is still active during USB redirection (URBDRC) device or session teardown. A use after free (CWE-416) occurs because FreeRDP does not wait for asynchronous cancellation to complete before freeing the request queue, and libusb then reads the freed transfer. A remote server that a user connects to can submit a valid isochronous USB request and trigger the teardown, causing a crash with no confidentiality or integrity impact. USB redirection is opt-in.

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

Description from the GitHub advisory

### Summary Candidate ID: freerdp-urbdrc-active-transfer-teardown-uaf-dca5e651. When Alice connects to a server controlled by Mallory with FreeRDP's opt-in USB redirection enabled, Mallory can submit a valid isochronous USB request and then cause device or session teardown while the transfer remains active. FreeRDP asks libusb to cancel asynchronously, sleeps for 100 ms, destroys the request queue, and closes the device handle without proving that cancellation completed. The queue destructor frees the still-active transfer; official libusb then reads the freed allocation while traversing its in-flight list in `do_close`. This was reproduced on FreeRDP 3.32.1 and the assessed development snapshot with official libusb 1.0.30. It is best treated as an incomplete-fix residual or variant of GHSA-ccvv-hg2w-6x9j / CVE-2026-24681, whose 3.22.0 remediation added cancellation before unregistration but no completion barrier. ### Details The registered URBDRC data callback and production parser accepted a valid 64-byte `TRANSFER_OUT_REQUEST` and dispatched exactly one isochronous request with the encoded message ID, request ID, endpoint, flags, packet count, payload, direction, and timeout. Short-header, truncated-payload, and inconsistent-size controls did not dispatch. The registered channel-close callback also resolved the device channel and reached `markChannelClosed`. This test began at FreeRDP's registered callback object; it did not parse outer DRDYNVC framing. Production `libusb_udev_isoch_transfer` allocates a `libusb_transfer`, registers `func_iso_callback`, stores the transfer in FreeRDP's request queue, and calls `libusb_submit_transfer`. A successful submission also places the transfer in libusb's in-flight list. libusb documents that cancellation returns before completion and that freeing an active transfer is invalid. Production `udev_free` calls cancellation for queued requests, resets the device, waits a fixed 100 ms, and frees the request queue. Its object destructor, `request_free`, releases callback state and calls `libusb_free_transfer`. It then invokes the real `libusb_close`. In the failing direct run, ASan reported the read in libusb `do_close`, with the free stack passing through `libusb_free_transfer`, `request_free`, `ArrayList_Free`, and `udev_free`. The matching joined control serviced the cancellation callback before teardown and remained clean. The full-plugin termination ordering makes the ownership failure more than a purely artificial scheduling delay. Production first stops and joins the sole libusb polling thread, then unregisters and frees devices. Cancellation is requested later inside device teardown, so that stopped thread cannot deliver the new completion during the 100 ms sleep. This path is structurally strong, but the RDP session is already ending, which limits the incremental availability impact. For an individual device-channel close, the event thread remains active. The registered close path is reachable, but a real device must keep the transfer active past the fixed delay; that race rate was not measured. A secondary contract-model harness delivered the registered callback late on a fake event thread and reproduced a use-after-free in `func_iso_callback`, but the direct official-libusb run faults earlier in `do_close` and is the primary evidence. ### PoC [freerdp-urbdrc-frees-active-libusb-transfers-during-teardown.zip](https://github.com/user-attachments/files/32792761/freerdp-urbdrc-frees-active-libusb-transfers-during-teardown.zip) This source excerpt is copied byte-for-byte from the packaged harness. It submits through FreeRDP's production ISO transfer entry point, then contrasts a joined cancellation with the controlled `late` ordering that calls production `udev_free` before libusb event handling: ```c if (submit_iso(device) != LIBUSB_SUCCESS) { fprintf(stderr, "production isoch submit failed\n"); return 1; } fprintf(stderr, "real-libusb: production transfer submitted\n"); if (strcmp(argv[1], "joined") == 0) { device->iface.cancel_all_transfer_request(&device->iface); if (drain_cancel(context, device) != LIBUSB_SUCCESS) { fprintf(stderr, "real-libusb: cancellation callback was not drained\n"); return 1; } fprintf(stderr, "real-libusb: callback joined before production udev_free\n"); device->iface.free(&device->iface); } else { fprintf(stderr, "real-libusb: entering production udev_free before event handling\n"); device->iface.free(&device->iface); fprintf(stderr, "real-libusb: production udev_free returned; handling cancel event\n"); struct timeval timeout = { .tv_sec = 1, .tv_usec = 0 }; (void)libusb_handle_events_timeout(context, &timeout); } ``` This is a focused, controlled lifecycle ordering used to isolate the bug; it is not a complete wire-level or full-RDP exploit. Package attachments: - `poc/README.md` explains prerequisites, reconstruction limits, and safe handling. - `poc/urbdrc_real_libusb.c` is the focused harness using production FreeRDP transfer and teardown code. - `poc/iso-device.umockdev` is the synthetic device descriptor exposing isochronous endpoint `0x81`. - `poc/usbkbd.pcap.pcapng.b64` is the encoded UMockdev replay capture. - `supporting/master-asan.txt` contains the development direct real-libusb failure. - `supporting/release-3.32.1-asan.txt` contains the FreeRDP 3.32.1 direct failure. - `supporting/master-joined-control.txt` contains the clean development joined control. - `supporting/release-3.32.1-joined-control.txt` contains the clean 3.32.1 joined control. - `supporting/message-reachability.txt` contains valid dispatch, malformed-message controls, and the close-callback result. - `supporting/repeat-summary.txt` contains the ten-run development matrix. - `supporting/lifecycle-asan-late.txt` contains the secondary fake-backend callback failure. - `supporting/lifecycle-controls.txt` contains the clean early and joined ASan lifecycle controls. - `supporting/validation-notes.md` records revisions, source findings, mocked boundaries, and proof gaps. - `supporting/sha256sums.txt` is the attachment integrity manifest. The retained primary matrix reports: ```text master joined=0 late=6 UAF; release-3.32.1 joined=0 late=6 UAF ``` The source and fixture exercise the real FreeRDP teardown and real libusb state machine, but no physical USB device or complete RDP session was used. ### Impact The narrow demonstrated impact is a heap use-after-free in the FreeRDP client process. ASan reliably aborts when real libusb reads the freed transfer during handle close; a secondary optimized contract-model run terminated with `SIGSEGV` on late callback delivery.

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-v85m-wg84-5ffh
  • FreeRDP (c) Vendor— Affected <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-v85m-wg84-5ffh

Remediation

Upgrade FreeRDP to version 3.32.2.

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

  • Fix · GHSA-v85m-wg84-5ffh FreeRDP (c) Fixed in 3.32.2 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-v85m-wg84-5ffh

References

Sources

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