#55335 closed defect (bug) (fixed)
$user_login double escaped with incorrect/empty password in wp-login.php
Reported by: | johnjamesjacoby | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Login and Registration | Keywords: | 2nd-opinion has-patch |
Focuses: | Cc: |
Description
First:
if ( isset( $_POST['log'] ) ) { $user_login = ( 'incorrect_password' === $errors->get_error_code() || 'empty_password' === $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : ''; }
Then:
<input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" />
Fix is to late escape only, and remove the top one.
Change History (11)
This ticket was mentioned in Slack in #core by rajinsharwar. View the logs.
14 months ago
#7
@
5 months ago
- Keywords 2nd-opinion added
Pretty minor change, adding 2nd opinion if we really need this change.
This ticket was mentioned in PR #6952 on WordPress/wordpress-develop by @narenin.
5 months ago
#8
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/55335
#9
@
5 months ago
- Milestone changed from Awaiting Review to 6.7
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
@SergeyBiryukov commented on PR #6952:
5 months ago
#11
Thanks for the PR! Merged in r58623.
Note: See
TracTickets for help on using
tickets.
Relatedly,
'register'
action is doublewp_unslash()
ing$user_email
and$user_login
.