Bug 424063

Summary: If password has been made visible, it should be hidden again the moment the user clicks the "OK" button
Product: [Plasma] Plasma Vault Reporter: lesto <lestofante88>
Component: generalAssignee: Ivan Čukić <ivan.cukic>
Status: RESOLVED FIXED    
Severity: grave CC: nate
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.19.4
Sentry Crash Report:
Attachments: attachment-12016-0.html

Description lesto 2020-07-10 12:55:29 UTC
SUMMARY
When i want to open a Vault, I get asked for password.
Sometimes i make the password field visible, to correct some mistake.
When i click "OK", the password filed does NOT get hidden, and remain visible until it is verified as successful or wrong.  
As this process takes few seconds, any person walking by can easily peek on it, and clicking on the little eye icon will NOT hide the password while it is in verification.
While the opening take only 3-5 seconds, it has happen a colleague walked by in that moment to talk with me and i could not hide the password.

Probably this bug does not belong here, as it looks like a general issue of the widget to ask password, but i could not find a better place.


STEPS TO REPRODUCE
1. try opening a valut
2. make the password visible
3. click "ok" to open the vault

OBSERVED RESULT
the password remain visible for the whole verification process, and user has no way to hide it

EXPECTED RESULT
the password would be hidden in the moment i click "ok", eventually to became visible again if it was wrong and i can edit it (personally i would prefer it remain hidden, it may decide to show up in an inappropriate moment).
Comment 1 Nate Graham 2020-07-12 14:42:21 UTC
Seems entirely reasonable. Thanks for the anecdote that demonstrates why this is a problem!
Comment 2 Ivan Čukić 2020-07-12 15:44:54 UTC
Git commit c4932f99056ff348e354e95fcbdd1af28f25c5ef by Ivan Čukić.
Committed on 12/07/2020 at 15:42.
Pushed by ivan into branch 'master'.

Reset password field when the user clicks Ok

- Clear the password on unsuccessful vault open
- If the user clicked to show the password, it gets hidden as
  soon as Ok is clicked

M  +2    -0    kded/ui/mountdialog.cpp

https://invent.kde.org/plasma/plasma-vault/commit/c4932f99056ff348e354e95fcbdd1af28f25c5ef
Comment 3 Ivan Čukić 2020-07-12 15:46:26 UTC
Git commit 5e6a53ba55fd60ace3adbd4ca57f90a5cd44992f by Ivan Čukić.
Committed on 12/07/2020 at 15:45.
Pushed by ivan into branch 'Plasma/5.19'.

Reset password field when the user clicks Ok

- Clear the password on unsuccessful vault open
- If the user clicked to show the password, it gets hidden as
  soon as Ok is clicked

M  +2    -0    kded/ui/mountdialog.cpp

https://invent.kde.org/plasma/plasma-vault/commit/5e6a53ba55fd60ace3adbd4ca57f90a5cd44992f
Comment 4 Ivan Čukić 2020-07-12 15:47:18 UTC
The reveal button is one of the worst things that ever happened to password entry fields... Thanks for reporting this!
Comment 5 Nate Graham 2020-07-12 17:03:11 UTC
Thanks for the super fast fix!
Comment 6 lesto 2020-07-12 20:04:07 UTC
@Ivan Čukić thanks for the quick patch!!

Just want to say to me Revekl button is very nice, i use long passphrase and having to re-enter it 2-3 time became extremely frustrating.

With this fix the password field are perfect IMHO (the field will hide and remain hidden right?).

Next I will experiment using an HW wallet for password and/or decryption key.
Comment 7 Ivan Čukić 2020-07-12 20:44:13 UTC
It will hide *and* clear the field. This is to follow the new screen locker policy (or did I dream it Nate?).

Password reveal button is useful, though it kills the point of having a long passphrase :)

The main issue I have with it (apart from the over-the-shoulder ones like this bug was) is that in order to have the reveal button, the string needs to sit in memory unencrypted. If password fields were simpler (no reveal, no left-right arrow keys, no random character deletion/change), each char could be encrypted as soon as it is entered without decrypting the old ones.
Comment 8 Nate Graham 2020-07-13 16:11:25 UTC
(In reply to Ivan Čukić from comment #7)
> It will hide *and* clear the field. This is to follow the new screen locker
> policy (or did I dream it Nate?).
Nope, you're right and that's the case now. :)

> 
> Password reveal button is useful, though it kills the point of having a long
> passphrase :)
> 
> The main issue I have with it (apart from the over-the-shoulder ones like
> this bug was) is that in order to have the reveal button, the string needs
> to sit in memory unencrypted. If password fields were simpler (no reveal, no
> left-right arrow keys, no random character deletion/change), each char could
> be encrypted as soon as it is entered without decrypting the old ones.
Could we not still encrypt each character in memory but store them all in an array to preserve the above-mentioned features?
Comment 9 lesto 2020-07-13 16:15:13 UTC
Created attachment 130091 [details]
attachment-12016-0.html

Of you want to encrypt i see no need for any complication, is saving only
the hash that will make complications on editing older values.
They array of temp hash will make possible to delete right to left but not
delete/edit the middle

On Mon, 13 Jul 2020, 18:11 Nate Graham, <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=424063
>
> --- Comment #8 from Nate Graham <nate@kde.org> ---
> (In reply to Ivan Čukić from comment #7)
> > It will hide *and* clear the field. This is to follow the new screen
> locker
> > policy (or did I dream it Nate?).
> Nope, you're right and that's the case now. :)
>
> >
> > Password reveal button is useful, though it kills the point of having a
> long
> > passphrase :)
> >
> > The main issue I have with it (apart from the over-the-shoulder ones like
> > this bug was) is that in order to have the reveal button, the string
> needs
> > to sit in memory unencrypted. If password fields were simpler (no
> reveal, no
> > left-right arrow keys, no random character deletion/change), each char
> could
> > be encrypted as soon as it is entered without decrypting the old ones.
> Could we not still encrypt each character in memory but store them all in
> an
> array to preserve the above-mentioned features?
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 10 Ivan Čukić 2020-07-13 20:09:12 UTC
@Nate

Characters can't (shouldn't) be encrypted one by one.

@lestofante

Something like that could be doable with some encryption schemes.