From 0aa2902436a858cdb9d6fd4856ed30b21e20f541 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 28 Jun 2018 02:38:43 +0000 Subject: [PATCH] Security: Harden the random aspect of the hash used for user profile and admin email address changes. Props BjornW Fixes #43771 Built from https://develop.svn.wordpress.org/trunk@43367 git-svn-id: http://core.svn.wordpress.org/trunk@43195 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/misc.php | 2 +- wp-includes/user.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index db04526165..00397dd564 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -1205,7 +1205,7 @@ function update_option_new_admin_email( $old_value, $value ) { return; } - $hash = md5( $value . time() . mt_rand() ); + $hash = md5( $value . time() . wp_rand() ); $new_admin_email = array( 'hash' => $hash, 'newemail' => $value, diff --git a/wp-includes/user.php b/wp-includes/user.php index e3fb895f3d..73c3f3c2fe 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2726,7 +2726,7 @@ function send_confirmation_on_profile_email() { return; } - $hash = md5( $_POST['email'] . time() . mt_rand() ); + $hash = md5( $_POST['email'] . time() . wp_rand() ); $new_user_email = array( 'hash' => $hash, 'newemail' => $_POST['email'], diff --git a/wp-includes/version.php b/wp-includes/version.php index f25b3f5731..3a5d2880a0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43365'; +$wp_version = '5.0-alpha-43367'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.