#14803 closed enhancement (fixed)
Admins should be warned if authentication keys and salts have the default phrase
Reported by: | coffee2code | Owned by: | duck_ |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.0.1 |
Component: | Security | Keywords: | has-patch ux-feedback |
Focuses: | Cc: |
Description
WordPress already warns admin users if any of the eight authentication keys/salts are not present in the wp-config.php. (See secret_salt_warning()
in wp-admin/includes/ms.php) While performing that check, WP should also see if any of the keys/salts are using the default string of "put your unique phrase here".
The default string is pre-set for all eight keys/salts that ship in wp-config-sample.php. While the inline documentation indicates that those values should be changed, there is no notice or prompting to alert/remind the admin if the default string is left intact.
Bear in mind that wp_salt()
(in wp-includes/pluggable.php) ignores the keys/salts that use the default phrase or are blank strings, so security isn't compromised. However, if we want the admins to define secure phrases in wp-config.php, we should make them aware when that's not the case.
The attached patch modifies secret_salt_warning()
to also check that the keys/salts aren't using the default phrase and aren't blank strings (same check as done in wp_salt()
). If any are, the warning message provides a link to the wordpress.org secret key service.
See the attached image to see an example where I've removed LOGGED_IN_SALT from wp-config.php (the error message for that is already what WP generates) and where I've left the default phrase in place for AUTH_KEY and AUTH_SALT and set NONCE_SALT to (triggering the error message added by the attached patch).
Attachments (5)
Change History (13)
#1
@
14 years ago
I think we can probably merge these into a cleaner, single message nag.
Also, this only shows for multisite super admins. Maybe we should show it for single-site admins too? Originally brought up in #11764.
#2
@
14 years ago
We could also use a unique salt per user and per session. And bcrypt (i.e. blowfish) to hash passwords. And hmac to generate nonces. Instead of trying to reinvent the wheel.
http://php.net/manual/en/function.crypt.php
http://php.net/manual/en/function.hash-hmac.php
PHP pass, which is included in WP, has the needed code for bcrypt. hash_hmac becomes available with WP 3.2 assuming we target PHP 5.2.
#3
@
14 years ago
- Keywords ux-feedback added
14803.2.diff provides a patch for merged messages, ux-feedback for double checking the strings.
It does seem strange this function is provided for multisite users and not singlesite. I have also written a patch for the Health Check plugin if this check sticks in multisite only.
#6
@
11 years ago
Since [19771] for #19599, wp_salt()
will automatically create secret keys/salts if any key is duplicated or has the default value. Therefore, I think we can just remove this warning now, see 14803.remove.diff.
Patch mentioned in ticket.