Make WordPress Core


Ignore:
Timestamp:
01/19/2023 08:51:41 AM (23 months ago)
Author:
audrasjb
Message:

Login and Registration: Disable spellcheck for password fields.

This changeset adds spellcheck="false" attribute to various password fields.

The spellcheck global attribute defines whether the element may be checked for spelling errors. The false value indicates that the element should not be checked for spelling errors, which is relevant for a password field.

Furthermore, and as per MDN specs, using spellchecking can have consequences for users' security and privacy. The specification does not regulate how spellchecking is done and the content of the element may be sent to a third party for spellchecking results. Thus, it is recommended to set spellcheck attribute to false for elements that can contain sensitive information. Which is the case for password fields.

Props dziudek, audrasjb, gainesm, fosuahmed.
Fixes #56763.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r55042 r55094  
    639639                                    <div class="wp-pwd hide-if-js">
    640640                                        <span class="password-input-wrapper">
    641                                             <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="new-password" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
     641                                            <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="new-password" spellcheck="false" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
    642642                                        </span>
    643643                                        <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
     
    656656                                <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
    657657                                <td>
    658                                 <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="new-password" aria-describedby="pass2-desc" />
     658                                <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="new-password" spellcheck="false" aria-describedby="pass2-desc" />
    659659                                    <?php if ( IS_PROFILE_PAGE ) : ?>
    660660                                        <p class="description" id="pass2-desc"><?php _e( 'Type your new password again.' ); ?></p>
Note: See TracChangeset for help on using the changeset viewer.