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

Clipboard: Add option to block proxying of passwords #1894

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ferdnyc
Copy link
Member

@ferdnyc ferdnyc commented Nov 28, 2024

Since some password managers set a clipboard mimetype to signal when the clipboard contains password data, ignore the clipboard contents in those cases, to avoid exposing passwords over the link to the mobile device.

Fixes: #1893

TODO

  • Make it optional
  • Turn it off by default

Since some password managers set a clipboard mimetype to signal
when the clipboard contains password data, ignore the clipboard
contents in those cases, to avoid exposing passwords over the
link to the mobile device.

Fixes: GSConnect#1893
@ferdnyc ferdnyc added the security Encryption, Privacy or other data exposure label Nov 28, 2024
@daniellandau
Copy link
Member

As I wrote in the linked issue, I feel copying passwords is a valid use case and IMO it shouldn't be blocked by default.

@ferdnyc ferdnyc marked this pull request as draft December 1, 2024 18:56
@ferdnyc ferdnyc changed the title Clipboard: Block proxying of passwords Clipboard: Add option to block proxying of passwords Dec 1, 2024
@ferdnyc
Copy link
Member Author

ferdnyc commented Jan 12, 2025

Heh. I happened to install KDE Connect on my laptop's Plasma session today (looking at some craziness in Messages, where the Android app seems to be sending nonsense to GSConnect — I want to see how they handle it), and sure enough, in the clipboard-sharing preferences:

Screenshot_20250112_054935

@ferdnyc
Copy link
Member Author

ferdnyc commented Jan 23, 2025

So, this becomes tricky because of the separation between our backend clipboard watcher (the component responsible for watching and updating the local desktop clipboard), and our clipboard plugin that runs for each connected device, interfacing between the backend and its paired device's network connection.

The way GSConnect's preferences work, with only one or two exceptions settings apply to plugins, and for the most part are per-device. Which means the decision about whether to send any given clipboard string to a paired device is made by the plugin based on its current settings. But in our current architecture, the only thing the plugin ever sees from the backend is a piece of string data — it has no way of knowing if that string represents a password. The mimetype data we're looking at to detect passwords on the clipboard is only accessible from the backend.

So, I think I'm going to have to go a route similar to what KDE did in their own Linux implementation: Have the backend assign a "content type" to each clipboard string it captures, indicating whether it's a password, a (presumed) non-password string, or... well, at least for now, those are the only two choices. content-type would be an additional backend property, to go with the existing text property that holds the clipboard string.

Whenever the plugin gets notified that the backend's text property has been updated, it can first look at the backend content-type property. If it sees "password", the plugin decides (based on its security setting) whether or not it should grab text and send it to the paired device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Encryption, Privacy or other data exposure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent Sending Passwords from the Clipboard
2 participants