CVE-2022-28346 — SQL Injection in django — CVE Details
SQL Injection in Django
What Should I Do?
Low-to-Moderate Risk
Exploitation probability is 14.81% in 30 days. Address in your next planned sprint.
Does your project use an affected django version?
Paste your requirements.txt to check it for CVE-2022-28346 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published April 13, 2022 (1688 days ago).
- Last revised February 21, 2025 — 1045 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "django>=3.2.13"
pip install "django>=4.0.4"
pip install "django>=2.2.28"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: PyPI (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-89SQL InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-28346ADVISORY
- https://github.com/django/django/commit/2044dac5c6968441be6f534c4139bcf48c5c7e48WEB
- https://github.com/django/django/commit/2c09e68ec911919360d5f8502cefc312f9e03c5dWEB
- https://github.com/django/django/commit/800828887a0509ad1162d6d407e94d8de7eafc60WEB
- https://github.com/django/django/commit/93cae5cb2f9a4ef1514cf1a41f714fef08005200WEB
- https://docs.djangoproject.com/en/4.0/releases/securityWEB
- https://github.com/advisories/GHSA-2gwj-7jmv-h26rADVISORY
- https://github.com/django/djangoPACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-190.yamlWEB
- https://groups.google.com/forum/#!forum/django-announceWEB
- https://lists.debian.org/debian-lts-announce/2022/04/msg00013.htmlWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IKWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQIWEB
- https://security.netapp.com/advisory/ntap-20220609-0002WEB
- https://www.debian.org/security/2022/dsa-5254WEB
- https://www.djangoproject.com/weblog/2022/apr/11/security-releasesWEB
- https://www.openwall.com/lists/oss-security/2022/04/11/1WEB
Frequently Asked Questions
- What is CVE-2022-28346?
- SQL Injection in Django. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2022-28346?
- CVE-2022-28346 affects django. It has a 14.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-28346 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top 5% of EPSS-scored vulnerabilities — 97.3% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2022-28347CRITICAL
SQL Injection in Django
- CVE-2021-45115HIGH
Denial-of-service in Django
- CVE-2026-48588MEDIUM
- CVE-2026-53877MEDIUM
- CVE-2024-45230MEDIUM
Django vulnerable to denial-of-service attack via the urlize() and urlizetrunc() template filters
- CVE-2024-41989MEDIUM
Django memory consumption vulnerability
- CVE-2025-27556MEDIUM
Django Potential Denial of Service (DoS) on Windows
- CVE-2023-31047