What’s Vulnerable › Vulnerabilities
CVE-2022-34265: Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 73.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-07-04 · updated 2026-06-17
- Weakness: CWE-89
Description
An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. The Trunc() and Extract() database functions are subject to SQL injection if untrusted data is used as a kind/lookup_name value. Applications that constrain the lookup name and kind choice to a known safe list are unaffected.
Affected products
- Django: from 3.2 before 3.2.14; from 4.0 before 4.0.6 — fixed in 3.2.14, 4.0.6
- Pypi Django: from 3.2 before 3.2.14; from 4.0 before 4.0.6; 3.2, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.13 (+14) — fixed in 3.2.14, 4.0.6
How to fix
Upgrade to a fixed version: Django 3.2.14, 4.0.6; Pypi Django 3.2.14, 4.0.6. Check the vendor advisory for mitigations.
References
- https://docs.djangoproject.com/en/4.0/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- 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-20220818-0006/
- https://www.debian.org/security/2022/dsa-5254
- https://www.djangoproject.com/weblog/2022/jul/04/security-releases/
- https://docs.djangoproject.com/en/4.0/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- 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-20220818-0006/
Get alerted when CVE-2022-34265 or the next vulnerability affects your stack