Skip to content
OpenAdvisories
High · 7.1 Public exploit CVE-2025-57833 BIT-django-2025-57833EUVD-2025-26641GHSA-6w2r-r2m5-xq5wPYSEC-2025-105

Django is subject to SQL injection through its column aliases

Published Sep 3, 2025 · Updated Nov 4, 2025 · Assigned by mitre

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().

Affected products

VendorProductAffectedFixed
djangoproject Django 4.2 – < 4.2.24, 5.1 – < 5.1.12, 5.2 – < 5.2.6 4.2.24

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.

ReleasePackageFixed inAdvisory
Debian 14 python-django 3:4.2.24-1 —
Debian 13 python-django 3:4.2.27-0+deb13u1 DSA-6117-1
Debian 12 python-django 3:3.2.25-0+deb12u1 DSA-6136-1
Debian 11 python-django 2:2.2.28-1~deb11u8 DLA-4301-1
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS python-django 3:4.2.11-1ubuntu1.10 USN-7736-1
Ubuntu 22.04 LTS python-django 2:3.2.12-2ubuntu1.21 USN-7736-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 20.04 LTS python-django 2:2.2.12-1ubuntu0.29+esm3 USN-7736-1
ReleasePackageFixed inAdvisory
Red Hat Satellite Capsule 6 cjson 1.7.18-2.el8sat RHSA-2025:17614, RHSA-2025:17613, RHSA-2025:17606
Red Hat Satellite Capsule 6 puppet-agent 7.34.0-4.el8sat RHSA-2025:17614, RHSA-2025:17613, RHSA-2025:17606
Red Hat Satellite Capsule 6 python-django +1 4.2.24-0.1.el8pc RHSA-2025:17614, RHSA-2025:17613, RHSA-2025:17606
Red Hat Satellite 6 cjson 1.7.18-2.el8sat RHSA-2025:17614, RHSA-2025:17613, RHSA-2025:17606
Red Hat Satellite 6 puppet-agent 7.34.0-4.el8sat RHSA-2025:17614, RHSA-2025:17613, RHSA-2025:17606
Red Hat Satellite 6 python-django +1 4.2.24-0.1.el8pc RHSA-2025:17614, RHSA-2025:17613, RHSA-2025:17606
Red Hat OpenStack 18 python-django +1 3.2.12-9.el9ost RHSA-2025:17500
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat OpenStack 17 python-django +1 2.2.24-12.el9ost RHSA-2025:17498
Red Hat OpenStack 16 python-django20 +1 2.0.13-20.el8ost RHSA-2025:17499
Red Hat Ansible Automation Platform Developer 2 python3.11-django 4.2.24-1.el8ap RHSA-2025:16487
Red Hat Ansible Automation Platform 2 automation-controller-venv-tower 4.6.20-1.el8ap RHSA-2025:16487
Red Hat Ansible Automation Platform 2 python-django +1 4.2.24-1.el9ap RHSA-2025:16403
Red Hat Ansible Automation Platform 2 python39-django +2 4.2.24-1.el8ap RHSA-2025:16487, RHSA-2025:16403
ReleasePackageFixed inAdvisory
SLES 15 SP7 python-Django 4.2.11-150600.3.30.1 SUSE-SU-2025:03074-1
SLES 15 SP6 python-Django 4.2.11-150600.3.30.1 SUSE-SU-2025:03074-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-Django 5.2.6-1.1 openSUSE-SU-2025:15527-1
openSUSE Tumbleweed python-Django4 4.2.24-1.1 openSUSE-SU-2025:15528-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
openSUSE Leap 15.6 python-Django 4.2.11-150600.3.30.1 SUSE-SU-2025:03074-1
ReleasePackageFixed inAdvisory
Alpine v3.24 py3-django 4.2.24-r0 —
Alpine v3.23 py3-django 4.2.24-r0 —
Alpine v3.22 py3-django 4.2.24-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.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 5 repositories

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI django < 4.2.24 4.2.24 GHSA-6w2r-r2m5-xq5w
PyPI django >= 5.0a1, < 5.1.12 5.1.12 GHSA-6w2r-r2m5-xq5w
PyPI django >= 5.2a1, < 5.2.6 5.2.6 GHSA-6w2r-r2m5-xq5w
PyPI django >= 4.2, < 4.2.24 · >= 5.1, < 5.1.12 · >= 5.2, < 5.2.6 4.2.24, 5.1.12, 5.2.6 PYSEC-2025-105

Advisories 19

References