CVE-2022-28347 SQL Injection in Django
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.
| Package | Affected | Fixed in |
|---|---|---|
django Bitnami | From 2.2.0 | 2.2.28, 3.2.13, 4.0.4 |
django PyPI | From 2.2 | 2.2.28 |
django PyPI | From 3.2 | 3.2.13 |
django PyPI | From 4.0 | 4.0.4, 3.2.13, 2.2.28 |
django PyPI | From 4.0 | 4.0.4 |
Django PyPI | From 2.2 | 2.2.28 |
2 more packages
Django PyPI | From 3.2 | 3.2.13 |
Django PyPI | From 4.0 | 4.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.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as BIT-django-2022-28347, DEBIAN-CVE-2022-28347, GHSA-w24h-v9qh-8gxj, PYSEC-2022-191, UBUNTU-CVE-2022-28347.