Executive brief
A vulnerability in Django's authentication handler for mod_wsgi could allow an attacker to determine if specific usernames exist on a system. By measuring the time the server takes to respond to login attempts, an attacker can distinguish between valid and invalid usernames. This information can be used to facilitate more targeted password-guessing or social engineering attacks.
Technical details
An observable timing discrepancy exists in the `django.contrib.auth.handlers.modwsgi.check_password()` function. When Django is configured to use `mod_wsgi` for authentication, the time taken to process a password check varies depending on whether the username exists in the database. A remote, unauthenticated attacker can exploit this discrepancy by sending multiple authentication requests and measuring response times to identify valid usernames (CWE-208). The issue is resolved in Django versions 6.0.2, 5.2.11, and 4.2.28. Earlier unsupported versions like 5.0.x and 3.2.x may also be affected.
Affected products
- Django Software Foundation Django >= 6.0a1, < 6.0.2; >= 5.2a1, < 5.2.11; >= 4.2a1, < 4.2.28
Timeline
- 2026-02-03: disclosed
- 2026-02-03: advisory
- 2026-02-03: patched