CVE-2020-4071
Timing attack on django-basic-auth-ip-whitelist
Also known as GHSA-m38j-pmg3-v5x5, PYSEC-2020-37
Mitigation
- Upgrade django-basic-auth-ip-whitelist to 0.3.4 or later.
Who should check
- Projects that depend on PyPI package django-basic-auth-ip-whitelist (< 0.3.4)
- Anyone running tm-kn django-basic-auth-ip-whitelist < 0.3.4
Vulnerability facts
- Affected
- django-basic-auth-ip-whitelist < 0.3.4
- Fixed in
- 0.3.4
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 2.2 (v3.1, CNA)CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Physical
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Changed (impact reaches other components)
- Confidentiality impact: Low
- Integrity impact: None
- Availability impact: None
- EPSS
- 0.36% chance of exploitation in 30 days (percentile 22, 2026-11-26)
- CWE
- CWE-208
- Modified
Description
In django-basic-auth-ip-whitelist before 0.3.4, a potential timing attack exists on websites where the basic authentication is used or configured, i.e. BASIC_AUTH_LOGIN and BASIC_AUTH_PASSWORD is set. Currently the string comparison between configured credentials and the ones provided by users is performed through a character-by-character string comparison. This enables a possibility that attacker may time the time it takes the server to validate different usernames and password, and use this knowledge to work out the valid credentials. This attack is understood not to be realistic over the Internet. However, it may be achieved from within local networks where the website is hosted, e.g. from inside a data centre where a website's server is located. Sites protected by IP address whitelisting only are unaffected by this vulnerability. This vulnerability has been fixed on version 0.3.4 of django-basic-auth-ip-whitelist. Update to version 0.3.4 as soon as possible and change basic authentication username and password configured on a Django project using this package. A workaround without upgrading to version 0.3.4 is to stop using basic authentication and use the IP whitelisting component only. It can be achieved by not setting BASIC_AUTH_LOGIN and BASIC_AUTH_PASSWORD in Django project settings.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI django-basic-auth-ip-whitelist | < 0.3.4 | 0.3.4 | osv |
| tm-kn django-basic-auth-ip-whitelist | < 0.3.4 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2020-4071. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2020-4071.md Affected: django-basic-auth-ip-whitelist < 0.3.4 Fixed in: 0.3.4 Steps: 1. Search this machine and project for django-basic-auth-ip-whitelist (PyPI), tm-kn django-basic-auth-ip-whitelist: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Other
- https://groups.google.com/forum/#%21msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ
- https://github.com/pypa/advisory-database/tree/main/vulns/django-basic-auth-ip-whitelist/PYSEC-2020-37.yaml
- https://github.com/tm-kn/django-basic-auth-ip-whitelist
- https://groups.google.com/forum/#!msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ
FAQ
Is CVE-2020-4071 being exploited?
There is no confirmed exploitation: CVE-2020-4071 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.36% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2020-4071?
Low: CVSS 2.2 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2020-4071?
django-basic-auth-ip-whitelist < 0.3.4.
Is there a fix for CVE-2020-4071?
Yes. Fixed in 0.3.4. Upgrade django-basic-auth-ip-whitelist to 0.3.4 or later.
How do I check if I'm affected by CVE-2020-4071?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.