CVE-2022-28347 — SQL Injection in django — CVE Details
SQL Injection in Django
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (2.59%). Schedule for your next planned update.
Does your project use an affected django version?
Paste your requirements.txt to check it for CVE-2022-28347 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
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.
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-28347ADVISORY
- https://github.com/django/django/commit/00b0fc50e1738c7174c495464a5ef069408a4402WEB
- https://github.com/django/django/commit/29a6c98b4c13af82064f993f0acc6e8fafa4d3f5WEB
- https://github.com/django/django/commit/6723a26e59b0b5429a0c5873941e01a2e1bdbb81WEB
- https://github.com/django/django/commit/9e19accb6e0a00ba77d5a95a91675bf18877c72dWEB
- https://docs.djangoproject.com/en/4.0/releases/securityWEB
- https://github.com/advisories/GHSA-w24h-v9qh-8gxjADVISORY
- https://github.com/django/djangoPACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-191.yamlWEB
- https://groups.google.com/forum/#!forum/django-announceWEB
- 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://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-28347?
- 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-28347?
- CVE-2022-28347 affects django. It has a 2.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-28347 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 quartile of EPSS-scored vulnerabilities — 86% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2020-24583HIGH
Django Incorrect Default Permissions
- CVE-2026-15307HIGH
Django GeoDjango spatial lookups allow file writes and outbound requests through GDAL raster parsing
- CVE-2026-53878MEDIUM
- CVE-2024-45230MEDIUM
Django vulnerable to denial-of-service attack via the urlize() and urlizetrunc() template filters
- CVE-2026-33033MEDIUM
Django has potential DoS via MultiPartParser through crafted multipart uploads
- CVE-2021-45452MEDIUM
Directory-traversal in Django
- CVE-2024-53907
- CVE-2024-53908