core icon indicating copy to clipboard operation
core copied to clipboard

Password reset leads to an error on recovery password

Open etiess opened this issue 12 years ago • 6 comments

Steps to reproduce

  1. A user forgets his password
  2. He clicks on the link provided to reset a forgotten password (on the login page)
  3. He clicks on the link provided in the received email
  4. He sets a new password

Expected behaviour

Everything should work fine, including the recovery key. This recovery key should have been updated with the new password.

Actual behaviour

An error message appears: the user's recovery key is now different from the login password. The administrator should recover the data.

Solution (but not satisfying): the administrator sets a new password for the user. The user changes this password in his Personal page. The recovery key seems to be updated too.

I looked for a similar issue, but I didn't find it. I just saw https://github.com/owncloud/core/issues/10353 . I can't remember if it was the same with forgotten password, but I totally agree with @awnz

Server configuration

Operating system: Ubuntu 14.04

Web server: Apache

Database: MySQL

ownCloud version: (see ownCloud admin page) 7.0.2

Updated from an older ownCloud or fresh install: No

Are you using encryption: yes

Client configuration

Browser: FF 31

Operating system: Windows 8.1

etiess avatar Oct 20 '14 08:10 etiess

Some information from the owncloud log. Bob is the user who changed his forgotten password:

Error    Encryption library  Private key for user "bob" is not valid! Maybe the user password was changed from outside if so please change it back to gain access    2014-10-19T15:45:08+00:00
Error   Encryption library  Private key for user "bob" is not valid! Maybe the user password was changed from outside if so please change it back to gain access    2014-10-19T15:32:18+00:00
Fatal   files_encryption    set shareFileKeyFailed (code: 10): Cannot mutliKeyDecrypt empty plain content   2014-10-19T09:18:15+00:00
Error   Encryption library  Private key for user "bob" is not valid! Maybe the user password was changed from outside if so please change it back to gain access    2014-10-19T08:59:06+00:00
Error   Encryption library  Private key for user "bob" is not valid! Maybe the user password was changed from outside if so please change it back to gain access    2014-10-18T10:16:51+00:00
Error   PHP Undefined offset: 0 at /var/www/owncloud/lib/private/share/mailnotifications.php#90 2014-10-18T09:30:04+00:00
Error   PHP Undefined offset: 0 at /var/www/owncloud/lib/private/share/mailnotifications.php#90 2014-10-18T09:30:01+00:00
Error   PHP openssl_open(): unable to coerce parameter 4 into a private key at /var/www/owncloud/apps/files_encryption/lib/crypt.php#470    2014-10-18T09:29:55+00:00
Error   Encryption library  Private key for user "bob" is not valid! Maybe the user password was changed from outside if so please change it back to gain access    2014-10-18T09:29:31+00:00
Error   Encryption library  Private key for user "bob" is not valid! Maybe the user password was changed from outside if so please change it back to gain access    2014-10-18T09:27:05+00:00

etiess avatar Oct 20 '14 08:10 etiess

The following appeared before the admin set a new password:

I just remarked that when this user "Bob" shared a folder with me (I'm on the same OC), the email I received had an error. It was in french, but the message was something like "Just to inform you that Bob shared ' ' with you" and the name of the folder was empty (while the real folder was something like 'Jump').

In addition, one file in this shared folder was not available for me. When I tried to open it on the web interface, an error message asked me to contact the admin in order to fix it. I synced this folder with Mirall on my laptop, and this file was empty (0 kb).

The following appeared after the admin set a new password. And the user Bob changed it in his Personal page:

The file was readable on the web interface. But it was not updated on my laptop by Mirall. Even when I close mirall, and restart it. Even when I put the sync of this folder in "Pause" mode (idle in english?), and start it again. So I decided to delete this sync, delete the folder locally, and reset the sync. Now everything is working properly.

etiess avatar Oct 20 '14 09:10 etiess

Solution (but not satisfying): the administrator sets a new password for the user. The user changes this password in his Personal page. The recovery key seems to be updated too.

But that's the solution. The only way you can decrypt your files is your private key and therefor your login password. If you lose your login password then there is no way for you to decrypt your files again. That's the whole purpose of encryption, only the people who know the password can access the files. To use the recovery key to gain access to your files again you need the password of the private recovery key. If everyone can access it the whole encryption would be pointless. This password is only known by the admin, so he needs to recover your files.

The sync client doesn't resync the files after password reset because this doesn't alter the files.

schiessle avatar Oct 20 '14 10:10 schiessle

@schiesbn Thank you for your quick answer and your explanation.

But I don't agree with you: what's the point to offer a password recovery process to the user if he cannot access his file again? I understand this is a choice of architecture, with 2 possible solution if the user loses his password:

  1. There is a password recovery process, and the user gets a full access to his files at the end of it
  2. OR there is no password recovery process, and the user gets a message mentioning that he should contact the admin to recover access to his files

But in my opinion, there shouldn't be both solution because the first one is not satisfying for the user. I don't know any web service where I cannot recover a full access to the service after a password recovery process.

Concerning the sync client, it actually should have resynced the files because they were not available (size = 0kb) before the admin reset the password. And after this reset, the files should have been resynced (they are now available on the web interface).

etiess avatar Oct 20 '14 12:10 etiess

But I don't agree with you: what's the point to offer a password recovery process to the user if he cannot access his file again?

There are multiple reasons:

  • It could happen that you forget your password but know it is stored in your password safe at home or it is weekend and you can't reach your admin. Still you need to access your calendar, contacts, etc. now. So you reset your ownCloud password to get access to your ownCloud expect your files. If you come back home you can ask the admin to recover your files
  • You don't have a recovery key, so you have to accept that your files on the server are lost. In this case you can reset your password and upload the files again from your backup or from the local version created by the sync client.

In the past the recovery page showed a warning explaining what will happen. This was removed because it was considered to be to alarming. Now there is work on bringing a notification back, see https://github.com/owncloud/core/issues/11438

schiessle avatar Oct 20 '14 13:10 schiessle

Thank you very much for your nice and clear explanation. I really think that this notification should be brought back ;) I'll follow #11438

I think that this should be explained in the documentation too: the actual version mention that the admin can restore the files, but it's not as clear as your explanation ;) If nobody else does it, I'll do it as soon as the notification is back.

etiess avatar Oct 20 '14 13:10 etiess