You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Username leakage from password recovery when no email service setup or no useremail #1774
when email service is not setup the server should return Email service is not set up also when username do not exist
when email service is setup, and email do not exist the server returns Account recovery email has not been provided
these are/should be rare cases when email is setup and only on really experimental server.
When username do not exist I propose to return the actual no error
Adding (in username if (!exists)) a call to verifyEmailDependencies ()
thrownewError('Account recovery email has not been provided')
}
with
if (userAccount && !userAccount.email) {
return resetLinkMessage ()
fix branch created fix/issue#1774
The only ways to get the resetLinkMessage() call into the AccountManager class is to either make it static from the PasswordResetEmailRequest class, copy it into the AccountManager class, or to pass the instance of PasswordResetEmailRequest class into the AccountManager class. I currently have where if it throws the Error in verifyEmailDependencies with specific message, do renderSuccess() in PasswordResetEmailRequest.loadUser if !exists
if (userAccount && !userAccount.email) {
return resetLinkMessage ()
This was an error
You should keep the throw Error, with the check on userAccount the function will not return an Error when the username do not exist
So we should have
if (userAccount && !userAccount.email) {
throw new Error('Account recovery email has not been provided')
}
And you will have simply something like
if(!exist) {
this.accountManager.verifyEmailDependencies() // without userAccount, this will only throw Error on `email service not setup`
return this.resetLinkMessage() // this is the expected email sent message
}
I took the changes I made from 1770 and integrated them with this fix/issue#1774 request, so fix/issue#1770 pull request can be closed without merge as all changes are incorporated into the PR which fixes 1774, as it fixes both 1770 and 1774.
Activity
zg009 commentedon Mar 16, 2024
The only ways to get the resetLinkMessage() call into the AccountManager class is to either make it static from the PasswordResetEmailRequest class, copy it into the AccountManager class, or to pass the instance of PasswordResetEmailRequest class into the AccountManager class. I currently have where if it throws the Error in verifyEmailDependencies with specific message, do renderSuccess() in PasswordResetEmailRequest.loadUser if !exists
bourgeoa commentedon Mar 16, 2024
Thank you for looking at this
This was an error
You should keep the throw Error, with the check on userAccount the function will not return an Error when the username do not exist
So we should have
And you will have simply something like
bourgeoa commentedon Mar 16, 2024
Well there is also
a logic issue with the 2 PRsyou will have a conflict with the last merged one.So you have the choice to keep only one PR for both issues.
Or a bit more complex
zg009 commentedon Mar 16, 2024
I took the changes I made from 1770 and integrated them with this fix/issue#1774 request, so fix/issue#1770 pull request can be closed without merge as all changes are incorporated into the PR which fixes 1774, as it fixes both 1770 and 1774.