Review FxA client-side key stretching parameters
Categories
(Cloud Services :: Server: Firefox Accounts, defect)
Tracking
(Not tracked)
People
(Reporter: rfkelly, Unassigned)
References
Details
(Keywords: sec-want)
Reporter | ||
Comment 1•8 years ago
|
||
Reporter | ||
Updated•8 years ago
|
Reporter | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Reporter | ||
Comment 4•8 years ago
|
||
Comment 5•8 years ago
|
||
Reporter | ||
Comment 6•8 years ago
|
||
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
Comment 9•8 years ago
|
||
Reporter | ||
Comment 10•8 years ago
|
||
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
Reporter | ||
Comment 13•8 years ago
|
||
Comment 14•8 years ago
|
||
Reporter | ||
Updated•8 years ago
|
Comment 15•7 years ago
|
||
Updated•7 years ago
|
Comment 16•7 years ago
|
||
Reporter | ||
Comment 18•7 years ago
|
||
Comment 19•6 years ago
|
||
Reporter | ||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Reporter | ||
Comment 25•6 years ago
|
||
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
Comment 29•6 years ago
|
||
Comment 30•6 years ago
|
||
Comment 31•6 years ago
|
||
Comment 32•6 years ago
|
||
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
Reporter | ||
Comment 35•6 years ago
|
||
Comment 36•6 years ago
|
||
Comment 37•6 years ago
|
||
Reporter | ||
Comment 38•6 years ago
|
||
Comment 39•6 years ago
|
||
Comment 40•3 years ago
|
||
Hi,
Is that issue resolved ? I can read an update on Master password in Firefox or Thunderbird? Do not bother! that say weakness is resolved since Firefox 72 ?
Thanks.
Comment hidden (off-topic) |
Comment 42•3 years ago
|
||
(In reply to Cyrille from comment #40)
Is that issue resolved ? I can read an update on Master password in Firefox or Thunderbird? Do not bother! that say weakness is resolved since Firefox 72 ?
These are different issues. The article you link to is about the master password and local encryption. This issue is about Firefox Sync and encryption when data is being uploaded to the cloud. It’s referenced in another article I wrote: Can Chrome Sync or Firefox Sync be trusted with sensitive data?
Comment 44•2 years ago
|
||
With the recent security incidents at LastPass many users might (re-)evaluate whether their current password manager is safe enough. Seeing that this six-year-old (and this nine-year-old) issues are not resolved is not very confidence inspiring. As a step to gain (and keep) Firefox Sync users, it might be good to at least increase the number of client-side PBKDF2 rounds (and periodically adjust the number of rounds to reflect recommended practices).
Comment 45•2 years ago
|
||
This ticket was mentioned in an article that explains the same issue in LastPass and Vaultwarden and how in Sync the iterations are very low: https://palant.info/2023/01/23/bitwarden-design-flaw-server-side-iterations/
Comment 46•2 years ago
|
||
This has also been disclosed in the 2017 audit and determined that no changes would be made at that time, so to be consistent with that announcement it is probably best to just close this bug report.
https://blog.mozilla.org/security/2017/07/18/web-service-audits-firefox-accounts/
Unlike LastPass, the encryption key is secured behind further scrypt hashing server-side so the client-side hashing mentioned in the palant.info article is a bit misleading since that is not the last line of protection and was merely meant to avoid plain text passwords being exposed in a MITM attack. So to brute-force a compromised data file without any other information one would need to hash with 5000 iterations of PBKDF2 AND scrypt before checking the validity of the password.
Comment 47•2 years ago
•
|
||
The problematic scenario isn’t merely MITM (something that is probably rather unlikely) but also a compromise of the fxa-auth-server. If an attacker manages to control the server as opposed to merely accessing the data, they will be able to log the password hashes as they come in. At 1,000 PBKDF2 iterations, the cost of 2³² guesses is merely $0.06 (cost estimate by 1Password, my estimate based on cloud computing prices arrives at roughly twice the number). Guessing a password with 40 bits of entropy will cost $7.68 on average.
While it is hard to tell what the typical entropy of a password is, zxcvbn will give a score 4 out of 4 to a password with 33 bits of entropy. Add to this that the Firefox Accounts signup page doesn’t offer much help for choosing a strong password – “asdfyxcv” is considered a perfectly good password. Even if someone followed the advice (combine two words, change letters to numbers etc.), it’s hard to come up with a truly strong password this way.
Comment 48•2 years ago
•
|
||
FWIW I'd prefer us to have not only strong crypto, but also strong looking crypto. Most of the people in this thread have at least basic idea what PBKDF2 or 1000 iterations are. Overwhelming majority of the people on Earth do not have such knowledge. But they trust in whatever their friend said about in an article on Internet.
P.S. I love users, but I don't trust them to pick a strong password. Lets not count on that.
Comment 49•2 years ago
|
||
but also a compromise of the fxa-auth-server
If the server is compromised to that extent the hash can just be copied into a new API request, what good is it to guess the password?
I'd prefer us to have not only strong crypto, but also strong looking crypto.
I agree, it isn't a good look - Core53 ranked it "high" severity - and logically, if it was ever worth hashing then it should be worth updating the hashing iterations to keep up with the times, but it seems Mozilla decided that it wasn't anymore.
(probably because it would be non-trivial - the old hash is still required to decrypt so the old would still have to be sent until the client is somehow aware that it no longer has to - would probably require multiple new API endpoints so significant changes on both client and server-side - though still totally doable)
My point was just that there is no reason to keep this bug report open if it has already been decided it won't be fixed.
Comment 50•2 years ago
|
||
(In reply to colin from comment #49)
If the server is compromised to that extent the hash can just be copied into a new API request, what good is it to guess the password?
The password is still required to decrypt the data, even on a compromised server.
Comment hidden (advocacy) |
Comment hidden (advocacy) |
Comment 53•7 months ago
|
||
There is code on GitHub that suggests a version two of the "password to encryption key derivation scheme" exists, which uses 650000 iterations rather than the previous 1000 in the older version.
https://github.com/mozilla/fxa/blob/main/packages/fxa-auth-client/lib/crypto.ts
Dan Schomburg, you authored the commit, can you please comment on what are the prerequisites for using the more secure version two? Mozilla's communication on this issue is non-existent and terrible.
Comment 54•7 months ago
|
||
Hi all. Thanks for your input on this bug.
As noted, we are working on improving some of our password hashing code.
One issue that is reported pretty regularly with Accounts is that people can't re-register with an email address that was used previously as a secondary account. This is because we've generated our salts based on the original email address which registered the account. This isn’t ideal as it means we have to keep that email address around when it’s possible that people may prefer it be forgotten or no longer use that email address.
So, we're updating the code to use a random salt which will require us to generate new hashes. Since we are generating new hashes we're taking the opportunity to increase the iterations as well. The new code is 650k iterations which is what we see others in the industry using now and, in our testing, will work for older devices, too - though, worth noting that it takes just over 3s to log in on a macbook from 2007.
As far as "prerequisites for using," we plan to enable it in production soon. We expect to turn it on automatically for a small percentage of users next week. If that goes well, we'll continue to expand until everyone is using it and there is no version 1. It won’t be something you'll need to opt-in to, it will happen automatically.
Please do file bugs if you see any issues as this is rolling out, and, as always, thanks for your feedback.
I plan on closing this bug when the new version is finished rolling out.
Comment 55•26 days ago
|
||
Hello Wil,
6 months ago you wrote:
we plan to enable it in production soon
What's happening with increasing iterations for password hashing? Since we've heard nothing, I'm assuming it hasn't been rolled-out? I'm shocked this serious issue still hasn't been fixed (8 years after it was originally reported!).
I don't use Firefox for storing any passwords now, because Firefox's current implementation of password hashing is very insecure. It's about as bad as LastPass, who have been under attack since at least 2015, were broken into in 2022, and since then millions of dollars have gradually been stolen from a wide range of otherwise very secure crypto wallets held by over 150 security-conscious people - with the only common denomentor being that nearly all of them used LastPass:
https://en.m.wikipedia.org/wiki/LastPass#Security_incidents
https://www.theregister.com/2022/12/23/lastpass_attack_update/
https://krebsonsecurity.com/2023/09/experts-fear-crooks-are-cracking-keys-stolen-in-lastpass-breach/
https://www.theregister.com/2023/11/08/monero_project_developers_announce_breach/
Firefox only uses 1000 iterations of PBKDF2, while LastPass defaulted to 5000 in 2013, and only increased it to 100,100 iterations in 2018 for new users - but seemingly left existing users on the old iteration count, such that people have reported finding they have only 500 or 5000 iterations set:
https://palant.info/2022/12/28/lastpass-breach-the-significance-of-these-password-iterations/
With 500 or 5000 iterations, it might cost a few thousand or tens of thousands of dollars to crack a secure password with 50 bits of entropy (which already makes it financially viable in some situations).... but most people will use shorter & rather more easily guessed passwords, meaning it could only take as little as a few dollars to crack.
You might say this is only a theoretical problem, because hackers would first have to break into Mozilla's secure servers, but I'm pretty sure that's what LastPass would have said as well. All online/cloud password vaults are extremely tempting targets for hackers, so it's not a matter of if they'll break in, but rather only how long before they do so. And when Mozilla add Thunderbird email credential syncing to their system, they'll surely be an even greater target for hackers, as accessing email accounts allows bypassing email-based 2FA, among other things.
AND that's not all: Storing passwords in Firefox, but disabling password syncing, is not as secure as it seems. If I enable Firefox password syncing on a different device, then that automatically enables password syncing on all devices, which will then auto-upload all my passwords to the cloud. Therefore if a hacker can get a copy of all users' vault data from a Mozilla server, then with a bit more patience they can surely enable password syncing for all user accounts, to force those devices to upload their passwords.
Comment 56•23 days ago
|
||
Hi folks,
These changes were in stage for a few months and we have been slowly rolling it out to production for the past several weeks to make sure there weren't any unintended side-effects. As of Oct 17th this was rolled out to 100% of accounts. Anyone who logs in to accounts.firefox.com now will be automatically upgraded to use 650k iterations and a new random salt.
One key aspect of our strategy here was to generate both v1 and v2 hashes while we're in this transitional/testing phase so we can roll back if needed. Next steps for the project will be:
- Stop generating v1 hashes
- Delete all v1 hashes and salts
Step 1 can happen after the new system has baked for a little while. Step 2 is at least a couple years away since upgrades happen when a person logs in and people might not be logging into their account regularly.
Thanks for all your attention and feedback in this bug. It's a pleasure to be able to call this FIXED.
Comment 57•23 days ago
|
||
I know others will be curious - can Step 2 be done on a per-user basis sooner than a couple years? As long as the v1 hash is still stored, all the risk of a brute force attack is still present.
Maybe something like "After 4 months, and a user has logged in 3 times" then delete the v1 hash?
I don't know if we could ever delete v1 hashes for users who have not logged in, as it would be tantamount to deleting their content and locking them out of their account forever, but for active users I think it would be much better to delete the v1 hashes sooner.
Comment 58•23 days ago
|
||
Yes, we could definitely do it in a rolling fashion for active accounts.
Description
•