Hey there, currently it is possible to sign up via...
# ory-network
a
Hey there, currently it is possible to sign up via kratos SDK and Web API with an email only containing of name, “@” and a tld (just like “test@test”). However, this is no valid email according to RFC. Is anybody aware of that and will this be changed in the near future?
r
Hey Max. It is, in general, impossible to validate an email address by any other method than sending an email to it.
Especially regexes are not workable.
We do what we believe is the most strict validation possible, without rejecting valid email addresses. That’s essentially if the address contains an
@
and some stuff before and after.
In particular you example
test@test
is in fact potentially a valid address.
a
can you point to the rfc document stating that email addresses can be with a tld only? i thought i read that rfc has revised it back in the time…
r
And wikipedia (I’m sure it links to the relevant RFCs) https://en.wikipedia.org/wiki/Email_address#Valid_email_addresses
But really the most important part is: what is the email regex supposed to defend against? Users signing up with invalid email addresses? That’s easy:
${uuid.v4()}@gmail.com
.
a
thanks, will check it out.
basically, prevent typos (missing dot) e.g. test@gmailcom instead of gmail.com
but agree, security wise spammers could likely use any other email and flood the db with never-verified addresses. we’ll delete non-verified email addresses anyway after 30 days
will wrinkle my brain around again. thanks for you replies
s
you can add regex validation to the identity schema to prevent typos, e.g.
@.+\..+
m
Hello @ancient-translator-52526 I hope this helped! I invited you to the production support channel #C05PHQCFL1F Please use this channel going forward to get support for your Ory Network project. Please also let me know if there is someone from your team not invited!
l
I’ve brought this up before. I think it would be a good idea to highlight it in the docs so you can take it into account when you are designing your identity schema https://ory-community.slack.com/archives/C02MR4DEEGH/p1686921499519849?thread_ts=1686921191.072869&cid=C02MR4DEEGH