-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Check passwords against hacked password databases [$300] #1083
Comments
I don't really like sending plaintext passwords over the web. Ok it's https but you need to really trust haveibeenpwnd. Sending sha1 is slightly better but still a no-no IMHO. I think the best choice is to let user import a wordlist of pwned password and let KeePassXC do the comparison. Also I will prefer this instead: https://haveibeenpwned.com/API/v2#BreachesForAccount This is related to #551 |
Quoting haveibeenpwned.com/Passwords page itself:
|
I had been looking at using the downloaded password hashes, but I figured that online would be faster/easier to test against (the password hashes, when downloaded and unzipped are about 13 GB). That is what I had intended on suggesting, but I haven't been able to figure out why my sha1sums are different from haveibeenpwned.com's hashes. EDIT: needed to use |
Honestly if you are using a randomized password greater than 12 characters the probability of being on that list are miniscule. It's not worth the effort to incorporate this. The entropy meter is far more useful. |
Sending passwords to any third-party that isn't its own target website is just a really bad idea from a security standpoint and we shouldn't even offer the possibility to do so, IMHO. But if you really want to do it, you can export your database to a CSV file and parse it with your script. |
I would also vote against implementing this, it is not a good approach to send passwords/hashes of passwords to unknown websites on the web. Having the files locally would not help since they are huge and if you use a smaller version then what is the point in checking against a subset... |
@weslly @mihaiile When testing, I don't like waiting 5 minutes to parse 13+ GB of text (especially when testing @mihaiile I think it should be possible to implement a fast binary search on the text files (I believe they are in alphabetical order), if only by starting at byte (size / 2), reading to next newline, reading whole newline, checking if we need to go up/down, and going from there. |
SHA1-hashed passwords are basically plaintext. Never use SHA1 for passwords. |
Just an update to this issue: Briefly, you perform locally the SHA1 of your password (that you want to check against the haveibeenpwned service), you take the first 5 characters of the hash and make an API request. If your local hash matches one of the returned one, your password SHA1 is already known and you should change it. Note that if you always use a newly random generated password of a discreet length this will be a no problem at all. If you want to learn more check out "Cloudflare, Privacy and k-Anonymity" section in [1] or "How it works" in [2] [1] https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/ |
I am still absolutely against this. Such a database can only be useful in two cases:
In any other case, all that can leak to an attacker is a properly hashed and salted password and you can't provide a lookup database for that, so the service is useless. But guess how such a database can suddenly be filled with useful passwords... By you sending them your password to check if it has been compromised. I don't want to discredit the publisher of that database, but do we know what they are doing with our passwords? I strongly advise against sending out your passwords. EVER! Even if it's just the first five characters of the password's SHA-1 hash. SHA-1 is NOT a hash function suitable for password hashing and the fact that you cannot salt the hash, makes it really easy to pre-calculate rainbow tables. Or just use a GPU brute forcer. With a beefy GPU cluster, you can hash up to 8 billion passwords per second with a fast hash function like SHA-1 these days. For a completely random ASCII password (128 possible characters), ALL possible combinations of an 8-character password can be generated in about 104 days. Taking into account that you will find the correct hash on average after 50% of the time, that's 52 days. That still sounds like a lot (actually, it doesn't, but it's still a bit of time and money blown), but then, we are using a totally random password and if you feel like a database to check your password against is useful, you are probably using a lot less characters. With only English uppercase and lowercase letters and numbers, you crack an 8 character password in 7.5 hours (3.7 on average). Scary, right? So don't use those databases. Use a strong password instead! Actually, use many. You have a damn password manager! |
@phoerious you have a serious misunderstanding/under-estimation of how much thought has been put into the service. Pwned passwords uses k-anonymity. The password or it's hash is never sent to any 3rd-party. Ever: See |
"in no way whatsoever" and "possibly online too" contradict each other. #551's initial issue description doesn't mention online services, which is why I hadn't posted there. The other mentions of HIBP have been shot down unceremoniously (and of course unfairly in my mind) as a bad idea. I'll move further comments there however. |
@zatricky The service is well thought, but It doesn't have much utility if you already use a password manager. In a password manager you can generate very long random passwords every time (and you should), so the probability of one being leaked is pretty low and the leak needs to be plaintext since you can't crack a very long password easily if it's stored as hash. An integration with haveIbeenpwnd is much more usefull. |
Going through #551 I realised it is more about UI than anything else, whereas this topic is more about backend support for things like the HIBP service. Discussion re HIBP there would actually be off-topic/spammy. I agree that you shouldn't need a service such as HIBP if you only use generated passwords. Legacy dictates however that most users don't exclusively use generated passwords and don't follow password hygiene processes (something #551 will help rectify). I don't agree with your example as a weakness - in that it addresses "knownpass" but not "knownpass1". It's not ever intended to address "knownpass1". It's intended to address the fact that "knownpass" is a known password hackers can actively use in their password-guessing attempts. |
The concerns I see so far:
*Useful tools:
|
Mozilla announced it's integrating HIBP into (a) Firefox (extension?). And… drumm roll a competitor (i.e. a different password manager) is integrating this feature! I've explained this in detail in issue #2073, but here are the main point's on how I consider such an integration a very nice thing:
So you may wonder why use it, if we already use a password manager?
Bottom line is: Please reopen this issue. HIBP's API has been improved quite much, you already use network stuff for unimportant things (favicons), so you may use it for this here, too. BTW everyone who wants this, upvote the initial issue. |
As for the anonymity again, some extracts from Troy Hunt's blog, where he explained that in detail:
The Cloudflare article get's deeper into the math:
(highlighting by me) Small FAQ from me:
Also, please don't get into the "I don't want this/have no use case for this. This feature must be crap." attitude. Obviously many people requested it and the initial reason to close this issue (i.e. SHA-1 with full hash) is no longer valid. Please re-open this.I thought KeePassXC wants to do better and integrate nice features compared to KeePassX. |
I want to integrate new features, but not feel-good snake oil. The website is literally a giant advertisement for 1Password. If you can't see that, look closer at how many "SIGN UP FOR 1PASSWORD" links there are on every page. The dude is probably getting kickbacks for each referral sign up. |
We can just agree that maybe it will be implemented, maybe in the password analyzer, but not a top priority. |
Don't show the exact count because it's essentially meaningless, just show some estimated severity. Fixes keepassxreboot#1083
Thanks for the input again. Great community here :) Now sorting the HIBP table in descending order by how many times a password has been exposed. Also shortened the title a bit (don't want to use more horizontal space than necessary, in both the table header and cells). Won't use HIBP padding mode, it's not worth the cost (not even to add a checkbox to offer it as an option -- very few users would understand what the checkbox is about, and KeePassXC settings have more than enough checkboxes already.) So, I'd call online HIBP checks done. Will submit a PR so you can check it out yourselves, and then continue with offline checks. Stay healthy everyone. |
@droidmonkey How's the current planning for release 2.6.0? Would you like HIBP online checks in 2.6.0 already? Asking because from my point of view the PR could be merged, yet it's marked as WIP because offline checks aren't implemented yet. If you wish I'll un-WIP the PR so that online checks can go into 2.6.0, leaving offline checks for the 2.7.0. |
This will make 2.6.0. We are coming close to feature lock, perhaps in 2 weeks. Leave offline checks for another version. |
Awesome. PR un-WIPed. Looking forward to your review. Will submit a second PR for offline checks when they are done (probably not within the next two weeks). |
* Fixes keepassxreboot#1083 * Add online HIBP checker dialog to the database reports widget. Permission is requested from the user prior to performing any network operations. * The number of times a password has been found in a breach is shown to the user. * If no passwords are breached then a positive message is presented. * Source of HIBP icon: https://github.com/simple-icons/simple-icons/blob/develop/icons/haveibeenpwned.svg
Your BIOS password has been exposed "millions of times"… 🤣 |
* Fixes keepassxreboot#1083 * Add online HIBP checker dialog to the database reports widget. Permission is requested from the user prior to performing any network operations. * The number of times a password has been found in a breach is shown to the user. * If no passwords are breached then a positive message is presented. * Source of HIBP icon: https://github.com/simple-icons/simple-icons/blob/develop/icons/haveibeenpwned.svg
@rugk we really need the option to mark entries as "I know this is a bad password, you don't have to tell me anymore" (#4168), which would exclude them from Health Check as well as from HIBP. My ATM PIN has also been exposed millions of times (just like any other sequence of four digits) but there's nothing I can do about it, so there's no point in reporting it over and over again. |
* Fixes keepassxreboot#1083 * Add online HIBP checker dialog to the database reports widget. Permission is requested from the user prior to performing any network operations. * The number of times a password has been found in a breach is shown to the user. * If no passwords are breached then a positive message is presented. * Source of HIBP icon: https://github.com/simple-icons/simple-icons/blob/develop/icons/haveibeenpwned.svg
* Fixes #1083 * Add online HIBP checker dialog to the database reports widget. Permission is requested from the user prior to performing any network operations. * The number of times a password has been found in a breach is shown to the user. * If no passwords are breached then a positive message is presented. * Source of HIBP icon: https://github.com/simple-icons/simple-icons/blob/develop/icons/haveibeenpwned.svg Authored-by: Wolfram Rösler <[email protected]> Co-authored-by: Jonathan White <[email protected]>
Oops that might be my fault |
I really appreciate your work, @droidmonkey and @wolframroesler . |
Of course, why should they not be? |
I have 116 expired entries in my database. All of them are for services, that I no longer use and some of them are services that are no longer available. So I moved them all to a folder called "Abgelaufen" (what means "Expired") where I also set "Search" and "Auto-Type" to "Disabled" (so they are not found and not used for Auto-Type. So these entries are old, mainly never used but it is disturbing if they inflate the health check.
I really hope you implement 1. or 2. because I think there are other people that have expired entries and want to exclude them from the health check and HIBP checl. |
I like option 2, could also be a database setting that is stored in the custom data. |
See #4531 for fixes. |
When I wrote the last comment, then the 4th option did not came into my mind:
I think this is the best and simple solution. |
I created the new issue Health Check - Exclude MULTIPLE entries from check (#4533) |
Locking this conversation as it is very long and multiple other issues have spawned from it. |
haveibeenpwned.com has an API to check if passwords have been released in a previous dump.
They also provide a sha1-hashed download of their password dump at https://haveibeenpwned.com/Passwords .
Their API guideline is available here: https://haveibeenpwned.com/API/v2
Expected Behavior
Ability to check all or a selection of passwords against a password dump (either downloaded or online)
Current Behavior
Currently, KeepassXC does not check against a list of passwords that has been previously compromised.
Possible Solution (bash)
Note: Above script checks offline for security (slow). It can be modified to check online for testing.
Context
I would like to check for passwords that have been compromised in a breach or set of breaches.
I can currently do this manually with a modified version of the above script, but it is cumbersome and not as secure.
EDIT:
echo ${i} -> echo -n ${i}
Add note to script that it is meant for proof of concept and can be modified for offline use.
Modify script to check offline
The text was updated successfully, but these errors were encountered: