News for hackers. Stuff that matters.
Re:Bitwarden PINs can be brute-forced by forty on Sunday March 19, 2023 @01:36PM (#35221468)
Of course the PIN can be brute forced. It feels like reporting "I can walk over the lawn fence". That PIN is probably here to prevent your kids from messing with your vault when you grab your coffee with your computer unlocked.

Protecting from an attacker with your laptop locked should be done at the OS level with FDE and secure boot. Protecting from a real attacker with access to your unlocked computer is a bit hopeless (as someone mentioned, they probably can install some key logger and steal the master password and everything else later).

It never hurts to be clear on the threat model (And they should probably go with the option 1. suggested by the author), but I feel in that case the behavior matches reasonable expectations and the author is a bit of bad faith.

For solution 2. if you want to check a pin server side without trivial access to the PIN from the server you can do it à la signal using secure enclaves https://signal.org/blog/secure-value-recovery/

Re:Bitwarden PINs can be brute-forced by badrabbit on Sunday March 19, 2023 @01:45PM (#35221572)
Ugh..no it does not work that way.

You are thinking in hypotheticals like many developers do.

Most infostealer malware just exfiltratr your data and disappear before being detected do they can hit a lot of targets before commom av starts detecting them. People also accidentally disclose data, back it up on a usb drive and lose that drive, have their pc stolen,etc...

If you have keepass2 with a memory argon2 and a password/passphrase none of that is a concern.

Yes, the malware could also be a keylogger/RAT and you'd be screwed then. One the most important security mindsets to have is "perfection is the enemy of good", specific security controls exist to address specific threats/risk not to address arbitrary and and an unbounded number of possible threats.

Re:Bitwarden PINs can be brute-forced by forty on Sunday March 19, 2023 @01:53PM (#35221650)
I agree with the mindset and that's why I think it's good the data is still encrypted even if, as the author mentioned, they might as well have left the data in plaintext.

Sure entering a passphrase each time is better for security. But if the user chooses to set up a PIN instead, I feel the current behavior is reasonable.

Re:Bitwarden PINs can be brute-forced by badrabbit on Sunday March 19, 2023 @02:05PM (#35221766)
If it is not the default behavior then I agree with you.
Re:Bitwarden PINs can be brute-forced by aidenn0 on Sunday March 19, 2023 @02:20PM (#35221907)
I've been using bitwarden for years and didn't know this feature existed, so it at least wasn't the default in the past.
Re:Bitwarden PINs can be brute-forced by flxy on Sunday March 19, 2023 @03:58PM (#35222909)
This is not the default behaviour and it has to be enabled per client/platform. The first unlock after a reboot still requires the master password as well.
Re:Bitwarden PINs can be brute-forced by femto113 on Sunday March 19, 2023 @04:31PM (#35223237)
There really needs to be another standard class of vulnerability besides "physical access to the device" along the lines of "access to a copy of the on disk data". There are so many paths to this and some never required physical access or even an accidental exposure on the part of the user, it could be a breach of a provider (ala LastPass).
Re:Bitwarden PINs can be brute-forced by asveikau on Sunday March 19, 2023 @02:16PM (#35221871)
They could make it take more time to derive a key from a pin. That would make it more difficult to brute force.
Re:Bitwarden PINs can be brute-forced by lyu07282 on Sunday March 19, 2023 @02:22PM (#35221938)
They do that already:

> This brute-force will very likely be successful, since PINs are usually very low-entropy. Now, granted, the key derivation function is PBKDF2 with 100000 iterations (+ HKDF), but that won't help with a 4 digit pin.

It would be better to not have that feature at all, that convenience feature goes a bit too far. But nice to see that's the only thing they found, I'm sure they looked for more severe issues but found none.

Re:Bitwarden PINs can be brute-forced by candiddevmike on Sunday March 19, 2023 @03:30PM (#35222619)
While that may seem like a lot of iterations, in reality it doesn't take that much time at all, at least in my experience.

You could argue a security product shouldn't let folks set a PIN due to footguns like this and instead require something like WebAuthn for an "easier" login method.

Re:Bitwarden PINs can be brute-forced by progbits on Sunday March 19, 2023 @02:30PM (#35222012)
The pin space is just too small. What's the longest an user is willing to wait? 10 seconds?

Times 10k that is just 27 hours. Spend a couple of bucks on a few beefy EC2 instances and you crack that in an hour or two.

Re:Bitwarden PINs can be brute-forced by eviks on Sunday March 19, 2023 @03:12PM (#35222401)
It's not too small, your not limited to just numbers in your PIN on a computer
Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @08:38AM (#35230631)
A PIN is, if not by definition then by practical user experience, a short, numeric secret. You really can‘t blame users for using one for a field that purports to ask for a PIN.
Re:Bitwarden PINs can be brute-forced by eviks on Monday March 20, 2023 @02:34PM (#35236406)
Except this thread isn't about blaming the users, but assessing the potential for improvement, where this simple mistake leads to inaction So yeah, they should change the stupid name and be more clear that users should use letters as well, but it's still valuable to increase argon work factor parameters
Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @03:01PM (#35236842)
If you call something a PIN, salted hashing is completely pointless (and software still doing it tells me that the vendor hasn't grasped this fact).

A Personal Identification Number typically has 10k (or less frequently a million) possible values. Hashing buys you a few seconds of brute force resistance here at most, which is completely useless.

If you dial up the hashing complexity enough to make a dent, even legitimate logins will start having an unacceptable UX and battery life impact. You're just on the wrong side of the e function with PINs.

> be more clear that users should use letters as well

The entire point of the feature is that the PIN, whether letters or numbers, is shorter and/or easier to type than your passphrase. If you require users to use something of equivalent security to their passphrase, you might as well remove the feature.

Re:Bitwarden PINs can be brute-forced by eviks on Monday March 20, 2023 @11:35PM (#35242269)
I don't know why your repeat the same mistake with 10k, "typical" doesn't mean you ignore the atypical, that's still a net benefit.

Your last point is also misleading - no, you don't require the equivalent to master password, and yes, it still makes sense in that case. "Shorter/easier" can still mean enough entropy for the smaller threat model of local compromise (with even more entropy required in the master password for the bigger threat of cloud compromise). It's when it drops down to the level of literal 4-number PIN, then it becomes useless against this threat and only useful for an even smaller threat

Re:Bitwarden PINs can be brute-forced by IshKebab on Sunday March 19, 2023 @02:22PM (#35221933)
Consider how long you need to make it before it is infeasible to brute force a 4 digit PIN.
Re:Bitwarden PINs can be brute-forced by nabakin on Sunday March 19, 2023 @02:35PM (#35222055)
> Of course the PIN can be brute forced.

This is obvious to those that know anything about security, but it is not obvious to the average user. It is Bitwarden's job to keep the user safe within their platform and if they provide a pin option, the average user knows no better than to use it. If Bitwarden does not explain how insecure pins are, then the fault 100% lies with them. Blaming the user is rarely ever an effective or useful argument.

Re:Bitwarden PINs can be brute-forced by andrewxdiamond on Sunday March 19, 2023 @03:24PM (#35222536)
The user does not need to be aware of the threat model.

OPs point was the pin isn’t protecting much at all because it doesn’t really need to. The user isn’t making a risky decision, because if the attacker gets as far as _being able to put the pin in_, the whole thing is toast regardless of guessing the pin or not

Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @08:30AM (#35230553)
Not really: Consider e.g. a stolen laptop (without full-disk encryption or a screen lock).

If Bitwarden could somehow implement the PIN attempt counter in secure hardware or on their server, they could achieve something more resistant against local offline brute force attacks.

A Yubikey could do the trick, theoretically (but unfortunately the FIDO API does not really lend itself to encryption, as it was designed only for authentication).

Re:Bitwarden PINs can be brute-forced by SiempreViernes on Monday March 20, 2023 @09:41AM (#35231368)
If you don't even have a screen lock on your laptop, what business do you have complaining that bitwarden didn't protect your secrets?
Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @09:59AM (#35231588)
Don't worry about me, I do have a screen lock.

Still, I think that software in general, and security software in particular, should follow the principle of least surprise.

In the case of PINs, this is, in my view, an implicit contract to rate-limit invalid PIN attempts somewhere, regardless of all other security measures.

Re:Bitwarden PINs can be brute-forced by SiempreViernes on Tuesday March 21, 2023 @04:30AM (#35243751)
Sorry if it came across as a statement directed at you as a person lxgr, I was using "you" in the generalised sense:

> We can use one, you or we when we are making generalisations and not referring to any one person in particular. When used like this, one, you and we can include the speaker or writer

https://dictionary.cambridge.org/grammar/british-grammar/pro...

Re:Bitwarden PINs can be brute-forced by teekert on Sunday March 19, 2023 @05:00PM (#35223568)
I always wonder, with a keylogger on my device, I’m probably more f-ed using my master password all the time, right? Isn’t that a large threat? Larger than the one from op?
Re:Bitwarden PINs can be brute-forced by munchbunny on Sunday March 19, 2023 @11:06PM (#35226772)
Yes, with a keylogger watching you you’re typically pretty f-ed. Though that’s also one of the reasons using a physical FIDO token as a second factor is a good idea, since the keylogger isn’t going to be able to steal your private key off the hardware token, unlike for TOTP.

Though that also begs the question, if I can get a keylogger onto your device, why wouldn’t I try to implant something slightly more capable?

Re:Bitwarden PINs can be brute-forced by jve on Monday March 20, 2023 @05:21AM (#35229084)
> since the keylogger isn’t going to be able to steal your private key off the hardware token, unlike for TOTP

How? I mean how can keylogger get the secret from which TOTPs are being generated?

And why wouldn't some other malware won't be able to read whatever data hardware token inputs? I'm myself yubikey user and would like to know in what ways it is more secure than TOTP, even in the scenario when my workstation gets compromised.

I assumed if someone can install something on my computer, I'm toast.

Re:Bitwarden PINs can be brute-forced by zinekeller on Monday March 20, 2023 @07:57AM (#35230271)
Assuming that they're the standard SHA-1/30sec TOTP and the keylogger is smart enough to store it, at least two 6-digit codes and their approximate time (https://www.unix-ninja.com/p/attacking_google_authenticator).
Re:Bitwarden PINs can be brute-forced by munchbunny on Monday March 20, 2023 @08:39AM (#35230638)
> How? I mean how can keylogger get the secret from which TOTPs are being generated?

Since it’s time based with a 30 second window, you don’t need to know the secret, you just need to be able to repeat the code as it is typed. It takes more effort because it has to be done in real time, but 30-ish seconds is pretty doable.

> And why wouldn't some other malware won't be able to read whatever data hardware token inputs? I'm myself yubikey user and would like to know in what ways it is more secure than TOTP, even in the scenario when my workstation gets compromised.

The way (most) hardware tokens work, including the Yubikey, the private key is generated on the key and it never leaves the key. When the FIDO challenge/response happens, you relay the server’s challenge to the Yubikeu, it does the private key operation with the onboard chip, and sends back the response for you to relay back to the server. Done this way, your computer never needs to know the private key, but you can still prove you physically own it, which is what the server is trying to verify.

Re:Bitwarden PINs can be brute-forced by jve on Monday March 20, 2023 @11:41AM (#35233233)
I see private key within Yubikey the same as TOTP secret. Ok, for TOTP it is stored on host, but as you said: "you don’t need to know the secret"

When I press button on yubikey, it pastes some jibberish - way more than 6 chars, but can't THAT token be re-used?

Okay, browsers have some integrations with this stuff so it is not always some kind of a web form where that goes into, so could be a bit more secure.

I'm no security expert, I'm just thinking out loud and hoping someone educate me :)

Yeah, the end result (whatever header value or cookie in browser) is still readable by malware.

Re:Bitwarden PINs can be brute-forced by munchbunny on Monday March 20, 2023 @11:51AM (#35233406)
> When I press button on yubikey, it pastes some jibberish - way more than 6 chars, but can't THAT token be re-used?

Just to be clear, that's not related to FIDO which I was originally talking about. That's one of the extra OTP features that most Yubikeys come with, but it's unrelated to the Yubikey's FIDO capability.

Re:Bitwarden PINs can be brute-forced by 1letterunixname on Sunday March 19, 2023 @07:04PM (#35224690)
The remediation is human and pw/pin policy: make sure users pick a good pin and that they're not using it anywhere else.
Re:Bitwarden PINs can be brute-forced by eptcyka on Sunday March 19, 2023 @07:09PM (#35224746)
When it comes to 4 or 6 digit pins, its almost impossible to ensure that no pin has been used before. At 8 digits, you might as well be using diceware anyway.
Re:Bitwarden PINs can be brute-forced by TylerE on Sunday March 19, 2023 @07:45PM (#35225082)
At least by not allowing 4 you get rid of the two most common lazy date formats (and YYYY)
Re:Bitwarden PINs can be brute-forced by eptcyka on Monday March 20, 2023 @02:54AM (#35228134)
Does it matter if you can bruteforce a 4 digit pin in a day, if there's no TPM guarding it?
Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @08:34AM (#35230594)
Nothing prevents users from using 0YYYY or 0DDMM/0MMDD.

Every time some site ridiculously insists I "use a more secure password", I sigh and add "A1!$" to the end of my 32-character alphanumeric random string.

Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @08:31AM (#35230565)
A PIN is almost by definition a low-entropy secret and is only secure together with some rate-limiting mechanism.

Never (only) encrypt things with a PIN.

Re:Bitwarden PINs can be brute-forced by jeremyjh on Sunday March 19, 2023 @03:48PM (#35222813)
It’s one thing to offer a pin for quick unlocks, and quite another to allow that pin to be the only key required to unencrypted the files stored on the disk. A pin should only secure the master key in memory; it should not even be possible to write passwords to disk with such weak encryption.
Re:Bitwarden PINs can be brute-forced by foobiekr on Sunday March 19, 2023 @03:52PM (#35222860)
FDE doesn't matter at all since a running system is going to have the volume mounted.

Secure boot also doesn't matter because the boot time root kits are a rarity and trojaned downloaded SW (npm, homebrew, etc. nearly completely unprotected from malicious actors beyond the bare minimum) or the massive browser attack surface are what are actually used.

What would be nice is proper layered sandboxing at the OS level, always on, but obviously the kernel-userland ABI is not actually very secure in practice, and has been the source of recurring escapes. But at least it would be something.

Consider this: as it is, sophisticated users on, say, the MacOS platform, who download SW such as homebrew, youtube-dl, whatever, or do local development with npm and other package managers, are actually in a much worse place than unsophisticated users who run with "only from the app store" enabled.

This is not a good place to be.

Re:Bitwarden PINs can be brute-forced by ar9av on Sunday March 19, 2023 @05:53PM (#35224071)
Bitwarden argues that the finding is out of scope because from what I can gather the claim that exploiting this requires access to the device. If that were the case, I'd agree with them. But having access to the Bitwarden database is not the same as having access to the device. There are plenty of vulnerabilities that give you limited read access. Simply selling your hard drive without erasing the data first would be a very common scenario.

That's why SSH keys or GPG keys are typically protected by a pass phrase. Not a PIN, not a password, a pass phrase. At least that's the wording that OpenSSH uses, and Bitwarden should do the same. Secure your database with a pass phrase, not a PIN, or else you might be vulnerable. That's how it should be communicated to the user. These details matter.

Re:Bitwarden PINs can be brute-forced by ddulaney on Sunday March 19, 2023 @06:22PM (#35224315)
I really like the way 1Password and MacOS work together for security [0].

Even if my laptop is unlocked, each 1Password interaction needs my fingerprint. That unlocks a secret stored in the Secure Enclave, which I trust. (Security is hard and flaws are possible, but Apple has done a reasonably good job here from what I can tell.) I only have to mess around with typing a long string of nonsense in when I'm registering a new device, rather than every time I want to use my SSH or GPG key (or trusting an agent to hold it in memory, which... I'll do it, but I won't like it).

I wish I could rely on similar things from Linux, but the user experience just isn't there on the desktop. A previous employer issued laptops that had both a fingerprint reader and some kind of HSM, so the hardware was there, but I remember both of them missing drivers at the time, and even with drivers the userland software support would've been very hacky.

[0]: https://support.1password.com/touch-id-apple-watch-security-...

Re:Bitwarden PINs can be brute-forced by KennyBlanken on Sunday March 19, 2023 @06:36PM (#35224424)
KeepassXC does the same thing. Once you enter your password, you can unlock with your fingerprint.
Re:Bitwarden PINs can be brute-forced by andrewaylett on Sunday March 19, 2023 @08:13PM (#35225338)
Bitwarden's fingerprint integration does exactly the same.
Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @11:12AM (#35232683)
Given that, really the only thing that Bitwarden would have needed to do is to clearly label the PIN feature as being much less secure than the biometry option, especially when used in combination with the "do not ask for passphrase after browser restarts" option, which persists an only PIN-encrypted version of the master encryption key to disk.
Re:Bitwarden PINs can be brute-forced by andrewaylett on Monday March 20, 2023 @04:23PM (#35238078)
Agreed -- I happily use biometric unlock, but there's no way I'd turn on PIN unlock.
Re:Bitwarden PINs can be brute-forced by Takennickname on Monday March 20, 2023 @12:31PM (#35234125)
Fingerprinting and everything work perfectly fine on Fedora with the ThinkPad's built in fingerprint scanner.
Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @05:40PM (#35239172)
Interesting, how can fingerprints be used as a cryptographic unlocking method on Linux? Does this involve the TPM somehow, or does the security model assume a non-compromised userspace and/or kernel?
Re:Bitwarden PINs can be brute-forced by Takennickname on Tuesday March 21, 2023 @11:05AM (#35247244)
I don't know about all of linux, but default Fedora (gnome keyring) appears to support TPM since 2016.
Re:Bitwarden PINs can be brute-forced by thrashh on Sunday March 19, 2023 @10:56PM (#35226716)
Your database IS protected with a pass phrase

When you enable the PIN, you deliberately weaken your security for convenience. However, when the database unloads, your database is still protected by your pass phrase.

Re:Bitwarden PINs can be brute-forced by ambiso on Monday March 20, 2023 @05:26AM (#35229118)
> However, when the database unloads, your database is still protected by your pass phrase.

This is not the case if you disable the "lock with master password on restart" option. In that case only your PIN is guarding access the the vault data.

Using a PIN shouldn't have to mean weakening the security, since there's several secure implementation options of a PIN. (See other comments about Windows Hello for example)

Re:Bitwarden PINs can be brute-forced by mcronce on Sunday March 19, 2023 @05:57PM (#35224104)
I agree with you. Short PINs are for preventing well-intentioned people from accidentally using the wrong account (which I do consider quite valuable, for the record) - not for keeping bad actors out.
Re:Bitwarden PINs can be brute-forced by d1lanka on Sunday March 19, 2023 @06:33PM (#35224404)
Where’s my KeePassXC gang at.
Re:Bitwarden PINs can be brute-forced by senectus1 on Sunday March 19, 2023 @07:40PM (#35225025)
It would not be a terrible idea for the pin to "expire" if tried more than "x" times unsuccessfully in a row, defaulting back to the master password.
Re:Bitwarden PINs can be brute-forced by jdmichal on Monday March 20, 2023 @03:59AM (#35228539)
The Bitwarden client does this. The issue is that nothing prevents the attacker from taking the encrypted database and working with it directly, thereby bypassing that client protection.
Re:Bitwarden PINs can be brute-forced by abrookewood on Sunday March 19, 2023 @09:04PM (#35225860)
That was my initial reaction as well, but it isn't necessarily true. If you read up on how Windows Hello uses a PIN, then it becomes clear that they can be pretty secure where: (1) a PIN is tied to the device; (2) a PIN is local to the device; and (3) a PIN is backed by hardware.

https://learn.microsoft.com/en-us/windows/security/identity-...

Re:Bitwarden PINs can be brute-forced by chrismorgan on Sunday March 19, 2023 @09:44PM (#35226221)
> Of course the PIN can be brute forced.

There’s no “of course” about it. Every place I can think of having used a PIN in the last decade has not been susceptible to brute-force attacks, due to the PIN being stored off-site (e.g. payment card) or in a TPM (e.g. Windows Hello), and a few incorrect attempts triggering blocking of the payment card or PIN or whatever.

If you think carefully about the description of this specific feature, and where and how it’s running, then yes, you’ll probably realise that the PIN will be brute-forceable. But people are probably used to the idea that PINs actually aren’t susceptible to this kind of attack.

Re:Bitwarden PINs can be brute-forced by ambiso on Monday March 20, 2023 @05:38AM (#35229212)
> Of course the PIN can be brute forced. It feels like reporting "I can walk over the lawn fence".

This is entirely non-obvious: there's several ways to implement a PIN unlock in a secure way (see e.g. what you mentioned about Signal and other comments about e.g. Windows Hello). Bitwarden chose an insecure one and to not warn about its risk in the clients (unlike some other features, where you get a big modal warning when enabling them; see the end of this comment).

> Protecting from a real attacker with access to your unlocked computer is a bit hopeless (as someone mentioned, they probably can install some key logger and steal the master password and everything else later).

This is a different attack scenario. If I throw away my computer, or you steal it in its powered off state, a keylogger won't help you since I won't be entering my password again.

> Protecting from an attacker with your laptop locked should be done at the OS level with FDE and secure boot.

Definitely, FDE and secure boot would mitigate the attack (if your computer is off). However it's still not enabled by default on most systems and Bitwarden recognizes that since they give you a big modal warning that your encryption key will be stored in plain, if you set the lock option to "Never": https://imgur.com/a/jj9FveF

Re:Bitwarden PINs can be brute-forced by MomoXenosaga on Monday March 20, 2023 @06:35AM (#35229629)
Any code can be brute forced if you have a century to spare and enough computing to throw at it.

Which is why my bank card is blocked after three failed attempts.

Re:Bitwarden PINs can be brute-forced by lxgr on Monday March 20, 2023 @11:19AM (#35232798)
> if you want to check a pin server side without trivial access to the PIN from the server you can do it à la signal using secure enclaves https://signal.org/blog/secure-value-recovery/

You could do that, but you should definitely also design this in a way that does not fail catastrophically if the server-side enclave fails, which at least Intel's version seems to have a habit of doing every couple of months or years.

A nice way would be to use a modern PAKE that can recover a client-side secret securely after a successful authentcation, such as OPAQUE: https://eprint.iacr.org/2018/163.pdf

Conceptually, you do a PAKE, and upon successful authentication deliver server-side stored entropy to the client (either through the PAKE, if it supports the feature natively such as OPAQUE, or explicitly over an encrypted channel secured under the PAKE-derived session key), which then combines it with client-side stored entropy to decrypt the database. That way, the server can rate-limit the client's PIN entry attempts, but does not have access to the vault itself even if it learns/brute forces the PIN.

Facebook uses a combination of this and the HSM/enclave approach for encrypted WhatsApp backups (although without the client-side stored secret, since the use case is recovering from a lost device, not protecting data on a compromised device): https://engineering.fb.com/2021/09/10/security/whatsapp-e2ee...