A background task should clear the device’s clipboard after X seconds whenever the clipboard text still matches the value that was originally copied.
NOTE: I’m not sure if this is possible to do in the browser extensions due to clipboard API restrictions in the browser. Therefore I have not tagged it for this feature request.
About your question, yes, that’s possible. At least in Chrome. LastPass works that way. Not so sure what API they are using, but it’s certainly possible. Or else you could just attach a binary in order to complement that.
Don’t forget to make the countdown timer customizable, ok?
Maybe simply filling the clipboard with blanks would work, or writing another randomized string there , or simply “clearedbybitwarden” , of course on Desktops like KDE/Plasma you’d need to disable the clipboard history in that case
I thought to do it also, but if done this way, it will cause other undesired consequence: overwrite another new clipboard content the user just put there after using the password.
So, the bitwarden app/extension must check the clipboard content before overwriting it.
This is a good idea, but it’s probably not possible to do this atomically - this means there’ll be a small race condition where very occasionally this will still clear new clipboard content.
Looking at https://developer.android.com/guide/topics/text/copy-paste#ClipClasses I see you can store an intent instead of text. I don’t know the details of how intents work but perhaps it’s possible to use an intent instead of plain text and do something cleverer like storing a reference to the password and timing out its access.
Yes Yes and Yes ! This is highly needed to avoid any mis-paste password.
Desktop requirement suggested
At timer’s end :
Check content of clipboard or salt of it (if that is something the API does)
If Clipboard ID (or content) is from bitwarden -> replace by a random String (not to just clean it as this could be an indicator when spoofing clipboard data and not easy to diagnose if people come with a “bug” that clipboard is empty when pasting :)/ pasting do not work !)
If clipboard ID (or content) is not from bitwarden. -> Write in debug that clipboard as been replaced.
Options suggested
Customization time before clearing
Activate or deactivate such feature - Per app / extensions
A general master Switch in the Web App to force on or off on ALL other app/extensions (important for enterprise :))
Tips :
No idea on other systems but on Windows there was the GetClipboardSequenceNumber() method that give you a Number and hat is auto-incremental. checking this is WAY MORE efficient than checking the content
Concerns :
Possible issue when checking content instead of Clipboard ID is that people sometimes copy-paste the same content - not ideal behavior but people do it. As the clipbaord have been replaced (even if the content is exactly the same) that should not be cleared as it falls out of Bitwarden app responsibility
1 password has something similar with totp codes, where they get automatically put into your clipboard when you autofill & submit a password, and then restore your clipboard contents after a timer.