Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos to handle more clipboard formats, converting them on the fly #273

Closed
totaam opened this issue Feb 28, 2013 · 5 comments
Closed

macos to handle more clipboard formats, converting them on the fly #273

totaam opened this issue Feb 28, 2013 · 5 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Feb 28, 2013

At the moment, we simply drop these types of clipboard data:

if type in ("WINDOW", "PIXMAP", "BITMAP", "DRAWABLE", "PIXEL", "COLORMAP"):
    debug("skipping clipboard data of type: %s, format=%s, len(data)=%s", dtype, dformat, len(data))
    return None, None

We could try to handle some of those, and provide them in multiple formats since we generally have PIL available for converting between formats.

From a security POV, it probably makes sense to always convert formats so that we can "guarantee" that the data we send over the wire is not malicious?
Think: an application providing a JPEG based buffer overflow via the clipboard: worst case scenario is that the xpra server crashes parsing it or maybe it gets compromised, but the client machine will not receive the malicious content directly.
But then again, if you can exploit the server, you can then inject the bad content in there.. I guess it's still a first line of defense.

@totaam
Copy link
Collaborator Author

totaam commented Oct 31, 2013

Now that both OSX and win32 are using synchronous clipboard code (pretty much) and OSX is using at least some native call (see #318 for details)
It probably makes sense to use native libraries directly for accessing rich formats:

@totaam
Copy link
Collaborator Author

totaam commented Feb 9, 2016

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2020

For win32: #2619

@totaam
Copy link
Collaborator Author

totaam commented Jun 10, 2020

html5 was done in #2312

This only leaves macos for this ticket. (summary updated)

Examples:

def copyToPasteboard_(self, string):
        pasteboard = NSPasteboard.generalPasteboard()
        pasteboard.declareTypes_owner_([NSStringPboardType], self)
        pasteboard.setString_forType_(string, NSStringPboardType)

@totaam
Copy link
Collaborator Author

totaam commented Jun 11, 2020

MacOS clipboard updates:

Generic clipboard updates:

  • r26680: simplify owner-changed handler
  • r26681: don't wait to send lightweight clipboard tokens
  • r26682: peers that request 'want-targets' need to be notified of owner changes as the targets are very likely to have changed with it

We should also sanitize images in both directions: #2808.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant