Broken Authentication
In this example, the login function assumes that the verifyCredentials
function adequately authenticates the user. However, if the implementation of verifyCredentials
is weak or does not properly hash passwords, an attacker can exploit this vulnerability by using weak or easily guessable passwords, potentially gaining unauthorized access to user accounts.
To mitigate this risk, strong password policies, secure storage of passwords (e.g., using salted and hashed passwords), and robust session management techniques (e.g., using secure session tokens) should be employed.
Last updated