Skip to content

Commit 71df554

Browse files
committed
lib/Crypto/Phpass: support new hashes of wordpress 6.8
1 parent 5cdb45b commit 71df554

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Crypto/Phpass.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public function __construct(IL10N $localization, $iterationCount = 8)
5353
*/
5454
public function checkPassword($password, $dbHash, $salt = null)
5555
{
56+
// WordPress 6.8 upgraded password hashing for bcrypt
57+
// https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/
58+
if (str_starts_with( $dbHash, '$wp' )) {
59+
$password_to_verify = base64_encode( hash_hmac( 'sha384', $password, 'wp-sha384', true ) );
60+
return password_verify( $password_to_verify, substr( $dbHash, 3 ) );
61+
}
5662
return hash_equals($dbHash, $this->crypt($password, $dbHash));
5763
}
5864

0 commit comments

Comments
 (0)