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

Android clipboard is vulnerable to hijacking #50

Closed
emilecantin opened this issue Dec 4, 2014 · 20 comments
Closed

Android clipboard is vulnerable to hijacking #50

emilecantin opened this issue Dec 4, 2014 · 20 comments

Comments

@emilecantin
Copy link

As evidenced here, it is apparently possible for any app on the device to listen for changes on the system clipboard and to get its contents.

Another password manager, Keepass2Android, implements a keyboard to get around this problem. I think we should do the same.

@zeapo
Copy link
Contributor

zeapo commented Dec 4, 2014

Thanks for the info. However, I do not see the link between a keyboard and the clipboard. Do you mean they implemented an android keyboard app that recovers the passwords from the app?

@emilecantin
Copy link
Author

The app implements an Android keyboard, which is available as an input method (it is not a separate app, it is bundled with the app). Usually, this is a regular keyboard (a bit shitty, however), but when there is an entry being displayed inside the app, the keyboard transforms and only has 2 buttons: username and password.

@zeapo zeapo added this to the Stable v1.2 milestone Dec 8, 2014
@zeapo
Copy link
Contributor

zeapo commented Dec 8, 2014

This should be feasible. I've read some papers that confirm the problem you mentioned earlier. In v1.2.0.9 the copy on decrypt will be disabled by default.

@bugabinga
Copy link

Would that mean users have to permanently use this keyboard? What if they like 3rd party keyboards?

On the other hand, if users have to manually switch their keyboards back and forth just to copy a password, I'd consider this a problem.

@emilecantin
Copy link
Author

In keepass2android, you can either use their keyboard full-time (I didn't), or I could switch keyboards when filling login forms. I agree that this is a bit of a usability problem, but Android 5.0 makes it relatively easy.

Also, it seems that LastPass implements uses the new accessibility APIs on Android 5.0 to auto-fill forms in other apps. That may be another avenue.

@bugabinga
Copy link

There is also the question of why this is an issue at all. On the desktop for example, I imagine this to be equally possible to monitor the Clipboard (in fact, I rely on it for the GNOME Clipper extension). Keepass, Pass and co however, are storing into the clipboard nonetheless.

@emilecantin
Copy link
Author

I agree, it is also an issue on the desktop. To avoid this, Keepass implements an auto-type functionality, and LastPass & co use a browser extension to auto-fill login forms.

It is true that it is often more convenient to use the clipboard, but it may be pertinent to have an alternative solution.

@smblott-github
Copy link

Keepass, Pass and co however, are storing into the clipboard nonetheless.

Agree. This is not such a big issue for me.

@bugabinga
Copy link

Keepass and Pass are restoring the clipboard after some seconds. Would this make it more secure? I fail to see how, but maybe?

@zeapo
Copy link
Contributor

zeapo commented Dec 17, 2014

We already clear the clipboard after a few seconds.
The keyboard solution, it does seem like a bad idea for the users. Maybe going through accessibility service (https://developer.android.com/guide/topics/ui/accessibility/services.html) might be good idea for a future feature.

@bugabinga
Copy link

Accessibility actions do indeed seem to provide a facility to auto-fill some values. But I don't think it would be worth the effort. Consider these problems for example:

  • How is this auto-fill initialized?
  • How does pwd pick the right password/user, especially in a browser?
  • How does pwd find the right data in the unstructured form that pass allows?
  • What is the fallback if all this complicated stuff fails?

Maybe it is more worthwhile to investigate how to make using the Clipboard safer? For example, how about to overflow the Clipboard with random information in order to decrease the likelihood that a sniffer can match username and password?

@zeapo
Copy link
Contributor

zeapo commented Dec 17, 2014

I agree that we need more investigation. Putting garbage in the clipboard and ending with the password is a good idea indeed.

  • For the two first questions, we can use the intent system. When the user wants to fill a password the application pwdstore launches, the user selects which password to decrypt and on result fills the data in the focused field in the current view.
  • Pwdstore uses exactly the same behaviour as pass, ie. we only get the data set as password and not the extra information.
  • The fallback is the classical copy/paste. This will not be removed.

@bugabinga
Copy link

@zeapo Using the intent system seems to make this feasible imo. Somehow when I thought "auto-fill" I assumed fully automated ;). I am still unclear though how pwdstore would get the username. The password is ,as stated in Pass docs, always first line of decrypted file. The file name could be anything. Domain name, username, some arbitrary reminder label...

@zeapo
Copy link
Contributor

zeapo commented Dec 17, 2014

We will (for the moment) keep exactly the same behavior as pass. The username is up for the user to write it down.

However, in a near future, we are looking into improving the way the extra-information is displayed by adding some meta-data describing the content. For instance:

<mypasswordhere>
# Form
username: <myusername>
url: <websiteurl>
# End Form

(just an idea)

We could then have a semi-automated service. It will also improve the output of the extra-information when we decrypt the password.

@bugabinga
Copy link

Sounds good, I suggest opening a new issue for metadata.

What about this issue now? Postponed? Closed?

@wongma7 wongma7 mentioned this issue Aug 12, 2015
@c4software
Copy link

Hi,

Its a nice implementation, but if (like me) you use Password Store in a Chrome context, its seems not working (because its a Website not an app). The idea of an input method is still not an option ?

[Edit] I have just seen the todo, nevermind great if its still something to implement.

@wongma7
Copy link
Contributor

wongma7 commented Sep 28, 2015

It is still a possibile option I think. I believe in the latest versions of Android switching keyboards is more convenient and usable too. I'll work on it but no eta

@polyzen
Copy link

polyzen commented Nov 7, 2015

In kp2a(keepass2android), you can have it automatically switch to the kp2a kb and back (doesn't seem to work inside terminals, but eh).

Also, pass uses "username" as the standard field. passff uses "login", but that's configurable iirc

@ghost
Copy link

ghost commented Nov 8, 2015

When using autofill, does it utillize the clipboard? It requested some sort of permisson for autofill so I assumed this was some sort of android 5.0 feature that circumvents the need for the (insecure) clipboard

@zeapo
Copy link
Contributor

zeapo commented Nov 6, 2016

Autofill does not use the clipboard and the recently added share button allows to share the password in clear text to another app if needed.

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

7 participants