Skip to content

Commit 3234ade

Browse files
committed
Harden HMAC verification. props duck_.
git-svn-id: https://develop.svn.wordpress.org/trunk@28053 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bef5bdc commit 3234ade

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/pluggable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') {
647647
$key = wp_hash($username . $pass_frag . '|' . $expiration, $scheme);
648648
$hash = hash_hmac('md5', $username . '|' . $expiration, $key);
649649

650-
if ( $hmac != $hash ) {
650+
if ( hash_hmac( 'md5', $hmac, $key ) !== hash_hmac( 'md5', $hash, $key ) ) {
651651
/**
652652
* Fires if a bad authentication cookie hash is encountered.
653653
*

0 commit comments

Comments
 (0)