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

Delete E2EE keys for fresh start #9083

Closed
unteem opened this issue Apr 5, 2018 · 17 comments
Closed

Delete E2EE keys for fresh start #9083

unteem opened this issue Apr 5, 2018 · 17 comments

Comments

@unteem
Copy link

unteem commented Apr 5, 2018

What is the clean way for a fresh restart when a user lost his passphrase and device?

We are not trying to recover any data, we just want the user to be able to reuse the E2EE module.

Steps to reproduce

We have 2 cases:

  1. iOs app crashed before the user cloud enter passphrase
  2. User formated his device and all his passwords

Expected behaviour

We want them to be able to reinitialise the E2EE. No data or passphrase to recover, just a fresh new start

@MorrisJobke
Copy link
Member

@tobiasKaminsky
Copy link
Member

To circumvent case 1, we on android store the keys only after the user noted down the passphrase.
Case 2 should also not affect it, as the key is also stored encrypted on server, so you only have to enter the passphrase.

If you really want to reset E2E, there is currently only a manual way:

  • go into app folder on server side, then end_to_end_encryption, remove the sure in question
  • log into mysql and "DELETE FROM oc_filecache WHERE name like '%$USER%';"
    (please do a backup first)

@jospoortvliet
Copy link
Member

jospoortvliet commented Apr 6, 2018

@unteem this is not possible, by design, as it would allow posing as a user by a hacker. As all other accounts the user shared with will trust the user key on first use, they will reject any new identity from that user. So even if you created a new set of keys with a new passphrase, it would be useless.

If you lose your passphrase and device, you have to create a new account. There is no real way back.

The work-around by @tobiasKaminsky will be OK until we implement sharing: your user account will never be able to share with a user it shared with before, so we won't implement a feature to 'reset E2EE'.

Of course, we could, at some point in the future, go the Signal way of just adding new identities with TOFU but I think it is a security risk - users click away the warning that another user has a new digital identity and can thus easily be duped into sharing files with a hacker. This is the whole thing E2EE is designed to protect from...

The case of the iOS app crashing after creating an identity is a different issue, but that should be solved the right way: the app should always be able to show the passphrase. This is explicitly called for in the design, and the fact that that is not yet implemented means the app isn't yet ready to be really used with E2EE.

@ediazcomellas
Copy link

Reseting E2E keys is a feature that will be needed from time to time because, you know, shit happens and users usually forget passwords and everything else. I would expect that reseting E2E keys will cause users to lose access to the encrypted files, but nothing more.

@jospoortvliet
Copy link
Member

@ediazcomellas yes, we discussed this, and I entirely understand.

The problem is that without a trusted separate key generation mechanism (a HSM or hardware security module) this creates a security breach.

So, either have a HSM, or you will need to create a new account when the keys get lost.

In discussion with our customers I found out they were fine with this - of course, those who need it don't mind using a HSM and those who don't need it are happy to shortcut calls to their service desk by just telling people: "We can't do anything. Don't lose the keys, or we can only create a new account for you."

The TU Berlin for example prefers to say "nothing we can do" over having a reset option, because that will increase the number of calls and the amount of work as users will be less careful.

Your situation might be different - and a HSM might be required. We have not yet implemented this. If you need this in the short term, you can contact our sales team...

@Alphakilo
Copy link

@jospoortvliet I'm afraid this approach just isn't feasible with external authentication (LDAP, AD, ...).
While I do see that having an escrow key to do a full recovery of seemingly end-to-end encrypted files is a major security issue and a breach of trust on top, I don't see why either an escrow key or HSM should be needed to completely reinitialize encryption keys for a user.

There ought to be an administrative command to do just that. Having to create a new LDAP / AD object isn't an alternative.

Somewhat off topic:

[...] are happy to shortcut calls to their service desk by just telling people: "We can't do anything. Don't lose the keys, or we can only create a new account for you."
The TU Berlin for example prefers to say "nothing we can do" over having a reset option, because that will increase the number of calls and the amount of work as users will be less careful.

This is a very hostile mindset, straight out of the '80s. IMO this sentiment reflects very badly on our line of business. It has no place near service desks and it should absolutely not affect software projects that care about UX and usability in any way, shape, or form.
Having it echoed by a "people person and all-things-open evangelist" makes me cringe.

