From c5c7691c85c84a1b5e1efbabefbfedeff7867164 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 8 Apr 2014 18:07:28 +0000 Subject: [PATCH] Harden HMAC verification. props duck_. [28053] for 3.7. git-svn-id: https://develop.svn.wordpress.org/branches/3.7@28055 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pluggable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index 6839b015ac..e340fc725c 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -546,7 +546,7 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') { $key = wp_hash($username . $pass_frag . '|' . $expiration, $scheme); $hash = hash_hmac('md5', $username . '|' . $expiration, $key); - if ( $hmac != $hash ) { + if ( hash_hmac( 'md5', $hmac, $key ) !== hash_hmac( 'md5', $hash, $key ) ) { do_action('auth_cookie_bad_hash', $cookie_elements); return false; }