OWASP A07:2021 - Identification and Authentication Failures

Overview

Identification and Authentication Failures occur when application functions related to user identity, authentication, and session management are implemented incorrectly, allowing attackers to compromise passwords, keys, or session tokens, or exploit other implementation flaws to assume other users' identities temporarily or permanently.

Risk Rating

  • Prevalence: Common

  • Detectability: Average

  • Impact: High

  • CVSS Score Range: 3.0-8.5 (depending on specific vulnerability)

Common Authentication Vulnerabilities

1. Weak Password Policies

  • No complexity requirements

  • Default or commonly used passwords

  • Passwords stored in plaintext or weak hashing

  • Password reuse allowed

  • No account lockout mechanisms

2. Session Management Flaws

  • Predictable session IDs

  • Session fixation vulnerabilities

  • Sessions not invalidated on logout

  • Long session timeouts

  • Session tokens in URLs

3. Multi-Factor Authentication Bypasses

  • MFA not enforced for critical operations

  • Backup codes improperly implemented

  • SMS/Email OTP vulnerabilities

  • TOTP implementation flaws

4. Account Enumeration

  • Username enumeration via login responses

  • Password reset functionality revealing valid accounts

  • Registration process disclosing existing users

  • Timing attacks on authentication

5. Credential Recovery Issues

  • Insecure password reset mechanisms

  • Predictable recovery tokens

  • Account recovery bypassing authentication

  • Security questions with easily guessable answers

Penetration Testing Methodology

1. Authentication Mechanism Discovery

Initial Reconnaissance

Authentication Flow Analysis

2. Username Enumeration Testing

Login Response Analysis

Registration Endpoint Testing

Password Reset Enumeration

3. Password-Based Attacks

Brute Force Testing

Credential Stuffing

4. Session Management Testing

Session Token Analysis

Session Fixation Testing

Session Timeout Testing

5. Multi-Factor Authentication Testing

TOTP Implementation Testing

SMS/Email OTP Testing

Advanced Authentication Testing

1. OAuth/SAML Testing

OAuth Flow Analysis

SAML Testing

2. JWT Token Testing

JWT Analysis and Manipulation

3. API Authentication Testing

API Key Testing

HTTP Basic/Digest Authentication

Password Reset and Recovery Testing

1. Password Reset Token Analysis

2. Account Recovery Testing

Remediation Guidelines

1. Strong Authentication Implementation

  • Implement strong password policies (length, complexity, history)

  • Use secure password hashing (bcrypt, scrypt, Argon2)

  • Implement account lockout mechanisms

  • Require multi-factor authentication for sensitive operations

2. Secure Session Management

3. JWT Security Best Practices

Common Bypasses and Advanced Techniques

1. Rate Limiting Bypass

2. Authentication Logic Flaws

Reporting Template

Finding Description

Tools and Resources

Authentication Testing Tools

  • Burp Suite - Web application security testing platform

  • Hydra - Network login cracker

  • John the Ripper - Password cracking tool

  • Hashcat - Advanced password recovery tool

  • JWT Tool - JWT manipulation and testing

  • OAuth/SAML Pen-Testing Tools - Specialized testing frameworks

Custom Scripts and Frameworks

  • AuthMatrix - Burp Suite extension for authorization testing

  • Autorize - Burp Suite extension for access control testing

  • Custom Python scripts - For specific authentication testing scenarios

Prevention Best Practices

  1. Strong Authentication: Implement multi-factor authentication and strong password policies

  2. Secure Session Management: Use secure, random session identifiers and proper timeout

  3. Account Security: Implement account lockout and monitoring for suspicious activities

  4. Secure Password Recovery: Use secure tokens and multi-step verification for password resets

  5. Regular Security Testing: Conduct regular penetration testing of authentication mechanisms

References and Further Reading

  • OWASP Authentication Cheat Sheet

  • OWASP Session Management Cheat Sheet

  • NIST Digital Identity Guidelines

  • JWT Security Best Practices

  • OAuth 2.0 Security Considerations

  • SAML Security Guidelines

Last updated