CVE-2022-28346 SQL Injection in Django
Attackers can execute arbitrary SQL commands via crafted dictionary arguments in Django QuerySet methods, potentially accessing 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-28346?
CVE-2022-28346 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
An issue was discovered in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. QuerySet.annotate(), aggregate(), and extra() methods are subject to SQL injection in column aliases via a crafted dictionary (with dictionary expansion) as the passed **kwargs.
Weakness: CWE-89
Which versions are affected by CVE-2022-28346?
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 |
Linux distribution packages (1)
python-django20 Red Hat:openstack:16.2::el8 | All versions | 0:2.0.13-17.el8ost |
Products include Debian Debian Linux, Djangoproject Django.
How do I fix CVE-2022-28346?
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-28346 being exploited?
There is no known exploitation of CVE-2022-28346 in the wild and no public exploit code.
Public exploit code: 4 proofs of concept on GitHub.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as BIT-django-2022-28346, DEBIAN-CVE-2022-28346, DLA-2982-1, GHSA-2gwj-7jmv-h26r, PYSEC-2022-190, RHSA-2022:5115 and 1 more.