CVE-2022-34265 — Vulnerability in django — CVE Details
Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection
What Should I Do?
Fix in Your Next Sprint
This vulnerability has a 92.83% chance of being exploited within 30 days.
Summary
Advisory Timeline
- First published July 5, 2022 (1560 days ago).
- Last revised February 21, 2025 — 962 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "django>=3.2.14"
pip install "django>=4.0.6"
After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.
Affected Packages (2)
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-34265ADVISORY
- https://github.com/django/django/commit/0dc9c016fadb71a067e5a42be30164e3f96c0492WEB
- https://github.com/django/django/commit/5e2f4ddf2940704a26a4ac782b851989668d74dbWEB
- https://github.com/django/django/commit/877c800f255ccaa7abde1fb944de45d1616f5cc9WEB
- https://github.com/django/django/commit/a9010fe5555e6086a9d9ae50069579400ef0685eWEB
- https://docs.djangoproject.com/en/4.0/releases/securityWEB
- https://github.com/advisories/GHSA-p64x-8rxx-wf6qADVISORY
- https://github.com/django/djangoPACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-213.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://security.netapp.com/advisory/ntap-20220818-0006WEB
- https://www.debian.org/security/2022/dsa-5254WEB
- https://www.djangoproject.com/weblog/2022/jul/04/security-releasesWEB
Frequently Asked Questions
- What is CVE-2022-34265?
- Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection 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-34265?
- CVE-2022-34265 affects django. It has a 92.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-34265 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation is straightforward and causes maximum impact. Patch immediately.
This places it in the top 5% of EPSS-scored vulnerabilities — 99.8% 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-23833HIGH
Infinite Loop in Django
- CVE-2025-57833HIGH
Django is subject to SQL injection through its column aliases
- CVE-2021-45116HIGH
Information disclosure in Django
- CVE-2025-48432MEDIUM
Django Improper Output Neutralization for Logs vulnerability
- CVE-2021-31542
- CVE-2021-32052
- CVE-2021-3281
- CVE-2021-33203
Check if you're affected
Scan your dependencies to see if this vulnerability affects your projects.
Scan Your Dependencies