CVE-2021-33571 Django Access Control Bypass possibly leading to SSRF, RFI, and LFI attacks
Attackers can bypass IP-based access controls in Django applications by using octal literals in IP addresses, potentially gaining unauthorized access.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-33571?
CVE-2021-33571 is a high-severity vulnerability in Djangoproject Django, published on 8 Jun 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
In Django 2.2 before 2.2.24, 3.x before 3.1.12, and 3.2 before 3.2.4, URLValidator, validate_ipv4_address, and validate_ipv46_address do not prohibit leading zero characters in octal literals. This may allow a bypass of access control that is based on IP addresses. (validate_ipv4_address and validate_ipv46_address are unaffected with Python 3.9.5+..) .
Weakness: CWE-918
Which versions are affected by CVE-2021-33571?
8 open source packages ship an affected version, including django and Django. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
django Bitnami | From 2.2.0 | 2.2.24, 3.1.12, 3.2.4 |
django PyPI | From 2.2 | 2.2.24, 3.1.12, 3.2.4 |
django PyPI | From 2.2a1 | 2.2.24 |
django PyPI | From 3.0a1 | 3.1.12 |
django PyPI | From 3.2a1 | 3.2.4 |
Django PyPI | From 2.2a1 | 2.2.24 |
2 more packages
Django PyPI | From 3.0a1 | 3.1.12 |
Django PyPI | From 3.2a1 | 3.2.4 |
Products include Djangoproject Django, Fedoraproject Fedora.
How do I fix CVE-2021-33571?
Upgrade django to a fixed version for your release line: 2.2.24, 3.1.12 or 3.2.4.
Is CVE-2021-33571 being exploited?
There is no known exploitation of CVE-2021-33571 in the wild and no public exploit code.
Other vulnerabilities in Djangoproject Django
- CVE-2026-4277 Privilege abuse in GenericInlineModelAdmin
- CVE-2024-53908 Django SQL injection in HasKey(lhs, rhs) on Oracle
- CVE-2024-42005 Django SQL injection vulnerability
- CVE-2023-31047 Django bypasses validation when using one form field to upload multiple files
- CVE-2022-34265 Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection
Sources
Also known as BIT-django-2021-33571, DEBIAN-CVE-2021-33571, GHSA-p99v-5w3c-jqq9, PYSEC-2021-99, UBUNTU-CVE-2021-33571.