Broken Authentication in Django
How Broken Authentication Manifests in Django
Broken Authentication in Django applications typically exploits weaknesses in how Django handles session management, password policies, and authentication flows. Unlike generic web frameworks, Django's authentication system has specific implementation details that attackers can target.
One common attack vector is session fixation. Django generates session IDs that, if not properly invalidated during login, allow attackers to force a user into a known session. This occurs when developers call login() without first calling django.contrib.auth.logout() or creating a new session:
Related CWEs: authentication
CWE ID Name Severity CWE-287 Improper Authentication CRITICAL CWE-306 Missing Authentication for Critical Function CRITICAL CWE-307 Brute Force HIGH CWE-308 Single-Factor Authentication MEDIUM CWE-309 Use of Password System for Primary Authentication MEDIUM CWE-347 Improper Verification of Cryptographic Signature HIGH CWE-384 Session Fixation HIGH CWE-521 Weak Password Requirements MEDIUM CWE-613 Insufficient Session Expiration MEDIUM CWE-640 Weak Password Recovery HIGH