CVE-2026-25997
📋 TL;DR
This CVE describes a use-after-free vulnerability in FreeRDP's clipboard handling for X11 clients. When FreeRDP automatically reconnects, one thread frees clipboard format memory while another thread is still accessing it, potentially causing crashes or arbitrary code execution. This affects FreeRDP users connecting via X11 on Linux/Unix systems.
💻 Affected Systems
- FreeRDP
📦 What is this software?
Freerdp by Freerdp
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with the privileges of the FreeRDP process, potentially leading to full system compromise.
Likely Case
Application crash or denial of service, with potential for information disclosure or limited code execution.
If Mitigated
Application crash only, with no privilege escalation beyond the FreeRDP process context.
🎯 Exploit Status
Exploitation requires triggering specific race conditions during clipboard operations and auto-reconnect scenarios.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.23.0
Vendor Advisory: https://github.com/FreeRDP/FreeRDP/releases/tag/3.23.0
Restart Required: Yes
Instructions:
1. Download FreeRDP 3.23.0 or later from the official repository. 2. Compile and install according to your distribution's package management or from source. 3. Restart any FreeRDP client sessions.
🔧 Temporary Workarounds
Disable clipboard redirection
linuxPrevent clipboard synchronization between client and server to avoid triggering the vulnerable code path.
xfreerdp /clipboard- /v:TARGET
Disable auto-reconnect
linuxPrevent automatic reconnection attempts that trigger the race condition.
xfreerdp /reconnect- /v:TARGET
🧯 If You Can't Patch
- Use alternative RDP clients that are not affected by this vulnerability
- Implement network segmentation to limit access to FreeRDP services
🔍 How to Verify
Check if Vulnerable:
Check FreeRDP version with 'xfreerdp --version' and verify it's below 3.23.0
Check Version:
xfreerdp --version | head -1
Verify Fix Applied:
Confirm version is 3.23.0 or higher with 'xfreerdp --version'
📡 Detection & Monitoring
Log Indicators:
- FreeRDP crash logs with segmentation faults
- Application errors mentioning clipboard or xf_cliprdr
Network Indicators:
- RDP session reconnections followed by client crashes
SIEM Query:
source="freerdp.log" AND ("segmentation fault" OR "use-after-free" OR "clipboard")
🔗 References
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L1884
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L1889
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L265
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L616
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L831
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L851-L855
- https://github.com/FreeRDP/FreeRDP/blob/5c7aae27d0417b42b4806c2a5c583ca39dd9ef1e/client/X11/xf_cliprdr.c#L868-L875
- https://github.com/FreeRDP/FreeRDP/commit/58409406afe7c2a8a71ed2dc8e22075be4f41c0c
- https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-q5j3-m6jf-3jq4
- https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-q5j3-m6jf-3jq4