From ecd15e008aa8fff01b12279fa52990ea2f648249 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 29 Nov 2017 16:08:41 +0000 Subject: [PATCH] Hardening: Use a properly generated hash for the `newbloguser` key instead of a determinate substring. Merges [42258] to the 4.9 branch. Built from https://develop.svn.wordpress.org/branches/4.9@42264 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42093 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/user-new.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index ebcd2a7dca..641fd822fd 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -75,7 +75,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) { $redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' ); } } else { - $newuser_key = substr( md5( $user_id ), 0, 5 ); + $newuser_key = wp_generate_password( 20, false ); add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST[ 'role' ] ) ); $roles = get_editable_roles(); diff --git a/wp-includes/version.php b/wp-includes/version.php index c80a59bd8f..8359e2faac 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.1-beta1-42254'; +$wp_version = '4.9.1-beta1-42264'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.