Skip to content
This repository has been archived by the owner on May 27, 2019. It is now read-only.

With store locked, selecting copy user|pass does not successfully copy after decrypting #241

Closed
jangari opened this issue Mar 28, 2018 · 3 comments

Comments

@jangari
Copy link

jangari commented Mar 28, 2018

General information

If my password store is in a locked state, selecting the copy password or copy username options, then after being prompted to decrypt, the password or username is not copied to the clipboard and I have to re-search and re-select copy to copy it to the clipboard.

I would expect that after decrypting the entry, the copy command would be issued.

This does not correspond to the behaviour for sites which are found by browserpass; when I try to auto-enter the credentials with the store locked, then after decrypting the entry the credentials are passed automatically without me having to select the entry again.

  • Operating system + version: Mac 10.12.6 (Sierra)
  • Browser + version: Chrome 65.0.3325.162
  • Information about the host app:
    • If installed via package manager or downloaded from releases page, put a version: 2.0.17
      • In the recent versions it can be obtained with $ browserpass -v.
      • If in doubt what version you have, download and re-install the latest version!
    • If built from sources, put a commit id ($ git describe --always):
  • Information about the browser extension:
    • Browserpass extension version as reported by your browser: 2.0.17

Exact steps to reproduce the problem

  1. Have a locked password store
  2. Search for an entry
  3. Click key icon to copy password
  4. Enter GPG key to decrypt
  5. Paste the password from the clipboard

What should happen?

Password from the selected entry should be pasted and should be on the clipboard.

What happened instead?

Clipboard is unchanged. To successfully copy the password, repeat steps 1, 2 and 4 above.

@maximbaz
Copy link
Member

Thanks for reporting, I had a suspicion that we had this issue, but never got a chance to confirm.

Filling passwords works because it was intentionally implemented in #119, I think re-using the same approach will do the trick here too. I'll have a look 🙂

@maximbaz
Copy link
Member

This is caused because the code that copies the text in clipboard is located in the popup, once popup is closed, everything is stopped.

I tried a few approaches:

  • Inject a script to the currently active tab and copy from there:
    • Doesn't have clipboard permission, so nothing is being put to clipboard
    • Also we are potentially leaking credentials to a wrong website, not cool
  • Copy to clipboard from the background page:

Ended up with the following approach in b717a5c:

  • First try to copy from the popup, as before (this works in all browsers)
  • If popup was closed (e.g. by pin entry dialog), instead copy from the background page (this works in Chrome).

That way, this works as expected in Chrome and cannot be implemented in Firefox. Sorry, Firefox users.

maximbaz added a commit that referenced this issue Mar 28, 2018
@jangari
Copy link
Author

jangari commented Mar 29, 2018

Thanks! Woke up this morning to find the new behaviour! Shame about Firefox users though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants