Email validations in MagicLinkController::LoginAction? What's the point? #900
-
Hi all, I'm fairly new here. In the |
Beta Was this translation helpful? Give feedback.
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? |
Beta Was this translation helpful? Give feedback.
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.