CVE-2022-28347 SQL Injection in Django

Critical 9.8 Published Updated

Attackers can execute arbitrary SQL commands via crafted dictionary keys in QuerySet.explain(), potentially reading or modifying database contents.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-28347?

CVE-2022-28347 is a critical SQL injection vulnerability in Debian Debian Linux, published on 12 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A SQL injection issue was discovered in QuerySet.explain() in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. This occurs by passing a crafted dictionary (with dictionary expansion) as the **options argument, and placing the injection payload in an option name.

Weakness: CWE-89

Which versions are affected by CVE-2022-28347?

8 open source packages ship an affected version, including django and Django. It affects 2 products.

PackageAffectedFixed in
django BitnamiFrom 2.2.02.2.28, 3.2.13, 4.0.4
django PyPIFrom 2.22.2.28
django PyPIFrom 3.23.2.13
django PyPIFrom 4.04.0.4, 3.2.13, 2.2.28
django PyPIFrom 4.04.0.4
Django PyPIFrom 2.22.2.28
2 more packages
Django PyPIFrom 3.23.2.13
Django PyPIFrom 4.04.0.4

Products include Debian Debian Linux, Djangoproject Django.

How do I fix CVE-2022-28347?

Upgrade django to a fixed version for your release line: 2.2.28, 3.2.13 or 4.0.4.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2022-28347 being exploited?

There is no known exploitation of CVE-2022-28347 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as BIT-django-2022-28347, DEBIAN-CVE-2022-28347, GHSA-w24h-v9qh-8gxj, PYSEC-2022-191, UBUNTU-CVE-2022-28347.

Is CVE-2022-28347 in your software?

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

Check your SBOMs for free