PT-2022-3421 · Django+5 · Django+5

Takuto Yoshikai

·

Published

2022-04-07

·

Updated

2026-01-03

·

CVE-2022-34265

CVSS v3.1

9.8

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Django versions 3.2.0 through 3.2.13 Django versions 4.0.0 through 4.0.5
Description The issue is related to SQL injection in the Trunc() and Extract() database functions when untrusted data is used as a kind/lookup name value. This can allow an attacker to access or delete database data. Applications that constrain the lookup name and kind choice to a known safe list are unaffected. The vulnerability exists in the main branch and versions 4.1, 4.0, and 3.2 of Django. It is estimated that tens of thousands of website owners are affected.
Recommendations For Django versions 3.2.0 through 3.2.13, update to version 3.2.14 or later. For Django versions 4.0.0 through 4.0.5, update to version 4.0.6 or later. As a temporary workaround, consider validating and sanitizing input data for the kind and lookup name parameters before passing them to the Trunc() and Extract() functions. Restrict access to the Trunc() and Extract() functions to minimize the risk of exploitation.

Exploit

Fix

SQL injection

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALSA-2025_16880
ALT-PU-2022-2476
ALT-PU-2022-2521
BDU:2022-04199
BIT-DJANGO-2022-34265
CVE-2022-34265
DLA-3164-1
DSA-5254-1
GHSA-P64X-8RXX-WF6Q
MGASA-2022-0281
OPENSUSE-SU-2024:12172-1
OPENSUSE-SU-2024:14208-1
OPENSUSE-SU-2025:14662-1
OPENSUSE-SU-2026:10005-1
PYSEC-2022-213
RHSA-2022:5738
RHSA-2022:8506
RLSA-2022:8506
RLSA-2022_8506
SUSE-SU-2022:3338-1
SUSE-SU-2022:3339-1
USN-5501-1

Affected Products

Alt Linux
Astra Linux
Django
Linuxmint
Rocky Linux
Ubuntu