What’s Vulnerable › Vulnerabilities
CVE-2022-28346: SQL Injection in Django
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 18.7% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-04-12 · updated 2026-06-17
- Weakness: CWE-89
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.
Affected products
- Debian Linux: 9.0, 11.0
- Django: from 2.2 before 2.2.28; from 3.2 before 3.2.13; from 4.0 before 4.0.4 — fixed in 2.2.28, 3.2.13, 4.0.4
- Pypi Django: from 4.0 before 4.0.4; from 3.2 before 3.2.13; from 2.2 before 2.2.28; 2.2, 2.2.1, 2.2.10, 2.2.11, 2.2.12, 2.2.13 (+39) — fixed in 4.0.4, 3.2.13, 2.2.28
How to fix
Upgrade to a fixed version: Django 2.2.28, 3.2.13, 4.0.4; Pypi Django 4.0.4, 3.2.13, 2.2.28. Check the vendor advisory for mitigations.
References
- http://www.openwall.com/lists/oss-security/2022/04/11/1
- https://docs.djangoproject.com/en/4.0/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- https://lists.debian.org/debian-lts-announce/2022/04/msg00013.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI/
- https://security.netapp.com/advisory/ntap-20220609-0002/
- https://www.debian.org/security/2022/dsa-5254
- https://www.djangoproject.com/weblog/2022/apr/11/security-releases/
- http://www.openwall.com/lists/oss-security/2022/04/11/1
- https://docs.djangoproject.com/en/4.0/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
Get alerted when CVE-2022-28346 or the next vulnerability affects your stack