Out-of-bounds write in FreeRDP Windows clipboard stream reads
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 through 3.29.0 contains an out-of-bounds write in the clipboard code of its Windows client (CWE-787). The CliprdrStream_Read function copies a file-contents response whose length is chosen by the server into a buffer sized by the caller, without checking that length. A malicious or compromised RDP server can overflow the paste consumer's buffer with attacker-controlled data.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
This issue was found using AI and agents, and has been reviewed manually. This is a Windows-only issues, but I don't have access to a Window machine so did not create an end-to-end windows reproducer. I left out a harness-based Linux reproducer to as I think auditing the code should be sufficient to identify the vulnerability. Let me know if you need more information from me and I will see if I can extract it. ## Summary FreeRDP's Windows client exposes clipboard file contents to OLE paste consumers (e.g. `explorer.exe`) through a COM `IStream`. When the consumer calls `IStream::Read(pv, cb, …)` — `pv` is its own fixed-size buffer of `cb` bytes — `CliprdrStream_Read()` asks the RDP server for the data via a `CB_FILECONTENTS_RANGE` request, then copies the server's response into `pv` using the **server-supplied length** (`req_fsize`), not `cb`: ```c CopyMemory(pv, clipboard->req_fdata, clipboard->req_fsize); // length is server-controlled ``` A malicious or compromised RDP server answers the bounded request with an arbitrarily large `CB_FILECONTENTS_RESPONSE`; `req_fsize` becomes the attacker's chosen size and the copy overflows the consumer's buffer with attacker-controlled content. ## Affected versions - **FreeRDP `master`** — HEAD `5e8e987b469b60a3bafadf8f5afc40f91c09f458`, `client/Windows/wf_cliprdr.c:249` (`CliprdrStream_Read`): the copy still uses `clipboard->req_fsize` with no clamp to `cb`. Unpatched. - **FreeRDP 3.x** — present in the released Windows client. - Appears novel — no GHSA/CVE found for `CliprdrStream_Read` copying a server-controlled length. ## Details All line numbers at `master` HEAD `5e8e987b`, `client/Windows/wf_cliprdr.c`. ```c // CliprdrStream_Read() :225 static HRESULT STDMETHODCALLTYPE CliprdrStream_Read(IStream* This, void* pv, ULONG cb, ULONG* pcbRead) { ... /* Ask the server for the file contents (bounded request of cb bytes). */ ret = cliprdr_send_request_filecontents(clipboard, (void*)This, instance->m_lIndex, FILECONTENTS_RANGE, instance->m_lOffset.QuadPart, cb); if (ret < 0) return E_FAIL; if (clipboard->req_fdata) { CopyMemory(pv, clipboard->req_fdata, clipboard->req_fsize); // :249 cb is IGNORED free(clipboard->req_fdata); } ... } ``` `req_fsize` / `req_fdata` are set by the channel callback `wf_cliprdr_server_file_contents_response()` directly from the server's `CB_FILECONTENTS_RESPONSE` PDU (the `CopyMemory` of the server payload is around `:2455`). Nothing constrains `req_fsize` to the `cb` the consumer passed, so the copy at `:249` writes `req_fsize` bytes into a `cb`-byte buffer. `cb` is the size the paste consumer requested (commonly a small, fixed value); `req_fsize` is whatever the server put in the response. **Reach:** OLE paste consumer → `IStream::Read` → `CliprdrStream_Read` → `cliprdr_send_request_filecontents` (server round-trip) → `CopyMemory` overflow. ## Impact A malicious/compromised RDP server overflows a fixed-size heap buffer in the OLE paste consumer (e.g. `explorer.exe`) with attacker-controlled bytes when a user pastes server-offered clipboard file contents — a classic attacker-content heap overflow, in a process outside the RDP client. ## Suggested fix Clamp the copy to the caller's buffer size, and report only what fits: ```diff if (clipboard->req_fdata) { - CopyMemory(pv, clipboard->req_fdata, clipboard->req_fsize); + ULONG n = (clipboard->req_fsize < cb) ? clipboard->req_fsize : cb; + CopyMemory(pv, clipboard->req_fdata, n); free(clipboard->req_fdata); } - *pcbRead = clipboard->req_fsize; - instance->m_lOffset.QuadPart += clipboard->req_fsize; + *pcbRead = n; + instance->m_lOffset.QuadPart += n; ``` (An `IStream::Read` must never write more than `cb` bytes into `pv`; a server returning more than requested should be treated as a short read or an error.) ## References - `client/Windows/wf_cliprdr.c` (master `5e8e987b`) — `CliprdrStream_Read` (`:225`, overflowing `CopyMemory` at `:249`), server file-contents response handler (`CopyMemory` of the server payload near `:2455`). - CWE-787 (Out-of-bounds Write), CWE-120, CWE-130. ## Attribution This issue was found using AI and agents, and has been reviewed manually. Please credit **Claude** and **Ada Logics** — found by Anthropic using agents to study the security of open-source projects, with Ada Logics validating and reporting. Let us know if you need any more information. ## Disclosure We follow coordinated disclosure policy here: https://www.anthropic.com/coordinated-vulnerability-disclosure (90 day deadline).
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 | <= 3.29.0 | 3.30.0 | Patch available | GHSA-m37j-jcr2-8gcc |
- FreeRDP Vendor— Affected <= 3.29.0 Fixed in 3.30.0 Patch available GHSA-m37j-jcr2-8gcc
Remediation
Update FreeRDP to 3.30.0, the first fixed version.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-m37j-jcr2-8gcc FreeRDP Fixed in 3.30.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-m37j-jcr2-8gcc
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences