CVE-2020-4071: Django basic auth ip whitelist Timing Attack On Django-basic-auth-ip-whitelist Vulnerability
MODERATECVE-2020-4071 is a MODERATE (CVSS 2.2) timing attack on django-basic-auth-ip-whitelist vulnerability (CWE-208: Observable Timing Discrepancy) affecting Django basic auth ip whitelist libraries in the PyPI ecosystem. The issue involves timing attack on django-basic-auth-ip-whitelist. Remediation is available by upgrading affected packages to version 0.3.4.
CVE-2020-4071 at a Glance
Security Impact
CVSS: 2.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N).
How to Fix CVE-2020-4071
To remediate this vulnerability, upgrade all affected Django basic auth ip whitelist dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install django-basic-auth-ip-whitelist>=0.3.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show django-basic-auth-ip-whitelist
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-4071, inspect your installed packages using pip:
pip show django-basic-auth-ip-whitelist
Analyze the terminal output to locate any version of Django basic auth ip whitelist in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.4), your application is affected.
Note: The pip show django-basic-auth-ip-whitelist command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-208: Observable Timing Discrepancy, where two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not. In Django basic auth ip whitelist, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-4071 Affected Django basic auth ip whitelist Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
django-basic-auth-ip-whitelist
|
PyPI |
< 0.3.4
|
0.3.4
|
References
Frequently Asked Questions
What is CVE-2020-4071?
Which Django basic auth ip whitelist versions are affected?
What version fixes CVE-2020-4071?
Is django-basic-auth-ip-whitelist affected?
What is the CVSS score of CVE-2020-4071?
What CWE is associated with CVE-2020-4071?
How can I check PyPI dependencies for CVE-2020-4071?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m38j-pmg3-v5x5",
"modified" : "2024-11-18T16:26:09Z",
"published" : "2020-06-23T19:58:27Z",
"aliases" : [ "CVE-2020-4071" ],
"summary" : "Timing attack on django-basic-auth-ip-whitelist",
"details" : "### Impact\n\nPotential 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.\n\nSites protected by IP address whitelisting only are unaffected by this vulnerability.\n\n### Patches\nThis 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.\n\n### Workarounds\nStop 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.\n\n### References\n\n- [Django mailing list discussion](https://groups.google.com/forum/#!msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue at https://github.com/tm-kn/django-basic-auth-ip-whitelist/issues\n* Email us at the email specified on the [security policy](https://github.com/tm-kn/django-basic-auth-ip-whitelist/security/policy).\n\n### Acknowledgements\n\nThanks to Thibaud Colas for reporting this.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "django-basic-auth-ip-whitelist"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tm-kn/django-basic-auth-ip-whitelist/security/advisories/GHSA-m38j-pmg3-v5x5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-4071"
}, {
"type" : "WEB",
"url" : "https://github.com/tm-kn/django-basic-auth-ip-whitelist/commit/effe05ed1ed9e1ccc675a65b69d36217e5c5dfc6"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django-basic-auth-ip-whitelist/PYSEC-2020-37.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tm-kn/django-basic-auth-ip-whitelist"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/forum/#!msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-208" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-23T19:56:14Z",
"nvd_published_at" : null
}
}