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 }}
Repository navigation
Legacy MD5 password check uses a loose comparison #474
w2p_Authenticators_SQL::authenticate() (L24) upgrades old MD5 passwords with:
if (md5($password) == $result['user_password']) {
== between two numeric-looking strings compares them as numbers, so any stored hash of the form 0e followed by digits matches any password whose MD5 also has that form ("magic hashes"). This only affects accounts that still have an unconverted 32-character MD5 hash, but those are exactly the old, rarely used accounts.
Fix:hash_equals($result['user_password'], md5($password)). The SQL quoting in the same method is covered by #442.
Found by reading the code on dev-5.0.0 @ 179b4eaf; not yet reproduced on a running install.
Activity
Compare legacy MD5 passwords with hash_equals()