CVE-2022-34265

CRITICAL NUCLEI LAB

Django 3.2-3.2.14 - SQL Injection via Trunc() and Extract() Database Functions

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 6 public exploits for CVE-2022-34265. PoCs published by aeyesec, ZhaoQi99, traumatising. A Nuclei detection template is also available.

AI-analyzed exploit summary This repository contains a functional proof-of-concept for CVE-2022-34265, demonstrating SQL injection in Django's Trunc and Extract functions via crafted HTTP requests. The PoC includes a Dockerized environment with vulnerable Django 4.0.5 and PostgreSQL, along with test cases to verify the exploit.

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.

Exploits (6)

nomisec WORKING POC 124 stars
by aeyesec · poc
https://github.com/aeyesec/CVE-2022-34265

This repository contains a functional proof-of-concept for CVE-2022-34265, demonstrating SQL injection in Django's Trunc and Extract functions via crafted HTTP requests. The PoC includes a Dockerized environment with vulnerable Django 4.0.5 and PostgreSQL, along with test cases to verify the exploit.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Moderate
Reliability
Reliable
Target: Django 3.2.x prior to 3.2.14, Django 4.0.x prior to 4.0.6
No auth needed
Prerequisites: Django application using Trunc or Extract functions with user-controlled input
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 4 stars
by ZhaoQi99 · poc
https://github.com/ZhaoQi99/CVE-2022-34265

This repository contains a functional proof-of-concept for CVE-2022-34265, a SQL injection vulnerability in Django's `Trunc()` and `Extract()` database functions. It includes a Dockerized Django application with vulnerable endpoints and payloads to demonstrate the exploit.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django 3.2.x < 3.2.14, Django 4.0.x < 4.0.6
No auth needed
Prerequisites: Django application with vulnerable version · Access to vulnerable endpoint
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 3 stars
by traumatising · poc
https://github.com/traumatising/CVE-2022-34265

This repository contains a functional Django application demonstrating CVE-2022-34265, a SQL injection vulnerability in Django's Trunc and Extract functions. The PoC includes vulnerable views that directly pass user-controlled input to these functions, allowing arbitrary SQL execution.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django 4.0.5
No auth needed
Prerequisites: Django application with vulnerable Trunc/Extract usage · PostgreSQL database
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 1 stars
by lnwza0x0a · poc
https://github.com/lnwza0x0a/CTF_Django_CVE-2022-34265

This repository provides a functional Django application demonstrating CVE-2022-34265, a SQL injection vulnerability in Django's `Trunc()` and `Extract()` database functions. It includes a Dockerized environment and example payloads to exploit the vulnerability via crafted HTTP requests.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django 3.2.x (before 3.2.14) and 4.0.x (before 4.0.6)
No auth needed
Prerequisites: Django application using `Trunc()` or `Extract()` functions with untrusted input
devstral-2 · analyzed Feb 18, 2026 Full analysis →
gitlab WORKING POC
by ZhaoQi99 · poc
https://gitlab.com/ZhaoQi99/CVE-2022-34265

This repository contains a functional proof-of-concept for CVE-2022-34265, a SQL injection vulnerability in Django's `Trunc()` and `Extract()` database functions. It includes a Dockerized Django application with vulnerable endpoints (`/extract/` and `/trunc/`) and provides payloads to exploit the vulnerability.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django 3.2.x < 3.2.14, Django 4.0.x < 4.0.6
No auth needed
Prerequisites: Django application with vulnerable `Trunc()` or `Extract()` function usage · Access to the vulnerable endpoint
devstral-2 · analyzed Feb 27, 2026 Full analysis →
inthewild WORKING POC
poc
https://github.com/not-xences/cve-2022-34265

This repository contains a functional Django application demonstrating CVE-2022-34265, a SQL injection vulnerability in Django's Trunc and Extract functions. The PoC includes vulnerable views that allow arbitrary SQL execution via user-controlled input in the 'kind' and 'lookup_name' parameters.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django 4.0.5
No auth needed
Prerequisites: Django application with vulnerable Trunc/Extract usage · PostgreSQL database
devstral-2 · analyzed Feb 23, 2026 Full analysis →

Nuclei Templates (1)

Django - SQL injection
CRITICALby princechaddha

Scores

CVSS v3 9.8
EPSS 0.9283
EPSS Percentile 99.8%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Lab Environment

COMMUNITY
Community Lab
docker pull postgres:latest
docker pull mysql:5.7
+2 more repos

Details

CWE
CWE-89
Status published
Products (2)
djangoproject/django 3.2 - 3.2.14
pypi/Django 3.2a1 - 3.2.14PyPI
Published Jul 04, 2022
Tracked Since Feb 18, 2026