Authentication and session management includes verifying user credentials and managing their active sessions. Broken authentication and session management occurs when credentials cannot be authenticated and session IDs cannot be initiated due to lack of encryption and/or weak session management. These flaws create vulnerabilities that not only risk confidential data but entire company systems and networks by users impersonating other users, for instance. It takes just one stolen permission to infiltrate and damage your company’s viability.
The rather straightforward authentication process precedes opening user sessions. Authentication occurs when provided credentials are successfully matched against an authorized user database. The user session can then be initiated once credentials are authorized. Session IDs, also known as session identifiers and session tokens, are unique identifiers (cookies) stored and sent by the server to the client.
Session management workflow looks something like this:
Any deviation from the authentication and session management process can lead to brokenness, flaws, and potentially severe technical impacts as all user accounts in your company, including privileged accounts, can be breached both internally and externally.
Issues tend to be widespread, but are detectable. It sounds easy to discover a flaw–put in a bad password and you don’t log in to the page you seek. The issues go deeper than mere login credentials being rejected. Often problems lie with development and custom code which makes detection and issue resolution more difficult.
Common authentication flaws include user names and passwords. For example:
Two issues take these one step further :
It is most important to properly protect your company user sessions throughout their life cycle through consistent authentication and session management checks and testing, i.e. penetration testing.
How is broken authentication and session management different from broken access controls? Broken access controls involve vulnerabilities in authorization while broken authentication involves verifying the identity of a user before the user is authorized to have the session. While off the top they seem very similar, these two issues have very different processes, vulnerabilities, and resolutions, and shouldn’t be confused.
There are several ways broken authentication and session management can be resolved. Here are 3 common problems and their resolutions:
Problem 1: authentication match to authentication list is not enough security.
Resolution: Create a two-factor authentication process. Use a token and password, for instance. Remove any default passwords and make sure that recovery paths do not show current passwords.
Problem 2: sessions are not timing out after inactivity.
Resolution: establish inactivity timeout by adding a functional time (i.e. 1 to 2 minutes) notice that the session will time out due to inactivity. This prompt will allow the user time to become active within the session or to log out.
Problem 3: The user wants to log in to a site, not on the company safe list.
Resolution: Web Application Firewalls (WAFs) can mitigate session attacks by protecting HTTP applications from infiltration in case a user tries to log in to a potentially unsafe site.
There are innumerable ways that broken authentication can lead to insecure session management. Every issue and vulnerability is unique as is its resolution and should be handled on a case-by-case basis.
Prevention Is Key
Everyone knows it is easier to prevent than to fix an issue.
The key to resolving broken authentication and session management is that authentication controls must be implemented centrally. This will prevent many issues since all web servers, application servers and other computing environments will have just one location that establishes and feeds the authentication and session management process.
Some key preventive measures include:
Developers should always have one set of strong authentication and session controls given to them by their company as there needs to be constant maintenance and testing so that broken authentication and session management issues and the subsequent risks are circumvented