CVE-2022-34265
Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection
Reported by mitre · Published July 4, 2022
Django is fixed in 4.0.6 and 3.2.14 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| Django | PyPI | 4.0.6, 3.2.14 |
| django | Bitnami | 4.0.6, 3.2.14 |
| python-django | Arch Linux | 4.0.6-1 |
| py3-django | Alpine | 3.2.14-r0 |
| django | Bitnami | 4.0.6, 3.2.14 |
| django | djangoproject | 4.0.6, 3.2.14 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| PyPI | Django | 3.2a1, 4.0a1 |
| arch | python-django | 0 |
| alpine | py3-django | 0 |
| n/a | n/a | * |
Timeline
- Jul 4, 2022 CVE Published
- Jul 5, 2022 EPSS Score (30 in total, the first dated here)
- Mar 9, 2026 Security Advisory (6 in total, the first dated here)
- Mar 17, 2026 Distribution Patch (3 in total, the first dated here)
- Jun 22, 2026 Coalition ESS Score
- Sep 8, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-34265
vulnetix vdb fixes CVE-2022-34265
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-34265/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- DSA-5254 vendor-advisory
- FEDORA-2023-8fed428c5e vendor-advisory
- FEDORA-2023-a53ab7c969 vendor-advisory
- https://nvd.nist.gov/vuln/detail/CVE-2022-34265 advisory
- https://github.com/advisories/GHSA-p64x-8rxx-wf6q advisory
- https://github.com/django/django/commit/0dc9c016fadb71a067e5a42be30164e3f96c0492 patch
- https://github.com/django/django/commit/5e2f4ddf2940704a26a4ac782b851989668d74db patch
- https://github.com/django/django/commit/877c800f255ccaa7abde1fb944de45d1616f5cc9 patch
- https://github.com/django/django/commit/a9010fe5555e6086a9d9ae50069579400ef0685e patch
- https://docs.djangoproject.com/en/4.0/releases/security url
- https://github.com/django/django url
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-213.yaml advisory
- https://groups.google.com/forum/#!forum/django-announce url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI url
- https://security.netapp.com/advisory/ntap-20220818-0006 advisory
…and 1 more