No Code Attached Yet Information Required bug
avatar thomaslanger
thomaslanger
21 Nov 2023

Steps to reproduce the issue

Any Joomla 3, 4 or 5 site. Use the password reset funktion in site/frontend.

  1. Insert your e-mail address in the form and add a space at the beginning. E.g. " test@e.mail". You will receive no e-mail.
  2. Insert your e-mail address correct in the form and submit. In the e-mail, click on the link and your browser shows the second step with the code filled. Now insert your e-mail address in the form as in 1., with the space at the beginning. If you submit the form you get a notice that the user ist not found.

If you add the space at the end, then you receive the Mail and you can reset the password as expected.

Expected result

  1. receive the e-mail
  2. show next step to set Password.

Actual result

User not found. No E-mail is send or in step #2 you can't reset your password because User not found

System information (as much as possible)

Testet with Joomla 3.10.12, Joomla! 3.10.13-elts , Joomla! 4.4 and Joomla! 5.0
PHP 8.1
MySQL 5.7 (J3+J4) (mamp)
MariaDB 11.1.2 (J5)

Additional comments

It seems that the space is not removed and the input is passed on to the database. This results in a SQL query like
SELECT * FROM #__users WHERE LOWER(email) = LOWER(" your@input.here")
If you add the space at the end you get
SELECT * FROM #__users WHERE LOWER(email) = LOWER("your@input.here ")
The second query will find your user because MySQL ignores the space.

All e-mail addresses should be processed with the PHP command trim().

Why is this important: We have many users who copy/paste their email into forms. Another source of error could be browser autofill.

avatar thomaslanger thomaslanger - open - 21 Nov 2023
avatar joomla-cms-bot joomla-cms-bot - change - 21 Nov 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Nov 2023
avatar Fedik Fedik - change - 21 Nov 2023
Labels Added: bug
avatar Fedik Fedik - labeled - 21 Nov 2023
avatar Quy
Quy - comment - 21 Feb 2024

How did you bypassed the browser's email validation?

42374

avatar Quy Quy - change - 21 Feb 2024
Labels Added: Information Required
avatar Quy Quy - labeled - 21 Feb 2024
avatar brianteeman
brianteeman - comment - 21 Feb 2024

@Quy I never see that

avatar Quy
Quy - comment - 21 Feb 2024

The input type is email. In Firefox and Chrome. i get the tooltip after clicking the Submit button.

42374-markup

avatar brianteeman
brianteeman - comment - 21 Feb 2024

as shown below I do not see that

forgot

avatar Hackwar Hackwar - change - 26 Feb 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-02-26 14:02:50
Closed_By Hackwar
avatar Hackwar Hackwar - close - 26 Feb 2024
avatar Hackwar
Hackwar - comment - 26 Feb 2024

I'm not really sure if we actually want this, but to make it easier to discuss code directly, I created a PR which would change it the way you want it. Because we have a PR (#42893), I'm closing this issue.

Add a Comment

Login with GitHub to post a comment