-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Do password hashing properly #9942
Conversation
a394c93
to
7afdf9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chocobo1, why don't you use QCryptographicHash just with more complex algorithm (SHA512)?
It is too weak for this purpose, you may look up "Key stretching". |
bbec58e
to
e5429e6
Compare
PR updated: resolved all comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Untested though.
IMO, PR scope looks good. But I wonder if we should do more for the nox users. I assume they have set it up to run as a daemon and may not realize the daemon doesn't run due to this change. Or maybe target this for 4.2.0? Any thoughts? |
The mitigation action will look like this: // pseudo code
void AuthController::loginAction()
{
const bool passwordEqual = Utils::Password::PBKDF2::verify(secret, passwordFromWeb);
if (!passwordEqual) {
const bool oldPasswordEqual = // load previous webui password and verify it using previous method
if (oldPasswordEqual)
// update webui password using new method
else
// authentication failed
}
} While it is convenient for WebAPI users, we probably need to keep this mitigation code forever...
Should be better than breaking WebAPI users in a qbt minor release, this PR is still eligible for merging into master right? |
I would have no problem if this goes into master. I just hope it won't make backporting other commits harder. |
PR updated: resolved conflicts in |
Only print the WebUI username when password is still the default.
Can you please add the OpenSSL version to the It has bugged me forever that I can never tell what OpenSSL version qBittorrent was built on (without asking someone). |
@Chocobo1 I don't know the level of paranoid we should be about this but just in case:
Just suggestions. They are not required for merging this. |
OK, but will do it in another PR.
I don't think this is the correct way (or any better), since we already use a lengthy salt that is infeasible for the hacker to pre-compute, and besides (in the extreme case) the hacker can just use 100.000 as a start and iterate all the way up to 120.000.
We can but we need to find & include another library, using openssl is the cheapest in this matter :P |
Thanks for the review! |
While compiling from master, I'm seeing a linking error now:
|
A |
@thalieht Thx, it worked for me as well. |
Could you update the WebAPI documentation for get/set preferences with this change? It still talks about md5 hashes. |
Done, I presume it will start taking effect in API v.2.3.0. |
Whatever the API will be in v4.2.0. This wasn't backported to the v4.1.x series. |
Some notes:
This basically means even if bad actor acquired your password hash, he won't be able to easily compute your real password (assuming the real password is good enough for brute force attack).