Firefox Master Password System Has Been Poorly Secured for the Past 9 Years
bleepingcomputer.com
bleepingcomputer.com
Mozilla has known for a very long time that the master password system isn't very effective. Even a decade ago, I remember them recommending not using it.
If this is the case, I’d consider it to be useful because in general I don’t trust apps as a rule.
A decent distribution nowadays sets /proc/sys/kernel/yama/ptrace_scope to disallow any process to spy on other processes.
ptrace_scope was apparently introduced in 2011-2012, see https://github.com/torvalds/linux/commits/a2e5790d841658485d...
For more information:
https://www.kernel.org/doc/Documentation/security/Yama.txt
https://en.wikipedia.org/wiki/Ptrace
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin... (via https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening... )
You'll still need a password manager to store the unique passwords for your services.
https://www.yubico.com/support/knowledge-base/categories/art...
https://www.yubico.com/wp-content/uploads/2015/11/Yubico_Whi...
EDIT: Explanation
I agree a text file is 'secure' enough for you but a lot of password systems also hide the password in the UI which is a pro inho (I use KeePass).
A file in a place not immediately obvious to a casual browser without obvious references to what it is seems broadly fine to me. (I don't bother, Instead just re-use passwords because I'm a horrible person)
There is also case of "someone stole your backup", which is also quote realistic, especially when using third-party storage services.
Even in work contexts, “hey can I use your computer to print something? Mine is frozen” is very common.
There was a similar discussion on the chromium tracker when they started storing passwords. I believe Chrome now use OS services (DPAPI on Windows and Keychain on MacOS) to protect passwords.
at that point they can install a rootkit and bypass all your fancy DPAPI/keychain protections.
[1] before you say "but I got password on my sudo!", there's nothing preventing someone from aliasing sudo to
sudo bash -c "/tmp/evil.sh; $*"A feature that users would be better off not using is a feature that should be removed, IMHO.
Most users that I know use the master password system in combination with a very long master password. That should protect against some brute-forcing but everyone should at best not use the master password at all.
I think Mozilla might be better off by removing the internal password manager entirely and instead providing an interface for password managers (and ship a simple one with firefox that doesn't have a password protection, users can then pick a proper password manager on their own)
Users with master password will have to be informed they need to find a new solution.
It still makes the attack harder, I grant, but not that much harder.
A password manager itself has a similar threatmodel but it holds (usually) more valuable information than just passwords (in my case TOTP, Bank Data, Credit Card, etc.)
PM's are also usually better equipped to deal with this (Keepass uses a Secure Desktop on Windows)
Firefox's master password is "good enough", so to speak. It's unlikely someone will attack you either way but if someone does then FF's system should hold out a day or two if you picked a reasonable password (a modern PM can put up much better brute force defence)
It could be as simple as having a syscall that connects a process directly with the keyboard and does not let any other process intercept any keyboard input until the program lets go or times out (180s, after that the program isn't allowed to get SAM anymore for another 180s)
If a physical keyboard is present, the program is assigned to the keyboard of the current user's seat (works with sudo since that only sets effective UID/GID not real UID/GID)
Additionally, a program with root privileges (or a special CAP) can register itself as a HID in which case the SAM captures any HID's + keyboards of the current seat.
Any complex setup would therefore be pushed out of the kernel but still provide reasonable security. An additional edgecase can be seen in debuggers which can be reasonably circumvented by having the SAM mode provide a few pages of memory that aren't mapped into any memory but the current process so a debugger can't read the password.
A software keylogger would require strict root privileges to circumvent this system.
The difference being that I can still "use" the passwords without this prompt (FF does not allow this) and I'm still able to view the entire PW database, which will show me usernames (but not passwords).
So, in fairness, Chrome has "sort of" implemented this feature (albeit in a laughable insecure way) and quite obviously have left it to rot (2013?!) on the digital vine.
https://dxr.mozilla.org/mozilla-central/source/security/nss/...
It also processes salt||pw; while that's not a problem per se for password hashing, I generally prefer unique encodings when hashing multiple fields, such as len(salt)||salt||len(pw)||pw.
SHA1 (and other cryptographic hash functions) generally already include the length as something that is part of the hash itself, so your “length encoding” is completely redundant in the case of hashing salt|password.
Instead, they could just have added a for loop
Pretty bad indeed, but then again: this is a master password you're setting. The one password to rule them all ought to be strong anyway. If you do that, it's perfectly safe.
The problem is that each year definition of "strong password" changes, because of growing performance of CPUs and GPUs.
"Use a password manager" is always a good solution, I know. But well, who will remember the super lengthy password for the password manager? ;)
His "solution" is to use shorter passwords. The XKCD method is good if you add separators, padding, etc; as expressed featured on xkpasswd.net
I highly recommend generating a password and then adding something unique to it.
For instance, a password I might generate would be:
$66=mine=BODY=spot=STOP=23$-d1j1t
It's memorable enough, and I highly doubt it's easily crackable. Certainly no less than 'tlpw2m'.
However, as you point out, it provides no argument against passphrases, aside from referring to them as a "trick". I still don't know how people look at the XKCD explanation (where Randall Munroe actually does a pretty good job of correctly and succinctly detailing the strength of the two password styles [1]), and call it a trick. The only trick is that your mind has an easier time remembering passphrases than it does remembering a similar strength random string.
[1] Specifically, Randall already assumes that the cracker knows that the password is a passphrase, and has the 1000-word list it was picked from.
You still definitely have to accept at least four words actually randomly generated (this is important, else the scheme falls apart horribly). Accepting 6 random words is pretty secure IMHO.
https://www.eff.org/deeplinks/2016/07/new-wordlists-random-p...
Most (all?) places that discover that 9+ is not good enough for the most valuable credentials, move to 2FA instead.
Luckily, you can change your password.
Also, you could say the same thing for the hashing algorithm. Every year you'd want to up your iteration count or even upgrade algos (e.g. use memory-hardness when scrypt was released).
It works both ways, but overestimating is never a bad idea: if someone hacks you now and cracks it in five years, some passwords may still be in use.
"I eventually found the sftkdb_passwordToKey() function that converts a [website] password into an encryption key by means of applying SHA-1 hashing to a string consisting of a random salt and your actual master password."
UI- and convenience-wise, this is as good as LastPass used to be - and perhaps still is; I dropped them the day they were sold to some nefarious LockMeIn-entity.
I can’t imagine them being too concerned with brute force attacks.
In practice, this only works if you provide the password manager that will be chosen once and for all.
zaarn's suggestion "providing an interface for password managers" is an interesting alternative.
And I haven't looked but I imagine changing the encryption algo isn't a huge task, I wasn't suggesting that a non-Mozilla worker implement something huge like zaarn's suggestion, which fwiw I think is awesome as I don't use FF built-in password manager and find it just gets in the way.