OWASP Top 10 — Broken Authentication

OWASP Top 10 — Broken Authentication

Authentication verifies a user and lets them in to a website. Most common way of authenticating is using a combination of username and passwords.

A lot of times what happens is that developers forgets to sanitize the input(username & password) given by the user in the code of their application, which can make them vulnerable to attacks like SQL injection.

Once verified the server provides the browser with a session cookie to keep track of the user’s session as HTTP is stateless.

Common vulnerabilities in authentication mechanisms :-

  1. Brute Force attacks — The attacker can try multiple combinations of usernames and passwords.
  2. Weak credentials — Now if you have set passwords like test123 it is as easy as heading to the kitchen to fetch a glass of water to access an account.
  3. Weak session cookies — If contents of a sesssion cookie are way too predictable the attacker can easily set their own cookies like an imposter.

Photo by Ante Hamersmit on Unsplash

Let’s understand this with the help of an example, say there is an existing user with the name admin and now we want to get access to their account so what we can do is try to re-register that username but with slight modification. We are going to enter “ admin”(notice the space in the starting). Now when you enter that in the username field and enter other required information like email id or password and submit that data. It will actually register a new user but that user will have the same right as normal admin. That new user will also be able to see all the content presented under the user admin.