You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
When we try to login in the app, if we have whitespace on the right of the username (which weren't supposed to be there), login still works.
To Reproduce or Feature details
Steps to reproduce the behavior:
Enter your username and password which should work fine.
Before pressing the sign in button, enter any amount of whitespace on the right.
Try signing in.
It should signin successfully.
Expected behavior
It should show an error message that "The username or password are not correct."
@cpg@megabitdragon@octacode
Can you please tell what would be the best fix for this issue?
We can just ignore the whitespace in the end and strip it before sending the login request further. If that fix works, then please let me know. I would love to go forward and implement the same.
#511 talks about handling spaces in the username. That would certainly fix this issue too. But that won't explain why this issue exists in the first place.
@chirag-jn the source code uses trim() method which removes the spaces and returns the omitted string when users click the sign in button. This is the ethical way of authenticating logins.
You are right @Soroyesodiq It's ethical and valid of authenticating usernames. However, it was only working for trailing whitespaces and not leading whitespaces. I'll surely look into this further. Thanks for pointing out!
Activity
chirag-jn commentedon Mar 19, 2020
@cpg @megabitdragon @octacode
Can you please tell what would be the best fix for this issue?
We can just ignore the whitespace in the end and strip it before sending the login request further. If that fix works, then please let me know. I would love to go forward and implement the same.
chirag-jn commentedon Mar 19, 2020
#511 talks about handling spaces in the username. That would certainly fix this issue too. But that won't explain why this issue exists in the first place.
Soroyesodiq commentedon Mar 31, 2020
@chirag-jn the source code uses trim() method which removes the spaces and returns the omitted string when users click the sign in button. This is the ethical way of authenticating logins.
chirag-jn commentedon Mar 31, 2020
You are right @Soroyesodiq It's ethical and valid of authenticating usernames. However, it was only working for trailing whitespaces and not leading whitespaces. I'll surely look into this further. Thanks for pointing out!
chirag-jn commentedon Jul 19, 2020
This issue doesn't exist anymore, hence can be closed.
[-]Security Issue in Login[/-][+]User Behaviour Issue in Login[/+][-]User Behaviour Issue in Login[/-][+]User behavior issue with spaces in Login[/+]