Read the docs

Path traversal in FreeRDP clipboard lets servers read local files

Priority LOW 38CWE-20Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

FreeRDP up to and including 3.31.0 builds clipboard file URIs from file names sent by the RDP server without checking for parent directory segments (CWE-22). A malicious or compromised server can make the user's next paste copy a local file of its choice that the user running the client can read. The source reports this on Linux builds with FUSE enabled, which is the default.

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 me from Ada Logics. ### Affected component `winpr/libwinpr/clipboard/synthetic_file.c` — `convert_filedescriptors_to_file_list()`, lines 758, 784 and 797 at commit `a0114ebd34c71334a028f267acf6da391edbbe24`. Reached from the client-side clipboard path on Linux builds with `WITH_FUSE` enabled, which is the default (`client/common/CMakeLists.txt:47`, `OPT_FUSE_DEFAULT ON` on non-Apple/Win32/Android). ### Summary A malicious or compromised RDP server can choose, byte for byte, which local file the user's next clipboard paste actually copies. When the server advertises `FileGroupDescriptorW` and answers the client's Format Data Request, the client publishes a `text/uri-list` / `x-special/gnome-copied-files` entry of the form `file://<basePath>/<cFileName>`, where `basePath` is the cliprdr FUSE directory and `cFileName` comes straight off the wire. The only content check applied to `cFileName` on this path is a rejection of names containing a backslash (`_wcschr(dsc->cFileName, backslash.w)` at `:758` and `:784`); `/` and `..` are accepted, and the percent-escaping loop escapes only `# ? * ! %`. The name is then concatenated after `basePath + '/'` at `:797` with no canonicalisation, so the published URI is not constrained to the clipboard base directory. Every mainstream file manager resolves `..` in a `file://` path lexically (GIO/GLib for Nautilus, KIO/Qt for Dolphin) before opening it, so the paste reads a local file of the server's choosing rather than the remote file the user believes they are copying. `cFileName` is read verbatim with no validation in `cliprdr_read_filedescriptor()` (`libfreerdp/utils/cliprdr_utils.c:141`). The tree's existing name-component validator, `ValidFileNameComponent`, is installed on `wClipboardDelegate::IsFileNameComponentValid` (`synthetic_file.c:1236`) but is only consulted in the local-to-remote direction (`convert_local_name_component_to_remote()`), never on server-supplied descriptors. The FUSE mount state does not matter: `update_exposed_path()` sets `delegate->basePath` before `set_selection_for_clip_data_entry()` runs (`client/common/client_cliprdr_file.c:2053-2056`), so the URI is generated even when the per-file FUSE bookkeeping rejects the crafted name. We confirmed this by running the reproducer both without `/dev/fuse` (the mount fails, `fuse: device not found`) and with `--device /dev/fuse --cap-add SYS_ADMIN` (the mount succeeds) — the published URI is byte-identical. ### Primitive Server-directed local file read. Up to 259 UTF-16 characters of fully attacker-chosen path; enough `../` segments reach `/`, so any path readable by the user running the client. No memory-safety impact and no write-side traversal (the paste destination name is the basename). The disclosure is indirect: the file contents go wherever the user pastes, which becomes exfiltration when that destination is or later becomes server-visible (a redirected drive via `/drive:`, a synced or shared folder, a subsequent upload). It is also usable for deception — the user believes they copied a remote file and receives a local one under a plausible name. CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), reached via CWE-20 (Improper Input Validation) on untrusted server data. ### Reachability and caveats Attacker position: the RDP server the user connects to, or anything that has taken it over or is MITM-ing a connection whose certificate the user does not verify. No additional authentication is needed. User interaction is required — the user must paste into a file manager while the malicious clipboard entry is held. Reachable in a default Linux build (`WITH_FUSE=ON`) with clipboard redirection enabled (`xfreerdp +clipboard`). We have validated on the X11 client; the synthesizer is in WinPR and shared by the other Linux clients. ### Validated evidence Run at `a0114ebd34c71334a028f267acf6da391edbbe24`, real `xfreerdp` against a malicious peer built on FreeRDP's public server API: ``` [server] listening on 3389, cFileName="../../../../../../home/victim/.ssh/id_rsa" [server] -> FORMAT_LIST [FileGroupDescriptorW id=49267] [server] <- client FORMAT_DATA_REQUEST formatId=49267 [server] -> FORMAT_DATA_RESPONSE 1 x FILEDESCRIPTORW, cFileName="../../../../../../home/victim/.ssh/id_rsa" (596 bytes) === X11 CLIPBOARD targets advertised by xfreerdp === TIMESTAMP TARGETS text/uri-list x-special/gnome-copied-files x-special/mate-copied-files === text/uri-list published on the local clipboard === file:///tmp/com.freerdp.client.cliprdr.20/4294967296/../../../../../../home/victim/.ssh/id_rsa === x-special/gnome-copied-files (the target Nautilus reads) === copy file:///tmp/com.freerdp.client.cliprdr.20/4294967296/../../../../../../home/victim/.ssh/id_rsa === paste step: resolve the URI through GIO, exactly as a GTK file manager does === name: id_rsa uri: file:///home/victim/.ssh/id_rsa local path: /home/victim/.ssh/id_rsa --- contents of the pasted file --- -----BEGIN OPENSSH PRIVATE KEY----- LOCAL-VICTIM-SECRET-THIS-FILE-NEVER-CAME-FROM-THE-RDP-SERVER -----END OPENSSH PRIVATE KEY----- ``` Negative control, same image with `-e NAME=benign.txt` — the URI stays inside the base directory: ``` === text/uri-list published on the local clipboard === file:///tmp/com.freerdp.client.cliprdr.20/4294967296/benign.txt ``` ### Reproduction [ANT-2026-XMQQ5K4V-e2e.zip](https://github.com/user-attachments/files/32200192/ANT-2026-XMQQ5K4V-e2e.zip) The container builds FreeRDP from source at the pinned commit (`-DWITH_X11=ON -DWITH_FUSE=ON`; `-DWITH_SERVER=ON` only to build the malicious peer), starts `Xvfb`, runs the malicious peer and the real `xfreerdp` client with `+clipboard`, reads the local X11 CLIPBOARD with `xclip`, and performs the paste through `gio`. ``` unzip ANT-2026-XMQQ5K4V-e2e.zip && cd ANT-2026-XMQQ5K4V docker build -t ant-xmqq5k4v docker-e2e/ docker run --rm ant-xmqq5k4v ``` Optional variants (same result): ``` docker run --rm --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor=unconfined ant-xmqq5k4v docker run --rm -e NAME=benign.txt ant-xmqq5k4v ``` Any commit can be tested with `--build-arg TARGET_COMMIT=<sha>`. ### Reproducer archive (attached) `ANT-2026-XMQQ5K4V-e2e.zip` — self-contained: `docker-e2e/Dockerfile`, the malicious peer (`rogue_server.c`, public FreeRDP server API only), the driver `run.sh`, and a `README.txt` with the commands above. No FreeRDP source is patched, stubbed or reimplemented. ### Credit Found by Anthropic using Claude to study the security of open-source software, validated manually by Ada Logics. Disclosed 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

Fix Fixed FreeRDP (c): 3.32.0

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c)<= 3.31.03.32.0Patch availableGHSA-c3rh-2hv6-7hf2
  • FreeRDP (c) Vendor— Affected <= 3.31.0 Fixed in 3.32.0 Patch available GHSA-c3rh-2hv6-7hf2

Remediation

Update FreeRDP to version 3.32.0, which fixes all versions up to and including 3.31.0.

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

  • Fix · GHSA-c3rh-2hv6-7hf2 FreeRDP (c) Fixed in 3.32.0 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-c3rh-2hv6-7hf2

References

Sources

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