Hardening: Use a properly generated hash for the `newbloguser` key instead of a determinate substring.

Merges [42258] to the 4.1 branch.

Built from https://develop.svn.wordpress.org/branches/4.1@42296


git-svn-id: http://core.svn.wordpress.org/branches/4.1@42125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2017-11-29 16:36:28 +00:00
parent 3c4befe52b
commit 3d3b4558d6
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) );
$redirect = add_query_arg( array('update' => 'addnoconfirmation'), '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();