CVE-2021-33571 Django Access Control Bypass possibly leading to SSRF, RFI, and LFI attacks

High 7.5 Published Updated

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.

PackageAffectedFixed in
django BitnamiFrom 2.2.02.2.24, 3.1.12, 3.2.4
django PyPIFrom 2.22.2.24, 3.1.12, 3.2.4
django PyPIFrom 2.2a12.2.24
django PyPIFrom 3.0a13.1.12
django PyPIFrom 3.2a13.2.4
Django PyPIFrom 2.2a12.2.24
2 more packages
Django PyPIFrom 3.0a13.1.12
Django PyPIFrom 3.2a13.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.

All Djangoproject Django vulnerabilities

Sources

Also known as BIT-django-2021-33571, DEBIAN-CVE-2021-33571, GHSA-p99v-5w3c-jqq9, PYSEC-2021-99, UBUNTU-CVE-2021-33571.

Is CVE-2021-33571 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free