From bebbe60a142b741aea36cdd567fde7b74b78bcb7 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 24 Sep 2026 14:53:49 +0800 Subject: [PATCH] fix(clipboard): unix, check file transfer permission on incoming file clipboard The Cliprdr arm served incoming file clipboard messages on Linux/macOS without checking the file transfer permission, which the controlled side can turn off mid-session. can_sub_file_clipboard_service() only gates the outgoing service, so a peer could keep pushing files in and keep requesting the host's copied file list and contents. Check file_transfer_enabled() on every message. It is the same permission the client and the Windows cm use for file copy-paste. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/server/connection.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/connection.rs b/src/server/connection.rs index 7ed59b40c..4cb167039 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -3393,7 +3393,9 @@ impl Connection { self.send_to_cm(ipc::Data::ClipboardFile(clip)); } #[cfg(feature = "unix-file-copy-paste")] - if crate::is_support_file_copy_paste(&self.lr.version) { + if crate::is_support_file_copy_paste(&self.lr.version) + && self.file_transfer_enabled() + { let mut out_msgs = vec![]; #[cfg(target_os = "macos")]