You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.
Because "==" is being used instead of hash_equals(), the following passwords, when compared with their md5 hashes, would be all registered as equal in the auth code:
(Format is "password:md5(password))
Because the hashes are in format: 0e[0-9], PHP will treat the string as an integer when doing loose comparisons. In that notation, they all evaluate as being int(0), causing them to be equal.
Note:
This is a low-ish severity issue, (requires someone to have a password that md5's to that exact format), just something I figured should be pointed out.
Thanks to @mjrider for correcting my original solution.
The text was updated successfully, but these errors were encountered:
The following code in User.php is vulnerable to PHP type juggling and timing attacks:
Because "==" is being used instead of hash_equals(), the following passwords, when compared with their md5 hashes, would be all registered as equal in the auth code:
(Format is "password:md5(password))
240610708:0e462097431906509019562988736854
QNKCDZO:0e830400451993494058024219903391
aabg7XSs:0e087386482136013740957780965295
Because the hashes are in format: 0e[0-9], PHP will treat the string as an integer when doing loose comparisons. In that notation, they all evaluate as being int(0), causing them to be equal.
($user['password'] == $password)
Should be changed to:
hash_equals($user['password'], $password)
More Type Juggling Information:
https://www.owasp.org/images/6/6b/PHPMagicTricks-TypeJuggling.pdf
Note:
This is a low-ish severity issue, (requires someone to have a password that md5's to that exact format), just something I figured should be pointed out.
Thanks to @mjrider for correcting my original solution.
The text was updated successfully, but these errors were encountered: