mirror of
git://develop.git.wordpress.org/
synced 2025-01-29 18:48:18 +01:00
Privacy: Use a CSPRNG in export filenames for more security.
`rand()` is deterministic and therefore offers much less protection in this context. `wp_generate_password()` is a convenient wrapper around `wp_rand()`, which uses `random_int()` to generate cryptographically-secure psuedorandom numbers. Props iandunn. Merges [43045] to the 4.9 branch. See #43546. git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43094 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9a76fbceab
commit
f7518bfc6b
@ -1905,7 +1905,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
||||
|
||||
$stripped_email = str_replace( '@', '-at-', $email_address );
|
||||
$stripped_email = sanitize_title( $stripped_email ); // slugify the email address
|
||||
$obscura = md5( rand() );
|
||||
$obscura = wp_generate_password( 32, false, false );
|
||||
$file_basename = 'wp-personal-data-file-' . $stripped_email . '-' . $obscura;
|
||||
$html_report_filename = $file_basename . '.html';
|
||||
$html_report_pathname = $exports_dir . $html_report_filename;
|
||||
|
Loading…
x
Reference in New Issue
Block a user