Depending on your requirements, there are several available authentication mechanisms to choose from. If they are not correctly chosen and implemented, the authentication mechanism can expose vulnerabilities that attackers can exploit to gain access to your system. The top threats that exploit authentication vulnerabilities include:
● Network eavesdropping
If authentication credentials are passed in plaintext from client to server, an attacker armed with rudimentary network monitoring software on a host on the same network can capture traffic and obtain user names and passwords.
Countermeasures to prevent network eavesdropping include:
1) Use authentication mechanisms that do not transmit the password over the network such as Kerberos protocol or Windows authentication.
2) Make sure passwords are encrypted (if you must transmit passwords over the network) or use an encrypted communication channel, for example with SSL.
● Brute force attacks
Brute force attacks rely on computational power to crack hashed passwords or other secrets secured with hashing and encryption. To mitigate the risk, use strong passwords.
● Dictionary attacks
This attack is used to obtain passwords. Most password systems do not store plaintext passwords or encrypted passwords. They avoid encrypted passwords because a compromised key leads to the compromise of all passwords in the data store. Lost keys mean that all passwords are invalidated. Most user store implementations hold password hashes (or digests). Users are authenticated by re-computing the hash based on the user-supplied password value and comparing it against the hash value stored in the database. If an attacker manages to obtain the list of hashed passwords, a brute force attack can be used to crack the password hashes.
With the dictionary attack, an attacker uses a program to iterate through all of the words in a dictionary (or multiple dictionaries in different languages) and computes the hash for each word. The resultant hash is compared with the value in the data store. Weak passwords such as “Yankees” (a favorite team) or “Mustang” (a favorite car) will be cracked quickly. Stronger passwords such as “lNevaFiNdMeyePasSWerd!”, are less likely to be cracked. Note Once the attacker has obtained the list of password hashes, the dictionary attack can be performed offline and does not require interaction with the application.
Countermeasures to prevent dictionary attacks include:
1) Use strong passwords that are complex, are not regular words, and contain a mixture of upper case, lower case, numeric, and special characters.
2) Store non-reversible password hashes in the user store. Also combine a salt value (a cryptographically strong random number) with the password hash.
● Cookie replay attacks
With this type of attack, the attacker captures the user’s authentication cookie using monitoring software and replays it to the application to gain access under a false identity.
Countermeasures to prevent cookie replay include:
1) Use an encrypted communication channel provided by SSL whenever an authentication cookie is transmitted.
2) Use a cookie timeout to a value that forces authentication after a relatively short time interval. Although this doesn’t prevent replay attacks, it reduces the time interval in which the attacker can replay a request without being forced to reauthenticate because the session has timed out.
● Credential theft
If your application implements its own user store containing user account names and passwords, compare its security to the credential stores provided by the platform, for example, a Microsoft Active Directory® directory service or Security Accounts Manager (SAM) user store. Browser history and cache also store user login information for future use. If the terminal is accessed by someone other than the user who logged on, and the same page is hit, the saved login will be available.
Countermeasures to help prevent credential theft include:
1) Use and enforce strong passwords.
2) Store password verifiers in the form of one way hashes with added salt.
3) Enforce account lockout for end-user accounts after a set number of retry attempts.
4) To counter the possibility of the browser cache allowing login access, create functionality that either allows the user to choose to not save credentials, or force this functionality as a default policy.