Skip to content

Commit a826ee2

Browse files
committed
Hardening: Use a properly generated hash for the newbloguser key instead of a determinate substring.
Merges [42258] to the 3.7 branch. git-svn-id: https://develop.svn.wordpress.org/branches/3.7@42312 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bcaf39e commit a826ee2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-admin/user-new.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function admin_created_user_subject( $text ) {
7272
add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) );
7373
$redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' );
7474
} else {
75-
$newuser_key = substr( md5( $user_id ), 0, 5 );
75+
$newuser_key = wp_generate_password( 20, false );
7676
add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST[ 'role' ] ) );
7777

7878
$roles = get_editable_roles();

0 commit comments

Comments
 (0)