Email validations in MagicLinkController::LoginAction? What's the point? #900
Answered
by
kenjis
IvanNavarroSommerz
asked this question in
Q&A
|
Hi all, I'm fairly new here. In the |
Answered by
kenjis
Oct 13, 2023
Replies: 1 comment 3 replies
|
The security principle is that all user input should be validated before you use it. Is the email validated during registration the same as the email sent to the Magic Link Controller? |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, the e-mail address validation rules are the same.
Normal users send their registered email address. However, there is a possibility that they may make a typo and send a strange string.
More importantly, an attacker can send any data. Binary data can also be sent.
Processing data that is not expected by developers may result in security bugs.
And there might be bugs in PHP.
So it is safe to detect invalid data as early as possible and avoid processing it.
In this case, there is no need to process anything that is formally invalid as an e-mail address.