As far as I know, there should be a way so that the clipboard data is only provided to the app when it is user initiated. My question is: does iOS actually allow any app to look at the clipboard's data even when it is not user initiated. Is it a fact, or is it not?
3 Answers
The whole purpose of clipboards is that apps can read from it and write into it. Usually this happens due to a copy/paste request by the current users, but there are apps (e.g. Podcast apps or browsers) which peek at the clipboard to see whether it is in a any form actionable by the app (e.g. if it is an URL). And there are, as recent news show, apps which seem to peek into the clipboard to grab data, passwords etc.
If you are curious about how code to access the clipboard can look like, https://stackoverflow.com/questions/41452868/reading-from-the-clipboard-with-swift-3-on-macos gives some examples.
-
1One wonders why it's not possible to restrict clipboard access to specific applications Commented Jul 6, 2020 at 13:38
-
1@SkeletonBow It is possible :-) The theoretical discussion on this is on apple.stackexchange.com/questions/395254/…– nohillside ♦Commented Jul 6, 2020 at 14:27
iOS supports not only the general clipboard (technically, the general UIPasteBoard), but also named UIPasteBoards.
As the Apple docs explain regarding named UIPasteBoards:
You can create named pasteboards with the class methods init(name:create:) and withUniqueName() for sharing data within your app and from your app to other apps that have the same Team ID.
Apps that want to better protect data that users may have pasted into the clipboard, would use named UIPasteBoards rather than the general one, to prevent any random app from accessing its contents.
Theoretically, on a jailbroken device, other apps may still be able to gain access even to your app's named UIPasteBoard, so the app may still want to implement other measures like encrypting data before transferring it to the clipboard (whether general or named UIPasteBoard).
There's a longer answer but the short answer is yes. Any running app can access the clipboard.
-
This is a short answer that's missing a lot of details supporting your statements. It would help eliminate downvotes if you provided supporting info or something in addition to the answer already provided.– fsbCommented Jul 9, 2020 at 19:23