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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-django | 2:4.0.6-1 | — |
| Debian 13 | python-django | 2:4.0.6-1 | — |
| Debian 12 | python-django | 2:4.0.6-1 | — |
| Debian 11 | python-django | 2:2.2.28-1~deb11u1 | DSA-5254-1 |
| Debian 10 | python-django | 1:1.11.29-1+deb10u2 | DLA-3164-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | python-django | 2:3.2.12-2ubuntu1.1 | USN-5501-1 |
| Ubuntu 20.04 LTS | python-django | 2:2.2.12-1ubuntu0.12 | USN-5501-1 |
| Ubuntu 18.04 LTS | python-django | 1:1.11.11-1ubuntu1.18 | USN-5501-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Satellite Utils 6 | foreman +1 | 3.3.0.17-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite Capsule 6 | foreman +1 | 3.3.0.17-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite Capsule 6 | python-django +1 | 3.2.14-2.el8pc | RHSA-2022:8506 |
| Red Hat Satellite Capsule 6 | rubygem-nokogiri | 1.13.8-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite Capsule 6 | rubygem-sinatra | 1:2.2.0-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite 6 | candlepin +1 | 4.1.15-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite 6 | foreman +13 | 3.3.0.17-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite 6 | python-django +1 | 3.2.14-2.el8pc | RHSA-2022:8506 |
| Red Hat Satellite 6 | rubygem-git | 1.11.0-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite 6 | rubygem-nokogiri | 1.13.8-1.el8sat | RHSA-2022:8506 |
| Red Hat Satellite 6 | rubygem-rails-html-sanitizer | 1.4.3-2.el8sat | RHSA-2022:8506 |
| Red Hat Satellite 6 | rubygem-sinatra | 1:2.2.0-1.el8sat | RHSA-2022:8506 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Rhui 4 | python-django +1 | 3.2.14-3.el8ui | RHSA-2022:5738 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 8 | libdb | 5.3.28-42.el8_4 | RLSA-2022:8506 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE OpenStack Cloud Crowbar 9 | grafana | 6.7.4-3.29.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | openstack-heat-templates | 0.0.0+git.1654529662.75fa04a7-3.15.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | openstack-horizon-plugin-gbp-ui | 14.0.1~dev4-3.12.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | openstack-neutron-gbp | 14.0.1~dev46-3.34.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | openstack-nova | 18.3.1~dev92-3.43.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | python-Django1 | 1.11.29-3.40.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | rabbitmq-server | 3.6.16-4.3.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 9 | rubygem-puma | 2.16.0-4.18.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud Crowbar 8 | grafana | 6.7.4-4.23.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud Crowbar 8 | openstack-heat-templates | 0.0.0+git.1654529662.75fa04a-3.27.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud Crowbar 8 | openstack-murano +1 | 4.0.2~dev3-3.12.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud Crowbar 8 | python-Django | 1.11.29-3.42.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud Crowbar 8 | rabbitmq-server | 3.6.16-3.13.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud Crowbar 8 | rubygem-puma | 2.16.0-3.18.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 9 | ardana-ansible | 9.0+git.1660748476.c118d23-3.32.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | ardana-cobbler | 9.0+git.1660747489.119efcd-3.19.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | ardana-tempest | 9.0+git.1651855288.a2341ad-3.22.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | grafana | 6.7.4-3.29.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | openstack-heat-templates | 0.0.0+git.1654529662.75fa04a7-3.15.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | openstack-horizon-plugin-gbp-ui | 14.0.1~dev4-3.12.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | openstack-neutron-gbp | 14.0.1~dev46-3.34.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | openstack-nova | 18.3.1~dev92-3.43.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | python-Django1 | 1.11.29-3.40.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | rabbitmq-server | 3.6.16-4.3.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | venv-openstack-heat | 11.0.4~dev4-3.37.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | venv-openstack-horizon | 14.1.1~dev11-4.41.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | venv-openstack-neutron | 13.0.8~dev206-6.41.1 | SUSE-SU-2022:3339-1 |
| SUSE OpenStack Cloud 9 | venv-openstack-nova | 18.3.1~dev92-3.41.1 | SUSE-SU-2022:3339-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE OpenStack Cloud 8 | ardana-ansible | 8.0+git.1660773729.3789a6d-3.85.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | ardana-cobbler | 8.0+git.1660773402.d845a45-3.47.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | grafana | 6.7.4-4.23.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | openstack-heat-templates | 0.0.0+git.1654529662.75fa04a-3.27.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | openstack-murano +1 | 4.0.2~dev3-3.12.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | python-Django | 1.11.29-3.42.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | rabbitmq-server | 3.6.16-3.13.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | venv-openstack-heat | 9.0.8~dev22-12.45.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | venv-openstack-horizon | 12.0.5~dev6-14.48.1 | SUSE-SU-2022:3338-1 |
| SUSE OpenStack Cloud 8 | venv-openstack-murano | 4.0.2~dev3-12.38.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | ardana-ansible | 8.0+git.1660773729.3789a6d-3.85.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | ardana-cobbler | 8.0+git.1660773402.d845a45-3.47.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | grafana | 6.7.4-4.23.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | openstack-heat-templates | 0.0.0+git.1654529662.75fa04a-3.27.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | openstack-murano +1 | 4.0.2~dev3-3.12.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | python-Django | 1.11.29-3.42.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | rabbitmq-server | 3.6.16-3.13.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | venv-openstack-heat | 9.0.8~dev22-12.45.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | venv-openstack-horizon-hpe | 12.0.5~dev6-14.48.1 | SUSE-SU-2022:3338-1 |
| SUSE HPE Helion OpenStack 8 | venv-openstack-murano | 4.0.2~dev3-12.38.1 | SUSE-SU-2022:3338-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-Django | 4.0.6-1.1 | openSUSE-SU-2025:14662-1, openSUSE-SU-2024:12172-1 |
| openSUSE Tumbleweed | python-Django4 | 4.2.14-1.1 | openSUSE-SU-2026:11235-1, openSUSE-SU-2024:14208-1 |
| openSUSE Tumbleweed | python-Django5 | 5.2.16-1.1 | openSUSE-SU-2026:11270-1 |
| openSUSE Tumbleweed | python-Django6 | 6.0-1.1 | openSUSE-SU-2026:10005-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-django | 3.2.14-r0 | — |
| Alpine v3.23 | py3-django | 3.2.14-r0 | — |
| Alpine v3.22 | py3-django | 3.2.14-r0 | — |
| Alpine v3.21 | py3-django | 3.2.14-r0 | — |
| Alpine v3.20 | py3-django | 3.2.14-r0 | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | py3-django | 3.2.14-r0 | — |
| Alpine v3.18 | py3-django | 3.2.14-r0 | — |
| Alpine v3.17 | py3-django | 3.2.14-r0 | — |
| Alpine v3.16 | py3-django | 3.2.14-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 5 repositories
-
aeyesec/CVE-2022-34265 ★ 124 · Jul 7, 2022
PoC for CVE-2022-34265 (Django)
-
ZhaoQi99/CVE-2022-34265 ★ 4 · Aug 24, 2022
PoC for CVE-2022-34265
-
traumatising/CVE-2022-34265 ★ 3 · Jul 13, 2022
CVE-2022-34265 Vulnerability
-
lnwza0x0a/CTF_Django_CVE-2022-34265 ★ 1 · Sep 8, 2022
-
CyberCTF/vulhub-django-cve-2022-34265 ★ 0 · Oct 8, 2026
Vulhub django/CVE-2022-34265: Django Trunc and Extract SQL Injection (CVE-2022-34265), run with Isoloom
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | django | >= 3.2a1, < 3.2.14 | 3.2.14 | GHSA-p64x-8rxx-wf6q |
| PyPI | django | >= 4.0a1, < 4.0.6 | 4.0.6 | GHSA-p64x-8rxx-wf6q |
| PyPI | django | >= 3.2, < 3.2.14 · >= 4.0, < 4.0.6 | 3.2.14, 4.0.6 | PYSEC-2022-213 |
Advisories 15
- RHSA-2022:8506 Red Hat Security Advisory: Satellite 6.12 Release Red Hat Security Advisories (RHSA) · Oct 13, 2026
- openSUSE-SU-2026:11270-1 python313-Django5-5.2.16-1.1 on GA media SUSE / openSUSE Security Updates · Jul 15, 2026
- WID-SEC-2022-0847 Red Hat Enterprise Linux (Django): Schwachstelle ermöglicht Manipulation von Dateien BSI CERT-Bund (WID) · Jul 12, 2026
- openSUSE-SU-2026:11235-1 python313-Django4-4.2.30-4.1 on GA media SUSE / openSUSE Security Updates · Jul 10, 2026
- RHSA-2022:5738 Red Hat Security Advisory: Django 3.2.14 Security Update Red Hat Security Advisories (RHSA) · May 21, 2026
- openSUSE-SU-2026:10005-1 python312-Django6-6.0-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- DSA-5254-1 python-django - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3164-1 python-django - security update Debian Security (DSA / DLA) · Mar 9, 2026
- USN-5501-1 python-django vulnerability Ubuntu Security Notices (USN) · Feb 10, 2026
- RLSA-2022:8506 Important: Satellite 6.12 Release Rocky Linux Security Advisories · Feb 4, 2026
- SUSE-SU-2022:3338-1 Security update for ardana-ansible, ardana-cobbler, grafana, openstack-heat-templates, openstack-murano, python-Django, rabbitmq-server, rubygem-puma SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:12172-1 python310-Django-4.0.6-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2022:3339-1 Security update for ardana-ansible, ardana-cobbler, ardana-tempest, grafana, openstack-heat-templates, openstack-horizon-plugin-gbp-ui, openstack-neutron-gbp, openstack-nova, python-Django1, rabbitmq-server, rubygem-puma SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2025:14662-1 python311-Django-5.1.5-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14208-1 python310-Django4-4.2.14-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://groups.google.com/forum/#%21forum/django-announce
- https://docs.djangoproject.com/en/4.0/releases/security/
- https://www.djangoproject.com/weblog/2022/jul/04/security-releases/
- https://security.netapp.com/advisory/ntap-20220818-0006/
- DSA-5254 vendor-advisory
- FEDORA-2023-8fed428c5e vendor-advisory
- FEDORA-2023-a53ab7c969 vendor-advisory