cve.bz

CVE-2022-34265 djangoproject django: SQL Injection

9.8 criticalEPSS 74%Fix available

Critical (9.8) in djangoproject django. EPSS 74% estimated probability of exploitation activity in the next 30 days. Fixed in django 3.2.14, 4.0.6.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
74% (unchanged from 74% a week ago; 74% 30 days ago) estimated probability of exploitation activity in the next 30 days; 99th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-34265 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-34265?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-34265?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-34265 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
djangoproject:djangofrom 3.2 before 3.2.14
djangoproject:djangofrom 4.0 before 4.0.6

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-p64x-8rxx-wf6qPyPIdjango>=3.2a1 <3.2.143.2.14
GHSA-p64x-8rxx-wf6qPyPIdjango>=4.0a1 <4.0.64.0.6
PYSEC-2022-213PyPIdjango>=3.2 <3.2.14
>=4.0 <4.0.6
3.2.14, 4.0.6

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10python-django1:1.11.29-1+deb10u2DLA-3164-1
Debian11python-django2:2.2.28-1~deb11u1DSA-5254-1
Debian12, 13, 14python-django2:4.0.6-1DEBIAN-CVE-2022-34265
Ubuntu18.04:LTSpython-django1:1.11.11-1ubuntu1.18UBUNTU-CVE-2022-34265 USN-5501-1
Ubuntu20.04:LTSpython-django2:2.2.12-1ubuntu0.12UBUNTU-CVE-2022-34265 USN-5501-1
Ubuntu22.04:LTSpython-django2:3.2.12-2ubuntu1.1UBUNTU-CVE-2022-34265 USN-5501-1
Red Hatrhui:4::el8python-django, python38-django0:3.2.14-3.el8uiRHSA-2022:5738
Red Hatsatellite:6.12::el8candlepin, candlepin-selinux0:4.1.15-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8foreman, foreman-cli, foreman-ec2 and 11 more0:3.3.0.17-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8rubygem-git0:1.11.0-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8rubygem-rails-html-sanitizer0:1.4.3-2.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8, satellite_capsule:6.12::el8python-django, python39-django0:3.2.14-2.el8pcRHSA-2022:8506
Red Hatsatellite:6.12::el8, satellite_capsule:6.12::el8rubygem-nokogiri, rubygem-nokogiri-debuginfo, rubygem-nokogiri-debugsource0:1.13.8-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8, satellite_capsule:6.12::el8rubygem-sinatra1:2.2.0-1.el8satRHSA-2022:8506
Red Hatsatellite_capsule:6.12::el8foreman, foreman-debug0:3.3.0.17-1.el8satRHSA-2022:8506
Red Hatsatellite_utils:6.12::el8foreman, foreman-cli0:3.3.0.17-1.el8satRHSA-2022:8506
SUSEHPE Helion OpenStack 8venv-openstack-horizon-hpe12.0.5~dev6-14.48.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-ansible8.0+git.1660773729.3789a6d-3.85.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8ardana-cobbler8.0+git.1660773402.d845a45-3.47.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-heat9.0.8~dev22-12.45.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8venv-openstack-murano4.0.2~dev3-12.38.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8grafana6.7.4-4.23.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8openstack-heat-templates0.0.0+git.1654529662.75fa04a-3.27.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8openstack-murano, openstack-murano-doc4.0.2~dev3-3.12.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8python-Django1.11.29-3.42.1SUSE-SU-2022:3338-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8rabbitmq-server3.6.16-3.13.1SUSE-SU-2022:3338-1
SUSEOpenStack Cloud 8venv-openstack-horizon12.0.5~dev6-14.48.1SUSE-SU-2022:3338-1
SUSEOpenStack Cloud 9ardana-ansible9.0+git.1660748476.c118d23-3.32.1SUSE-SU-2022:3339-1
15 more for SUSE in the JSON and on SUSE's page.
openSUSETumbleweedpython-Django4.0.6-1.1openSUSE-SU-2024:12172-1
openSUSETumbleweedpython-Django5.1.5-1.1openSUSE-SU-2025:14662-1
openSUSETumbleweedpython-Django44.2.14-1.1openSUSE-SU-2024:14208-1
openSUSETumbleweedpython-Django44.2.30-4.1openSUSE-SU-2026:11235-1
openSUSETumbleweedpython-Django55.2.16-1.1openSUSE-SU-2026:11270-1
openSUSETumbleweedpython-Django66.0-1.1openSUSE-SU-2026:10005-1
Rocky Linux8libdb0:5.3.28-42.el8_4RLSA-2022:8506
Alpinev3.16, v3.17, v3.18 and 6 morepy3-django3.2.14-r0ALPINE-CVE-2022-34265

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

Applications that constrain the lookup name and kind choice to a known safe list are unaffected.

Red Hat Satellite 6 versions include affected versions of python-django, however, the product is not vulnerable since it does not make use of vulnerable functions. Future updates may fix this issue.

ProductPackageStateAdvisory
Red Hat Satellite 6.12 for RHEL 8python-django-0:3.2.14-2.el8pcFixed 2022-11-16RHSA-2022:8506
RHUI 4 for RHEL 8python-django-0:3.2.14-3.el8uiFixed 2022-07-27RHSA-2022:5738
Red Hat Ansible Automation Platform 1.2ansible-towerAffected
Red Hat Ansible Automation Platform 2automation-controllerAffected
Red Hat Ansible Automation Platform 2python3-djangoAffected
Red Hat Ansible Automation Platform 2python-djangoAffected
Red Hat Ceph Storage 3python-djangoOut of support scope
Red Hat OpenStack Platform 13 (Queens)python-djangoNot affected
Red Hat OpenStack Platform 16.1python-django20Not affected
Red Hat OpenStack Platform 16.2python-django20Not affected
Red Hat Satellite 6python3-djangoNot affected
Red Hat Satellite 6python-pulp-containerNot affected
Red Hat Storage 3python-djangoAffected
Red Hat Update Infrastructure 3 for Cloud Providerspython-djangoAffected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-34265.

GitHub PoC (unverified)

Repositories on GitHub named after this CVE. Nobody has checked them and they are not scanned: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it.

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON