News for hackers. Stuff that matters.
Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by lazyjones on Friday March 13, 2020 @06:18PM (#22571365)
Is there a MacOS utility that clears the pasteboard N minutes after its last content change?
Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by ken on Friday March 13, 2020 @11:58PM (#22573082)
Not efficiently. There's no "clipboard changed" notification on macOS.

Such a utility would have to run in the background and constantly query the clipboard. And since the clipboard basically holds a list of types and a way to ask the owning application for data, you'd have to keep waking up the clipboard owner, too, to ask it for data. Would you check every type it declares? Some applications support dozens of types.

Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by nicky0 on Saturday March 14, 2020 @12:20AM (#22573153)
You can poll the changeCount property to quickly check if the clipboard has been updated.

You would not need to constantly wake up the clipboard owner. To “clear” the clipboard you just upload a new clipboard with an empty string.

Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by ken on Saturday March 14, 2020 @09:35AM (#22575167)
That would be cool, if true. It was not clear to me from the documentation that this number is guaranteed to increment whenever the contents change.

The value is described as counting "pasteboard ownership changes", and its use is to "determine whether you still have ownership". -clearContents doesn't say anything about necessarily changing it if you were already the owner, though that does seem to be the behavior today.

I suppose this could be one of those cases where we can go by what it actually does, not just what the documentation says it does. I hate doing that, because it has a way of coming back to bite me.

Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by kevsim on Saturday March 14, 2020 @04:45AM (#22574013)
Never seen a general purpose utility for this, but some apps clean up their own content. For example, 1password copies your 2FA codes automatically to the clipboard when you log in and then clears them out after a few seconds.
Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by andrekandre on Friday March 13, 2020 @08:35PM (#22572066)
not sure, but i do seem to remember that passwords copied from the “passwords” screen in system preferences get removed after a minute or so... so that functionality seems to exist in some form... (if i am remembering correctly that is)
Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by bigiain on Friday March 13, 2020 @09:50PM (#22572503)
1Password does this as well.

I just looked on iOS, it’s got an option to “clear clipboard” which says “Clears any item copied from 1Password to the clipboard after 90 seconds”

I notice that occasionally, but it seems to be a reasonable compromise of security over annoyingness, in the absence of proper access controls to the clipboard contents...

Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by xenadu02 on Friday March 13, 2020 @10:35PM (#22572705)
Having a "password" pasteboard might not be a bad idea. Disallow reading its contents except by built-in system password input fields.
Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by saagarjha on Saturday March 14, 2020 @02:03AM (#22573515)
Of course, this only solves the problem for passwords.
Re:Popular iPhone and iPad Apps Snooping on the Pasteboard by tinus_hn on Saturday March 14, 2020 @06:09AM (#22574300)
Unfortunately the number one use case is the browser which doesn’t use these.