Sharing notes from my ongoing learning journey — what I build, break and understand along the way.
OWASP Top 10 – A07: Identification and Authentication Failures
OWASP Top 10 – A07: Identification and Authentication Failures
While exploring software security topics, I came across an area that directly affects the very foundation of any application: authentication and identification flaws. OWASP groups these issues under A07: Identification and Authentication Failures.
At first, I thought this was just about weak passwords or missing 2FA. But the deeper I dug, the clearer it became: if a system can’t reliably identify and authenticate users, nothing inside it is truly secure.
Below are my key takeaways and learning notes from researching this topic
What Are Identification and Authentication Failures?
This category includes any weakness in how a system identifies users and verifies their identity. These flaws allow attackers to:
- Impersonate users,
- Bypass login systems,
- Abuse session tokens,
- Or break into accounts through brute-force and credential stuffing.
Two key terms:
- Identification = Declaring “who you are” (e.g., entering an email or username).
- Authentication = Proving “you are who you claim to be” (e.g., password, OTP, biometrics).
Why It Matters So Much
- If attackers can log in as someone else, your system is compromised — period.
- Admin and privileged accounts are often the primary target.
- Weak passwords, brute-force attacks, exposed session tokens, or lack of MFA all increase risk drastically.
If you can’t control who enters, no internal security measure really matters.
Real-World Examples I Studied
1. Login Without Rate Limiting
No limits on password attempts, no CAPTCHA, and no MFA. This opens the door to automated brute-force attacks.
2. Passwords Stored in Plaintext
A data breach exposed raw user passwords — they weren’t hashed or encrypted, allowing full takeover of accounts.
3. Long-Lived Sessions
Sessions that stay valid for weeks or months, even if the user doesn’t log out. If someone gains access to the browser or device, they can hijack the session easily.
4. No 2FA for Sensitive Accounts
Critical accounts (like admins or billing managers) are only protected by a single password.
5. Login Error Messages Reveal Usernames
A login form that says “User not found” when a wrong username is entered. This helps attackers guess valid usernames.
When Are You at Risk?
- If passwords are stored insecurely (e.g., in plaintext or using outdated algorithms like MD5).
- If MFA is not enforced for critical users.
- If there’s no brute-force protection (e.g., rate limiting or CAPTCHA).
- If session management is weak (e.g., cookies not marked
HttpOnly
, no session timeout). - If password policies are too weak (e.g., allowing “123456” or “admin123”).
How to Prevent These Failures
1. Enforce Strong Password Policies
- Require minimum length, character diversity, and expiration.
- Block common passwords like “123456” or “qwerty”.
2. Store Passwords Securely
- Use modern password hashing algorithms like bcrypt, scrypt, or Argon2.
- Always use a unique salt per user.
3. Limit Login Attempts
- Apply rate limiting and account lockouts after several failed attempts.
- Add CAPTCHA after X tries.
4. Implement Multi-Factor Authentication (MFA)
- Especially for admins or privileged accounts.
- Options include SMS, authenticator apps, email codes, or hardware tokens.
5. Secure Session Management
- Use secure, short-lived session cookies.
- Set
HttpOnly
,Secure
, andSameSite
flags on cookies. - Invalidate sessions on logout or after inactivity.
Best Practices
Practice | Why It Matters |
---|---|
Hash + salt all stored passwords | Prevents damage if data is leaked |
Require MFA for sensitive accounts | Adds a second layer of protection |
Use CAPTCHA + rate limiting | Blocks brute-force and automated attacks |
Expire sessions after inactivity | Reduces hijacking risk |
Avoid specific login error messages | Prevents user enumeration |
How to Test and Detect
- Penetration Testing: Simulate brute-force, session hijacking, and account takeover attempts.
- Manual login abuse testing: Try rapid login attempts, test rate limits, and MFA presence.
- Session fixation testing: Can the session ID be predicted or reused?
- Password strength testing: Check if weak passwords are accepted.
Who’s Responsible for What?
Developers:
- Implement authentication flows securely.
- Use established libraries for password hashing and session handling.
Security Teams:
- Define and enforce password and MFA policies.
- Monitor login attempts and credential stuffing patterns in logs.
Product Managers:
- Balance usability with strong security in the login flow.
- Prioritize implementation of secure authentication early in product development.
Authentication is your app’s front door. If attackers can walk in as someone else — especially as an admin — everything else falls apart.
This topic made it clear to me that a password alone is not enough anymore.
Secure authentication isn’t just a feature — it’s a requirement.
2FA, secure password storage, session handling, brute-force protection… they all work together.
After researching this topic, one simple truth stands out:
If you want to secure your system, start by securing your login.