? ? Failure

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
28 Oct 2018

Summary of Changes

With this change we make sure the reset token is invalidated (set to another value) when the account mail is changed.

Testing Instructions

  • Create an new user.
  • request an PW reset
  • check that the mail got out
  • login (without resetting the PW)
  • change the email (Frontend or Backend)
  • try to reset the PW with the reset token send to the old mail

Expected result

With this patch this is not possible any more as the token has been changed at the time the mail has been changed

Actual result

Without this patch the old token still works.

Documentation Changes Required

none.

Other notes

This issue has been reported to the JSST by Ramesh From J2store (@rameshelamathi) but the JSST decided to fix this in the public tracker. Thanks!

cc @joomla/security @SniperSister @mbabker

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar zero-24 zero-24 - open - 28 Oct 2018
avatar zero-24 zero-24 - change - 28 Oct 2018
Status New Pending
avatar zero-24 zero-24 - change - 28 Oct 2018
Milestone Added:
avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2018
Category Administration com_users Front End
avatar zero-24 zero-24 - change - 28 Oct 2018
The description was changed
avatar zero-24 zero-24 - edited - 28 Oct 2018
avatar mbabker
mbabker - comment - 28 Oct 2018

You might as well just blank out the token. Unless you're sending the new token to the user it's unusable anyway.

avatar zero-24 zero-24 - change - 28 Oct 2018
Labels Added: ?
avatar zero-24
zero-24 - comment - 28 Oct 2018

You might as well just blank out the token. Unless you're sending the new token to the user it's unusable anyway.

Well this token / activation field also applys to the "Activation"
image

When we have an empty field this is marked as "Activated". I'm happy to apply any code just wanted to make sure the UI thing is not changed at all.

avatar mbabker
mbabker - comment - 28 Oct 2018

If the UI is solely relying on "token field is empty" IMO that's an issue too.

The problem you're running into now is you're changing the activation token and not giving the new token to the user. So if they try to activate the account with the token they already have, they won't be able to actually activate the account.

avatar zero-24
zero-24 - comment - 28 Oct 2018

The problem you're running into now is you're changing the activation token and not giving the new token to the user. So if they try to activate the account with the token they already have, they won't be able to actually activate the account.

Wich is exactly what is expected ;) But I'm happy to empty the token too.

avatar mbabker
mbabker - comment - 28 Oct 2018

I get the intent. But the user has no idea that changing their email is invalidating that token and they need a new one to finish the activation step. That's the issue I'm raising, without providing the new token it is now impossible for a user to activate their own account in this scenario.

avatar mbabker mbabker - change - 23 Nov 2018
Milestone Removed:
avatar zero-24
zero-24 - comment - 25 Mar 2019

@mbabker With the latest commit (e446cd3) I have implemented an user notification feature is this something you where looking for? Basically restarting the verification process including sending mails etc.

avatar joomla-cms-bot joomla-cms-bot - change - 25 Mar 2019
Category Administration com_users Front End Administration com_users Language & Strings Front End
avatar zero-24 zero-24 - change - 25 Mar 2019
Labels Added: ?
avatar zero-24
zero-24 - comment - 25 Mar 2019

thanks @mbabker your comments have been adressed by the last commit. So you generally agree with the concept and I can ask Brian to take a look over my new strings?

avatar mbabker
mbabker - comment - 25 Mar 2019

Looks fine to me.

avatar zero-24
zero-24 - comment - 25 Mar 2019

thanks 👍

@brianteeman can you please give me feedback about the new strings I added here to be send as mail to the users when the mail has been changed:

COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_CHANGED_MAIL_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nBefore the latest confirmation the account mail has been changed so we need you to confirm the new mail please select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s"
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_CHANGED_MAIL_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nBefore the latest confirmation the account mail has been changed so we need you to confirm the new mail please select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s"
avatar brianteeman
brianteeman - comment - 25 Mar 2019

If I understand this correctly every time you say "mail" you should say "email address"

avatar zero-24
zero-24 - comment - 25 Mar 2019

Thanks just pushed the fix 👍

avatar zero-24
zero-24 - comment - 26 Mar 2019

Thanks @brianteeman This is ready now for testing 👍

avatar zero-24 zero-24 - change - 26 Mar 2019
Milestone Added:
avatar zero-24
zero-24 - comment - 27 Mar 2019

@Quy can you please double check but the strings should be correct now. Thanks for your review.

avatar HLeithner HLeithner - change - 2 Apr 2019
Milestone Removed:
avatar HLeithner HLeithner - change - 2 Apr 2019
Milestone Added:
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Title
[3.9] Make sure the reset token is invalidated when the email is changed and an token exists
Make sure the reset token is invalidated when the email is changed and an token exists
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Title
[3.9] Make sure the reset token is invalidated when the email is changed and an token exists
Make sure the reset token is invalidated when the email is changed and an token exists
avatar franz-wohlkoenig franz-wohlkoenig - edited - 11 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Title
Make sure the reset token is invalidated when the email is changed and an token exists
[3.9] Make sure the reset token is invalidated when the email is changed and an token exists
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Title
Make sure the reset token is invalidated when the email is changed and an token exists
[3.9] Make sure the reset token is invalidated when the email is changed and an token exists
avatar franz-wohlkoenig franz-wohlkoenig - edited - 11 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category Administration com_users Front End Language & Strings Administration com_users Front End
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2019
Category Administration com_users Front End Administration com_users Language & Strings Front End
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category Administration com_users Front End Language & Strings Administration com_users Front End
avatar joomla-cms-bot joomla-cms-bot - change - 16 Apr 2019
Category Administration com_users Front End Administration com_users Language & Strings Front End
avatar ReLater
ReLater - comment - 17 Apr 2019

Because I had some problems to understand the new procedure yesterday ("in a terribly tired mood"): Are the testing instructions still correct after additional commits? I had some problems to test this pr. When I tried to change the email I got a message like "Change your password, too" but when I tried that, I couldn't save the profile and saw the same message.

Old or newly created password: Always the same message.

17-04-_2019_13-00-50

It looks like, that after any attempt to save the profile with a new email a new activation email is sent but the page doesn't inform the user accordingly. I've found these emails this morning.

I tested again today. > I get the activation email and cllick the link after steps above and get:
17-04-_2019_13-11-32

I don't know if relevant: My settings:

17-04-_2019_12-53-40

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[3.9] Make sure the reset token is invalidated when the email is changed and an token exists
Make sure the reset token is invalidated when the email is changed and an token exists
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[3.9] Make sure the reset token is invalidated when the email is changed and an token exists
Make sure the reset token is invalidated when the email is changed and an token exists
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar zero-24 zero-24 - change - 21 Apr 2019
Labels Removed: J3 Issue
avatar HLeithner HLeithner - change - 23 Apr 2019
Milestone Removed:
avatar HLeithner HLeithner - change - 23 Apr 2019
Milestone Added:
avatar gwsdesk
gwsdesk - comment - 27 Apr 2019

This is not working for me. Patched J3.9.5 with Michael's baby. Steps taken for testing as described above. PW request has been send and is received by new user. Logging in on frontened, changing email in the profile and trying to save gives

Warning
Profile could not be saved: Could not bind profile data: Passwords do not match. Please re-enter password.

If in the user manager keep using the new email and try to safe (after the patch) gives

Error
Save failed with the following error: Passwords do not match. Please re-enter password.

Trying to do the same with keeping the old email in the user manager in the backend gives

Error
Save failed with the following error: You can't reuse your current password, please enter a new password.

avatar gwsdesk
gwsdesk - comment - 27 Apr 2019

I have tested this item 🔴 unsuccessfully on a876bd8

see my comment


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22843.

avatar gwsdesk gwsdesk - test_item - 27 Apr 2019 - Tested unsuccessfully
avatar zero-24
zero-24 - comment - 11 May 2019

thanks @ReLater and @gwsdesk the issue should be gone now by the latest commit.

avatar Milglius
Milglius - comment - 24 May 2019

Why drone pr is failing?

avatar zero-24
zero-24 - comment - 24 May 2019

It seams the JavaScript tests are having problems. Drone has been rebooted: https://ci.joomla.org/joomla/joomla-cms/18687

avatar AndySDH
AndySDH - comment - 12 Jun 2019

Milestone for this should now be changed to 3.9.9

avatar zero-24
zero-24 - comment - 16 Jun 2019

@ReLater @gwsdesk can I ask you to take a look here again as the reported issues should be fixed now. Thanks

avatar tecpromotion tecpromotion - test_item - 28 Jun 2019 - Tested successfully
avatar tecpromotion
tecpromotion - comment - 28 Jun 2019

I have tested this item successfully on 60c4553

I've tested this issue successfully with 3.9.8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22843.

avatar tecpromotion
tecpromotion - comment - 28 Jun 2019

I have tested this item successfully on 60c4553

I've tested this issue successfully with 3.9.8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22843.

avatar zero-24
zero-24 - comment - 5 Aug 2019

Any update here @bembelimen ?

avatar zero-24
zero-24 - comment - 28 Oct 2019

Any update here @bembelimen ?

avatar zero-24
zero-24 - comment - 13 Jan 2020

Any update here @bembelimen ?

avatar wilsonge
wilsonge - comment - 17 Feb 2020

@zero-24 let's add the check for the user blocked status ben proposed and then get some testing. This is well overdue going in

avatar joomla-cms-bot joomla-cms-bot - change - 18 Feb 2020
Category Administration com_users Front End Language & Strings Administration com_users Language & Strings
avatar zero-24
zero-24 - comment - 18 Feb 2020

Done thanks @wilsonge @bembelimen ready for testing again :)

avatar wilsonge
wilsonge - comment - 18 Feb 2020

@joomla/security can you please do some testing here

avatar ReLater
ReLater - comment - 29 Mar 2020

One issue found. Perhaps it's just a Route class problem and not related to this pr!! (No, see next comment):

  • Super User creates account (Registered). back-end

  • Registered User gets welcome email and logs in

  • Registered User requests password reset and got email.

  • Super User changes email address. back-end

  • Registered User gets immediately the following email text to the new email address with incomplete URL (domain missing).

30-03-_2020_01-23-20

What's relevant here is that I have not activated SSL in Joomla but on host side.

user.php line 206 and 207:

$linkMode = (int) $app->get('force_ssl', 0) == 2 ? Route::TLS_FORCE : Route::TLS_IGNORE;

$data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode);

When I use hard coded:

$linkMode = Route::TLS_FORCE;

The $data['activate'] URL is correct (with domain part).

avatar ReLater
ReLater - comment - 29 Mar 2020

The $data['activate'] URL is correct (with domain part).

but it leads to a 403 page

30-03-_2020_01-51-40

30-03-_2020_01-55-41

avatar zero-24
zero-24 - comment - 30 Mar 2020

Thanks @HLeithner

avatar zero-24
zero-24 - comment - 10 May 2020

@ReLater can you give this one a second test round after the patch for the issue?

avatar zero-24 zero-24 - change - 17 Oct 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-10-17 09:42:42
Closed_By zero-24
avatar zero-24 zero-24 - close - 17 Oct 2020
avatar zero-24 zero-24 - change - 17 Oct 2020
Status Closed New
Closed_Date 2020-10-17 09:42:42
Closed_By zero-24
avatar zero-24 zero-24 - change - 17 Oct 2020
Status New Pending
avatar zero-24 zero-24 - reopen - 17 Oct 2020
avatar zero-24
zero-24 - comment - 17 Oct 2020

Hmm I'm not sure whats up with AppVeyor but this PR is up-to-date with staging now.

avatar Quy
Quy - comment - 27 Oct 2020

Please fix phpcs.

avatar zero-24 zero-24 - change - 7 Apr 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-04-07 17:19:57
Closed_By zero-24
avatar zero-24 zero-24 - close - 7 Apr 2021

Add a Comment

Login with GitHub to post a comment