CVE-2025-57833

HIGH LAB

Django 4.2-4.2.23, 5.1-5.1.11, 5.2-5.2.5 - SQL Injection via FilteredRelation Column Aliases

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 5 public exploits for CVE-2025-57833. PoCs published by Mkway, sw0rd1ight, Gayang2902.

AI-analyzed exploit summary This repository demonstrates CVE-2025-57833, a critical SQL injection vulnerability in Django's ORM affecting versions 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6. The vulnerability arises from unsanitized user input used as dictionary keys in `annotate()` or `alias()` with `FilteredRelation`, potentially leading to RCE via PostgreSQL.

Description

An issue was discovered in Django 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6. FilteredRelation is subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed QuerySet.annotate() or QuerySet.alias().

Exploits (5)

nomisec WORKING POC 3 stars
by Mkway · poc
https://github.com/Mkway/CVE-2025-57833

This repository demonstrates CVE-2025-57833, a critical SQL injection vulnerability in Django's ORM affecting versions 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6. The vulnerability arises from unsanitized user input used as dictionary keys in `annotate()` or `alias()` with `FilteredRelation`, potentially leading to RCE via PostgreSQL.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Moderate
Reliability
Reliable
Target: Django (4.2 before 4.2.24, 5.1 before 5.1.12, 5.2 before 5.2.6)
No auth needed
Prerequisites: Django application using `FilteredRelation` with user-controlled input as dictionary keys · PostgreSQL database for RCE
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 2 stars
by sw0rd1ight · poc
https://github.com/sw0rd1ight/CVE-2025-57833

This repository contains a working proof-of-concept for CVE-2025-57833, a SQL injection vulnerability in Django's FilteredRelation feature. The exploit demonstrates how unvalidated alias names in QuerySet annotations can lead to SQL injection via malicious dictionary keys.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Moderate
Reliability
Reliable
Target: Django (versions 4.2 < 4.2.24, 5.1 < 5.1.12, 5.2 < 5.2.6)
No auth needed
Prerequisites: Access to a Django application using FilteredRelation with user-controlled input in annotations
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 2 stars
by Gayang2902 · poc
https://github.com/Gayang2902/CVE-2025-57833

This repository contains a Django application demonstrating CVE-2025-57833, likely related to SQL injection or ORM manipulation given the debug SQL logging and model structure. The exploit.py file (not fully shown) is expected to contain the PoC for triggering the vulnerability.

Classification
Working Poc 80%
Attack Type
Sqli
Complexity
Moderate
Reliability
Reliable
Target: Django 5.2 (with PostgreSQL/MySQL)
No auth needed
Prerequisites: Django application with vulnerable ORM queries · Database access
devstral-2 · analyzed Feb 16, 2026 Full analysis →
github WORKING POC 2 stars
by ianoboyle · pythonpoc
https://github.com/ianoboyle/CVE-2025-57833

This repository contains a functional Django application demonstrating CVE-2025-57833, a SQL injection vulnerability via dictionary expansion in QuerySet.annotate() or QuerySet.alias(). The exploit leverages untrusted input passed to the alias() method, allowing arbitrary SQL injection.

Classification
Working Poc 90%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6
No auth needed
Prerequisites: Access to a vulnerable Django application endpoint
devstral-2 · analyzed Feb 19, 2026 Full analysis →
nomisec WORKING POC 2 stars
by loic-houchi · poc
https://github.com/loic-houchi/Django-faille-CVE-2025-57833_test

This repository demonstrates a SQL injection vulnerability (CVE-2025-57833) in Django versions prior to 4.2.23, where dynamic alias usage in `annotate()` or `alias()` functions allows arbitrary SQL execution via user-controlled input.

Classification
Working Poc 95%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: Django < 4.2.23
No auth needed
Prerequisites: Django application with vulnerable `annotate()` or `alias()` usage · User-controlled input passed to these functions
devstral-2 · analyzed Feb 16, 2026 Full analysis →

Scores

CVSS v3 7.1
EPSS 0.0007
EPSS Percentile 22.7%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N

CISA SSVC

Vulnrichment
Exploitation poc
Automatable no
Technical Impact total

Lab Environment

COMMUNITY
Community Lab
docker pull postgres:15-alpine
docker pull m.daocloud.io/docker.io/library/postgres:latest
+2 more repos

Details

CWE
CWE-89
Status published
Products (4)
djangoproject/django 4.2 - 4.2.24
pypi/Django 0 - 4.2.24PyPI
pypi/Django 5.0a1 - 5.1.12PyPI
pypi/Django 5.2a1 - 5.2.6PyPI
Published Sep 03, 2025
Tracked Since Feb 18, 2026