Opened 13 years ago
Closed 5 months ago
#22114 closed feature request (fixed)
Propagating password on change
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 3.4.2 |
| Component: | Users | Keywords: | has-patch has-unit-tests 2nd-opinion |
| Focuses: | Cc: |
Description
After creating an account or changing profile information, it is possible to intercept the changed data in a hook. However, this is not possible for the cleartext psasword, and this is a useful feature especially when propagating a password change over different accounts spanning across different systems (in contexts such as updating the password for phpBB, Prestashop, or any PAM thingie when the WordPress password is changed).
Since this feature is by no means possible to implement without core hacks, I am submitting a patch to include this feature in the WP core.
This patch proves useful if we are to integrate other software bricks without having to implement SSO using WordPress' architecture. In my context, I need to be able to log-in through WordPress or directly through the business specific back-end.
Proposed patch is attached.
Attachments (2)
Change History (39)
#1
@
13 years ago
- Keywords close added
With this change, it would be possible for any plugin to record the user's password without telling them about it. -1.
#2
@
13 years ago
scribu: pretty much like any plugin can insert its own crap using content filters (and capture the password using $_POST if it has an admin_init hook) :/ Not a problem per se IMO.
#3
@
13 years ago
True. Still, this hook encourages devs to mess with plaintext passwords, when there are possibly better alternatives.
#4
@
13 years ago
- Keywords 2nd-opinion added
As Rob Miller (on wp-hackers) said, "any plugin could access a user's plaintext password even now and has always been able to, by hooking into wp_login and then examining the POST variables".
Hence, I'd rather go for implementing it clearly, instead of doing it through hacks. Maybe another opinion would be useful? Instead of keeping stuff dirty, pushing them into the API is a better option, as whatever dirty or unsafe things devs will want to do, they'll be able to do no matter how much you restrict them from trying to do so.
#5
follow-up:
↓ 6
@
13 years ago
That's like saying "people are going to shoot themselves in the foot anyway, so we might as well give them some bullets."
#6
in reply to:
↑ 5
@
13 years ago
Replying to scribu:
That's like saying "people are going to shoot themselves in the foot anyway, so we might as well give them some bullets."
+1 to this, I don't think we should encourage the ability to easily grab a plaintext password, ever.
#8
@
11 years ago
- Keywords close 2nd-opinion removed
The patch seems sane to me, so +1 from me (although a filter rename to user_password_updated wouldn't go astray IMHO)
There's no way around it - If you're implementing a SSO system where WordPress users exist elsewhere, you need access to the plaintext password, which you currently have by checking a variety of $_POST fields.
Adding an action, clearly intended as a way to perform an action upon user password updating (be it auditing, SSO, or invalidation) seems sane, and having the users password available on that hook seems appropriate.
Plugins have full reign over the environment already, it's not worth pretending that the password is protected data that plugins shouldn't see, we don't have the ability to hide it, or control what plugins do with it, so instead we trust plugins that a user has installed on their site.
#9
follow-up:
↓ 10
@
11 years ago
- Keywords needs-patch added; has-patch removed
It would need to be implemented in both wp_insert_user() and wp_update_user(), so that we expose the password of new users, too.
I wonder if this would be better as a filter? That way, a plugin (say, a password strength enforcement plugin) could return a WP_Error if the password is unacceptable, which can be returned to the calling function.
#10
in reply to:
↑ 9
@
10 years ago
Replying to pento:
It would need to be implemented in both
wp_insert_user()andwp_update_user(), so that we expose the password of new users, too.
I wonder if this would be better as a filter? That way, a plugin (say, a password strength enforcement plugin) could return a
WP_Errorif the password is unacceptable, which can be returned to the calling function.
This could be a good idea, but what happens if 2 plugins both intercept the hook. 1 uses it to update remote site passwords, and the other does filtering on allowable passwords and returns an error. Then the remote sites would now be set to a new password which is not allowed, and hasn't been changed.
Thoughts?
#12
@
10 years ago
- Keywords has-patch needs-refresh added; needs-patch removed
- Owner set to chriscct7
- Status changed from new to assigned
#15
@
17 months ago
- Keywords needs-refresh added; commit removed
@chriscct7 Are you able to update the patch with a docblock? I can do so if you'd like to write one up in the ticket.
#16
@
17 months ago
I think this should call the wp_set_password action which we've already got in wp_set_password(). No need for a new action.
This ticket was mentioned in PR #7464 on WordPress/wordpress-develop by @davidbaumwald.
17 months ago
#17
- Keywords needs-refresh removed
@davidbaumwald commented on PR #7464:
17 months ago
#18
@johnbillion Looking at Gary's comment in Trac:
It would need to be implemented in both
wp_insert_user()andwp_update_user(), so that we expose the password of new users, too.
... should we call this action near https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/user.php#L2416 as well?
#19
@
17 months ago
- Milestone changed from 6.7 to 6.8
This is very close, and has a path forward, but with one remaining question. With 6.7 Beta 1 releasing shortly, this is being moved to 6.8 given recent momentum towards a resolution.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
13 months ago
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
12 months ago
#22
@
12 months ago
- Milestone changed from 6.8 to 6.9
As per today's bug scrub: since this ticket didn't move during the 6.8 cycle, I'm moving it to milestone 6.9.
#23
@
9 months ago
The use case is clear, and the patch could help with syncing password changes.
However, could you clarify how the patch securely handles the password during propagation, especially given that WordPress doesn’t store cleartext passwords? Would love to see how this maintains security best practices.
I agree this feature would be very helpful in multi-system environments. Propagating password changes securely without relying on SSO is a valid use case, especially for legacy systems.
Supporting this in core would enable better integrations for developers.
This ticket was mentioned in PR #9244 on WordPress/wordpress-develop by @nimeshatxecurify.
7 months ago
#24
- Keywords has-unit-tests added
Fires a wp_set_password action whenever a user is created or updated.
This ticket was mentioned in Slack in #core by nimeshatxecurify. View the logs.
7 months ago
This ticket was mentioned in Slack in #core by benjamin_zekavica. View the logs.
7 months ago
#27
@
7 months ago
- Keywords 2nd-opinion added
The code needs to be reviewed before testing, so I am adding the 2nd-opinion.
This ticket was mentioned in Slack in #core by francina. View the logs.
6 months ago
This ticket was mentioned in PR #9470 on WordPress/wordpress-develop by @davidbaumwald.
6 months ago
#30
Trac ticket: https://core.trac.wordpress.org/ticket/22114
Supersedes #7464.
#32
@
6 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
@davidbaumwald [60634] has caused wp_insert_user() to pass $old_user_data as an array instead of an object.
This ticket was mentioned in PR #9482 on WordPress/wordpress-develop by @davidbaumwald.
6 months ago
#33
#34
@
6 months ago
@dd32 Since there is no "old" data for a user on initial creation, I see 3 options:
- Update the docblock here to accept either
false(which would indicate there was no previous user data) or aWP_User. - Pass an empty
WP_Userobject, or - Pass the exact same, new
WP_Userobject from the line above.
LMK what you think and if you see another, better option.
Patch (wp-includes/user.php) for propagating cleartext passwords through an action