Neocortex 🧠

Search

Search IconIcon to open search

Authentication

Last updated Nov 16, 2021 Edit Source

# Authentication

Authentication vulnerabilities are one of the simpler ones. Yet, due to obvious reasons, they can have very serious impacts. Finding authentication bugs usually have a puzzle-solving nature to them. Authentication is the process of identifying the identity of a person, this is what sets the difference between authentication and authorisation. Authorisation is the process of checking whether a user has access to a resource and permitting or denying requests for that resource based on the user's permissions.

# Brute Force Protection

# Username enumeration

  1. Using Differences in response contents

    This method is very simple, you compare the responses of the web application when a valid username is sent to the response to an invalid username. If there are any consistent differences, you can enumerate usernames.

  2. Difference in response times

    Because web applications have to first hash the password and then compare the hashes, sometimes developers check whether the username is valid and then hash the password in order to save resources. However because hashing is a process that takes time, an attacker can send a very long password which takes a long time to hash. Since the server would only hash this password if the username is valid, the attacker can deduce whether a username exists or not by looking at the response time.

# Flawed Brute Force Protection

There are two ways that brute force protection can be implemented. THe system can lock a user's account after too many failed login attempts or the ip of the attacker can be blocked after a number of failed attempts.

  1. Bypassing IP Blocks

    The [X-Forwarded-For header](web_bypasses.org::*X-Forwarded-For header) trick can be used. Also, some applications reset the ip restrictions once somebody is logged-in from that account. Or, in some web applications, you can submit multiple credentials in a single request. Here is an example:

    1
    
    {"username":"yeet","password":"pass"}
    
    1
    
    {"username":"yeet","password":["pass","pass2"]}
    
  2. Bypassing Account Locks

    Sometimes, when an account is locked but the login details are correct, web applications return a different response then when the account is blocked and the credentials are wrong. This can be used to identify the credentials of an account even if it gets locked.

# 2FA (Two Factor Authentication)

2FA is often considered to be a very secure way for authentication since even if a user's credentials are compromised, an attacker can't login to the user's account. However, due to its advanced nature, it is often prone to vulnerabilities and should be tested with care.

# Password Change

Password change functionalities can be vulnerable to Host Header injections. By changing the Host header in forgot password requests, you can alter the url that the web applications refers to in its e-mail that it sends. This opens up the possibility for phishing attacks.


Interactive Graph