dazzling-nightfall-42114
01/31/2025, 5:43 AMpassword
, code
and oidc
methods. So far it seems password
registration and code
login both reveal whether or not an email address exists. Registration I can work around using the “invite” pseudo-flow. But when you attempt a code
login for an email that does not exist you get “This account does not exist or has not setup sign in with code.” Is there a way to turn off this error message? This seems like a clear vector for email enumeration, am I misunderstanding something?dazzling-nightfall-42114
01/31/2025, 5:48 AMdazzling-napkin-4938
01/31/2025, 6:52 AMdazzling-nightfall-42114
01/31/2025, 7:03 AMcode
is enabled globally, not individually. At least I was just now able to set up an account using username+password and then confirm the account exists by getting the “An email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the login.” message. Because the two messages are different, anyone familiar with kratos can distinguish them.
I feel I must be misunderstanding something here.dazzling-nightfall-42114
01/31/2025, 7:35 AMsecurity.account_enumeration.mitigate: true
, no luck. Also tried in combination with selfservice.flows.login.style: identifier_first
which (helpfully) lets you enter your email without telling you it doesn’t exist, but then still displays the leaky error message when you select code
.early-magician-18981
01/31/2025, 3:38 PMAn email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the login
I read this as not leaking the email address, but rather a message to tell the user that an email has been sent to the address entered. In theory you could enumerate the userid if your invalid email address never gets a code, but otherwise you would have to compromise every legit email system to get the code to know if it is a legit user.dazzling-nightfall-42114
02/02/2025, 11:22 PMAn email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the login.
If the email does not exist you get
This account does not exist or has not setup sign in with code.
So anyone familiar with kratos can determine whether or not an email address exists by initiating a code
login and seeing which message they get.dazzling-napkin-4938
02/02/2025, 11:23 PMdazzling-nightfall-42114
02/02/2025, 11:30 PMmessage
is actually an object, it also includes a code
and a type
. Even if the text
matches, the messages will have different id
and type
.
Good idea though, I will investigate it a bit moredazzling-napkin-4938
02/02/2025, 11:54 PMdazzling-nightfall-42114
02/03/2025, 12:27 AMcode
login flow themselves and access the true error messages.
I can run a proxy that restricts access to the self-service API, e.g. only exposing /sessions/whoami
to the public internet … but this is a decent amount of complexity to add, just to hide one error message.colossal-airline-19852
04/30/2025, 2:55 PMmagnificent-energy-493