Skip to content

Username leakage from password recovery when no email service setup or no useremail #1774

@bourgeoa

Description

@bourgeoa

This is a follow on issue#1771
We need to have allways same response when user exists/notExists

  • PR fix issue 1770: #1773 resolves the case when email service is setup
  • 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 ()

verifyEmailDependencies (userAccount) {
if (!this.emailService) {
throw new Error('Email service is not set up')
}
if (!userAccount.email) {
throw new Error('Account recovery email has not been provided')
}
}

Also replacing throw error with success

if (!userAccount.email) {
throw new Error('Account recovery email has not been provided')
}

with

if (userAccount && !userAccount.email) {
  return resetLinkMessage ()

fix branch created fix/issue#1774

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions