[Bug]: Superusers can't request a password reset link
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- authentication, backend
Research direction
Start with SendPassword.ascx.cs around line 325 and trace the GetUsersByEmail lookup through DataProvider.cs around line 2145 to the stored procedure and vw_Users. Check how that lookup handles superusers when email is used as the username, without changing unrelated lookup behavior. Done means a superuser can request a password-reset email in the described settings, with existing lookup behavior preserved.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Superusers can't request a password reset link from the forgot password page when "use email as username" is enabled.
Steps to reproduce?
- Have a superuser account
- Enable "Use Email Address as Username" in registration settings
- Go to a login module, click "Reset Password"
- Enter the superuser account email
- Submit
Current Behavior
No password reset email is sent.
Expected Behavior
Password reset email is sent.
Relevant log output
Admin log: "Password Sent Failure" "Cause:If the details entered for <email> were correct, you should receive an email message shortly with a link to reset your password."
Anything else?
This appears to happen because of the way users are looked up.
- https://github.com/dnnsoftware/Dnn.Platform/blob/4b0214b8dad46cc3173967d9800f208f0db60466/DNN%20Platform/Website/admin/Security/SendPassword.ascx.cs#L325 Calls the UserController. "ShowEmailField" comes from the "Use Email Address as Username" setting (among other things, who's cases are probably also broken). When true, it calls UserController.GetUsersByEmail with the current portal ID.
- https://github.com/dnnsoftware/Dnn.Platform/blob/236dbe3bcdf02e7c09e73b710544b7aa322b1a10/DNN%20Platform/Library/Data/DataProvider.cs#L2145 UserController calls into the membership provider, which eventually ends up here. The "GetUsersByEmail" stored procedure selects from "vw_Users". "vw_Users" replaces UserId with 0 when JOINing [Users] with [UserPortals], which causes it to never return a user if it is a super user.
- Since the user cannot be looked up, password reset treats it as if an invalid email/username was entered, and just does nothing.
The solution probably needs to change how users are looked up. I imagine "vw_Users" prevents looking up super users for security reasons, so probably don't want to change that. Instead using a method that doesn't utilize that view is probably what needs to happen.
Affected Versions
10.3.2 (latest release)
What browsers are you seeing the problem on?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- Dominant language
- C#
- Stars
- 1.1k
- Forks
- 791
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dnnsoftware/Dnn.Platform
-
Status: New
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dnnsoftware/Dnn.Platform#7571 ·
Maintainers usually reply within 2 days
-
[Bug]: Edit Bar buttons are not localizedPossibly taken @idumlupinar claimed this 2 days ago. OpenStatus: New
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dnnsoftware/Dnn.Platform#7565 ·
Maintainers usually reply within 2 days
-
[Bug]: DNN 10.4.0 assembly registration fails for a two-component file version (Owin.dll)Possibly taken A pull request linked to this issue is open or already merged. OpenStatus: New
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dnnsoftware/Dnn.Platform#7543 · 5 comments ·
Maintainers usually reply within 2 days
-
Status: New
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dnnsoftware/Dnn.Platform#6681 ·
Maintainers usually reply within 2 days
-
Status: New
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dnnsoftware/Dnn.Platform#6051 · 4 comments ·
Maintainers usually reply within 2 days
All issues in dnnsoftware/Dnn.Platform
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sebastienros/jint#4282 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
pyrevitlabs/pyRevit#3792 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Maintainers usually reply within 1 day
-
area: design documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eyalgolan/statecraft-israel#883 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days