206 points · by DVassallo · 6y ago · 93 comments
What happens if a user forgets the password? Users should always keep a copy of their password in a safe place, such as a password manager. Since the encryption key needs to be decrypted by the user's password, it is not possible to recover an account if the password gets lost.
I don't believe this is acceptable for a user authentication service. Password reset functionality must be present for this to be production ready.
Other end-to-end encrypted apps (such as password managers) have the same requirement. Sometimes the password is resettable, but you have to keep another key. But there’s always something that would lock you out if you lose it.
Yes, this is a thorny issue.
We chose to offer a service that keeps user data end-to-end encrypted by default. With that choice comes this tradeoff. And it’s a tradeoff similarly offered by practically every other end-to-end encrypted service I’m aware of.
That being said, we have plans to alleviate the weight of this tradeoff, and we’ve already written nearly all of the code. That code is pending a security review and further refinement.
The high level summary of it right now is: 1. you as the developer can opt to keep the user’s key stored in plaintext in local storage (via a single parameter passed to our signIn() method) 2. if a user forgets their password, they can get a temporary password emailed to them, then use it to sign back in 3. the user can then change their password normally
However, your customers also don't want to hear that you were hacked and all their sensitive data is now in someone else's hands. We offer easy-to-use protection from that increasingly common scenario.
You (and your customers) also presumably don't want you to break privacy law regulations storing data. We offer a super simple service that helps you there.
If you're using the user password to decrypt the encryption key, why don't you simply derive the encryption key dinamically from the password each time the user logs in? I'm thinking of an algorithm that, given a string (the user's password), constructs a given key. Something like SHA-*, but more tailored to your use case.
In this way you wouldn't need to store the encryption key anywhere, as it's dinamically generated on demand.
As per the criticism on the user losing the password, I disagree with most comments. I think that if it's made very clear to the user why there is no recovery procedure, it can be a plus, but is has to be properly explained.
Anyways, to solve this, I'll throw my 2 cents. The recovery process could be done woth a local-based (no server) Q&A process. For example, when the user creates the password it is asked to provide three security questions, and the corresponding answers. Then the questions are stored locally and the answers are used to create an encryption key to encrypt the password, which is then stored locally. If the user forgets the password, it is asked the three questions and if the answers are correct the password is correctly displayed.
Now I know that many will tell me that storing the password in a database, even though encrypted, is a bad idea. But I'll respond that we are talking in this case of storing the encrypted password only locally. This means that to stole the password one would need phisical acces to the machine, and then it would need to crack the encryption. Which at this point makes this system much more secure than most SAAS that, while encrypting very well passwords server side, do allow (for obvious reasons) the user to stay logged in. So anyone with access to the machine can access all data without further work.
The memory option does exactly what you said, derives the encryption key dynamically from the password in memory.
It's actually a bit more complex in how it works under the hood (i.e. the above isn't exactly how it works), happy to get deeper into the details :)
Note this option is provided in the form of the rememberMe parameter here: https://userbase.com/docs/sdk/sign-in/
Your Q&A scheme is also definitely a plausible backup option! Thanks for the suggestion!
Let google and Apple be your IDP provider and use the identity they provide as that key?
You can't sign in with just the temporary password. You need the key as well.
Using google or Apple like that would destroy the end-to-end encryption scheme
> The only sentence that wasn't actually a question had the only question mark?
Sorry for insulting your writing style, but this is very confusing to me on many levels, and while I've seen it elsewhere, I've never been able to ask someone why. Why are you doing this? This, of course, being "using punctuation marks in the opposite way that they're intended to be used."
Nope.
And even still, you have the choice to do this or not and we make it clear in our documentation what your choice entails. You can keep everything in memory if you want
The final user may even think wanting something like this. Until they ultimately lose their password.
Time will tell what the people want! :)
That's my idealistic way of looking at it. Practically speaking, the burden on developers to adhere to GDPR and other data privacy laws is quite high. You can use this service to store sensitive user data and relax :)
I see a lot of comments challenging the founder's choice on the trade-off "e2e encryption vs users losing their passwords", so I will explain my use case.
I am building a social network (https://www.quidsentio.com) with the idea of creating one that reduces the noisiness of current ones (that's why I am calling it a "quiet social network") and also is more privacy-oriented.
I see privacy as freedom from being observed, and I am considering three dimensions: free from being observed by strangers (you only add real friends to your network), free from being observed by companies (no ads, no tracking), and free from being observed by thieves (prepared for data breaches).
That last point is the harder technical problem to solve and Userbase seems to solve it well. As privacy is a big part of what I am building, I consider the trade-off acceptable for my product. Of course, my copy and UX will have to be especially good to not frustrate users on that end.
Still, it is a hard decision to make for a product. But the recovery after lost password option that one of the founders mentioned in one of the comments below (https://news.ycombinator.com/item?id=22145878) was decisive, so now I am pretty sure I will add e2e to my product.
Other features that make it perfect for me:
- It's a SaaS, which helps a lot a solo founder not having to build and maintain an authentication service
- It's an API, fits well my serverless architecture (I am using Netlify hosting, Netlify Functions, and FaunaDB)
- It's cheap (I am using now Netlify Identity, which is $99/month per 5,000 users after the free tier of 1,000)
So, thanks for your work, I will for sure be a happy customer, and I am more excited to make this bet that privacy is/will be something that matters for all people, not just worried developers
Thank you!
Rather than using something like libsodium's public-key box API, which is wonderful, it's using a 2048-bit Diffie-Hellman Prime group. This isn't really great. You should definitely upgrade to more modern primitives. I can highly suggest libsodium as a drop-in replacement.
The other thing about this that's more concerning is that I have no idea if there is any validation going on to prevent small subgroup confinement attacks on this, but I don't really want to spend anymore free time checking this out and I'll leave it as an exercise for the reader/author.
Personally, I wouldn't use this product until a few cryptography design decisions were changed. If you're marketing this as a privacy-centric product, there's a lot of work to be done--not just on the Diffie-Hellman usage.
0. https://github.com/encrypted-dev/userbase/blob/master/src/us...
We also discussed using a modern asymmetric key algorithm. We decided on Diffie-Hellman because we were extremely confident it's secure (so long as we choose the right parameters and implement it correctly), and would be very simple to fit it into our architecture.
seems like it'll break on firefox now.
https://github.com/crypto-browserify/diffie-hellman/blob/mas...
If I build a prototype on this, and get some users - is there a path to migrate their accounts and data to a new backend in the future?
This solution is perfect for an application that's targeting privacy focused users. I often don't sign up for services these days because I don't care for the possibility that the maintainer of the site is just casually reading through my data.
Some great use cases could be journaling, note taking, a private wiki, etc. For note taking, I actually use Standard Notes (https://standardnotes.org/) precisely because of its end to end encryption.
For me the lack of password reset is a non issue (especially with modern password managers), something that I gladly trade for the peace of mind that some random developer with database access isn't reading through my private stuff. Obviously if you built something on top of this, you would need to properly educate your users on the tradeoff they're taking.
I'm surprised they don't use Userbase account for their own website.
- An end-to-end encrypted database.
- Super simple SDK.
- 100% open source, MIT licensed. Both the backend and SDK.
EDIT :: Oh I just saw the Pro Plan plan in your tweet https://twitter.com/dvassallo/status/1216612542052589569
on a more meta level, since you're so open anyway, might want to look into public feature voting/roadmaps.
congrats on launching! you know i'm a fan of your work. I don't have a particular use for this product as is right now but gh and twitter logins would actually change my calculus (haha i know this is the annoying user stereotype of "i wont use this unless i have x")
And thank you!
I am not a front-end preson, but I run a static Jekyll blog hosted on GitHub. I don't want to miss the zero maintenance (!) ease of deployment and network-performance of the GitHub CDN, but I have been missing some dynamic features. Most notably:
1. A view counter per page
2. Comments
3. Signup for Newsletter Form
Since the GDPR landed, I have removed my Google Analytics and Disqus plugins. And I am happy with that. No reason to leak PII to third parties, that I can't trust anymore.
Is that a use case you want to be supporting on your platform? Looks like, this should not be hard to build with your SDK.
Best regards, Heinrich
If you have a todo app, the user can log in and see and modify their todos but there would be no way for them to share their todos.
There is no shared access to a modifiable store which I believe would be necessary for the view counter, comment, and signup use cases.
To give an example: The indiehackers website uses firebase as its data store. It's a blog/forum, so posts and comments made by individual users can be seen by people who don't have accounts. Is this a use case you plan to support in the future?
If not, the potential use cases are much narrower than firebase. Not necessarily a bad thing but I'm just trying to understand the product.
Compared to Parse, we offer a simple SaaS product.
Compared to Firebase, we have a much simpler pricing structure.
Considering how early on we are, we also have the benefit of being much simpler to start using (fewer features/options to wrap your head around and configure) :)
- User data is end-to-end encrypted.
- Super simple SDK.
- Predictable pricing. (You won't need a cost calculator.)
- 100% open source, MIT licensed.
Really cool otherwise, I may use this for something. Great work!
We’re not metering storage yet, so nothing will happen right now. Soon we’ll have another pricing plan with metered storage, and people who happen to be exceeding the limit will be given the choice to upgrade to unlimited metered storage (ala AWS).