@ph00lt0
Copy link

ph00lt0 commented Dec 30, 2020

Nextcloud client crashed during end to end setup of one of my clients. Now he is unable to setup encryption because you cannot initiate a fresh start. This is really a missing feature @jospoortvliet. There would not be a problem if you could reset the end to end encryption and wipe previous keys.

@JasperCiti
Copy link

JasperCiti commented Jan 25, 2021

Another scenario I discovered the hard way is. If you install the Nextcloud desktop client on Linux it does not provide an option to write down the passphrase but it does create a key. If you go to Windows (or any other client) it prompts to enter a passphrase which I never got. Now I probably need to delete all those accounts and recreate them again starting at Windows this time.

@KopfKrieg
Copy link

Now I probably need to delete all those accounts and recreate them again starting at Windows this time.

You don't have to delete the accounts. Just reset the E2EE app, and then either wait until it's stable or try it again.

Here's how to reset it: https://github.com/nextcloud/end_to_end_encryption/releases/tag/v1.5.2-beta1

@ph00lt0
Copy link

ph00lt0 commented Jan 25, 2021

@KopfKrieg this is not a viable solution for most people, this would delete the keys for all users, also ones that already use the E2EE solution with success.
Honestly I really do not understand why this has not been considered. Adding a feature to reset the E2EE for a single user shouldn't cause any security issues and would solve all of the above.

@KopfKrieg
Copy link

KopfKrieg commented Jan 25, 2021

@KopfKrieg this is not a viable solution for most people, this would delete the keys for all users, also ones that already use the E2EE solution with success.

Well, it's possible to only delete the keys for certain users as I've shown in my blog (right now only available in German): https://kopfkrieg.org/2019/05/28/nextcloud-reset-e2ee/

Edit: Found the original link: nextcloud/end_to_end_encryption#32 (comment)

Honestly I really do not understand why this has not been considered. Adding a feature to reset the E2EE for a single user shouldn't cause any security issues and would solve all of the above.

That would be a good feature.

@mjeshurun
Copy link

Now I probably need to delete all those accounts and recreate them again starting at Windows this time.

You don't have to delete the accounts. Just reset the E2EE app, and then either wait until it's stable or try it again.

Here's how to reset it: https://github.com/nextcloud/end_to_end_encryption/releases/tag/v1.5.2-beta1

I also made the stupid mistake of enabling and then disabling end-to-end encryption without properly saving the passphrase.
@KopfKrieg can I trouble you and ask how I can find the end_to_end_encryption folder?
I cannot find the "appdata_..." folder mentioned in the link you included.
I'm running Nextcloud on a Raspberry Pi 4 installed using NextcloudPi's curl command.

@KopfKrieg
Copy link

I cannot find the "appdata_..." folder mentioned in the link you included.
I'm running Nextcloud on a Raspberry Pi 4 installed using NextcloudPi's curl command.

IIRC NextcloudPi uses a directory below /var/www. The appdata_<instanceid> folder is usually in your nextcloud-root/data/ folder.

Hope that helps :)

@ph00lt0
Copy link

ph00lt0 commented Aug 13, 2021

I don't understand that this is still closed. It should be possible to reset the keys from the interface.

@bcutter
Copy link

bcutter commented Apr 3, 2023

Copy that. E2EE screwed up (again) today as it always does from time to time. Using E2EE is just so frustrating... 99 days working perfect, day 100 everything is broken. Complete reset necessary.

Update: seems like desktop client (v3.8.0) screwed up E2EE.
nextcloud/desktop#5564

@gunchev
Copy link

gunchev commented Apr 24, 2023

I enabled this yesterday but decided to postpone for tomorrow because I was getting too sleepy. There was an easy option to disable/disconnect/whatever. Today I figure out it is "too late". Every user that tries to use it and screws something up will need new company wide account.

@ph00lt0 ph00lt0 reopened this Apr 24, 2023
@mgallien
Copy link
Contributor

mgallien commented Oct 5, 2023

this is already implemented in recent releases
no need to have it open as it is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests