?
avatar joni142
joni142
3 Apr 2021

Steps to reproduce the issue

If a user attempt to use the "forgot password" function at the frontend, the assigned user groups are lost.
Only the public group is active.

Normally the user groups should not be changed by an usage of the "forgot password" function.

Expected result

Actual result

System information (as much as possible)

Additional comments

Votes

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

avatar joni142 joni142 - open - 3 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 Apr 2021
avatar joni142 joni142 - change - 3 Apr 2021
Title
user loose user groups after password reset via frontend
4B7 user loose user groups after password reset via frontend
avatar joni142 joni142 - edited - 3 Apr 2021
avatar joni142 joni142 - change - 3 Apr 2021
Title
4B7 user loose user groups after password reset via frontend
[4B7] user loose user groups after password reset via frontend
avatar joni142 joni142 - edited - 3 Apr 2021
avatar brianteeman
brianteeman - comment - 3 Apr 2021

Can not confirm

avatar Jere2000
Jere2000 - comment - 3 Apr 2021

Yes i have the same issue.
After resetting the password all user group assignments are gone. Very annoying... i have to reassign all the users to the groups every time they reset their passwords.
I also noticed that the joomla log displays that a new user is being registered instead of a password reset. Maybe Joomla tries to register the existing user once more when the forgot-password function is used? Accordingly all user groups are overwritten.

PS: I have no extensions installed

avatar brianteeman
brianteeman - comment - 3 Apr 2021

If this was happening with just core user management then there would be thousands of reports. What extensions do you have installed - especially any plugins or components to manage login.

avatar joni142
joni142 - comment - 3 Apr 2021

No extensions are installed.
Tried it with a fresh joomla installation too, same problem.
After using the "forgot password" function the user group assignments are changed.

pictures from a fresh joomla installation
before:
image

after:
image

avatar brianteeman
brianteeman - comment - 3 Apr 2021

I see that you now have updated the title to indicate that this report is for joomla 4. I had assumed from the way that you wrote that you were referring to a live site and therefor a joomla 3 site

avatar brianteeman
brianteeman - comment - 3 Apr 2021

I have done a few tests. In each test there has been a change in the assigned user groups although not consistently the same groups.

Before

image

After

image

image

In addition as can be seen in the screenshots the user account is no longer marked as active.

Both of these are very serious issues so thank you for reporting them and I apologise again for misunderstanding that you were referring to joomla 3.

@richard67 please upgrade this to a release blocker

@joomla/security please review this as its a clear security issue

avatar joomdonation
joomdonation - comment - 3 Apr 2021

I can confirm the issue. Just tried and see the same error. I will look at it.

avatar brianteeman
brianteeman - comment - 3 Apr 2021

@joomdonation I double checked it a few times on J3 and no problem with the groups there

avatar joomdonation
joomdonation - comment - 3 Apr 2021

I only check on J4 as the reported issue is for J4.

avatar joomdonation
joomdonation - comment - 3 Apr 2021

So here is what I found:

  1. A quick fix would be change this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Table/User.php#L173 to
->whereIn($this->_db->quoteName('id'), array_values($this->groups));
  1. However, the root of the error seems causes from our database package DatabaseQuery class, method bindArray. I will try to make a PR to framework repo to fix this root error.
avatar PhilETaylor
PhilETaylor - comment - 3 Apr 2021

This should be a release blocker surely right?

avatar PhilETaylor
PhilETaylor - comment - 3 Apr 2021

This looks like a PHP 8 issue. Please report your PHP versions.

avatar richard67 richard67 - change - 3 Apr 2021
Labels Added: ?
avatar richard67 richard67 - labeled - 3 Apr 2021
avatar joni142
joni142 - comment - 3 Apr 2021

My PHP version is 7.4.14

avatar PhilETaylor
PhilETaylor - comment - 3 Apr 2021

ok cool maybe I was wrong then, well the proposed fix of using array_values() has been the fix for a lot of PHP 8 compatibility issues.

avatar brianteeman
brianteeman - comment - 3 Apr 2021

not php 8

avatar PhilETaylor
PhilETaylor - comment - 3 Apr 2021

PR #32990

avatar Quy Quy - change - 3 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-03 21:31:48
Closed_By Quy
Labels Added: ?
Removed: ?
avatar Quy Quy - close - 3 Apr 2021
avatar PhilETaylor
PhilETaylor - comment - 27 Apr 2021

#32990 was merged, please remove the release blocker tag on this issue.

avatar richard67 richard67 - change - 27 Apr 2021
Labels Removed: ?
avatar richard67 richard67 - unlabeled - 27 Apr 2021

Add a Comment

Login with GitHub to post a comment