Skip to content

Commit

Permalink
Hardening: Use a properly generated hash for the newbloguser key in…
Browse files Browse the repository at this point in the history
…stead of a determinate substring.

Merges [42258] to the 3.8 branch.

Built from https://develop.svn.wordpress.org/branches/3.8@42308


git-svn-id: http://core.svn.wordpress.org/branches/3.8@42137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
johnbillion committed Nov 29, 2017
1 parent c2a62a9 commit 186eae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-admin/user-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function admin_created_user_subject( $text ) {
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();
Expand Down

0 comments on commit 186eae2

Please sign in to comment.