Live threats

All CVEs / Djangoproject

CVE-2025-59681Djangoproject Django

Critical 9.8 No auth needed

Priority
74
CVSS 3.1
9.8
EPSS
—
Auth required
No
Published
Oct 1, 2025
Updated
Oct 12, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-89
SSVC (CISA)
Exploitation: none · Automatable: no · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What happens

An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7. QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() are subject to SQL injection in column aliases, when using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to these methods (on MySQL and MariaDB).

Original NVD text.

What to do

  1. Apply the vendor's security update for Django.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
PyPI django ≥ 4.2 < 4.2.25 4.2.25 pip install "django>=4.2.25"
PyPI django ≥ 5.1 < 5.1.13 5.1.13 pip install "django>=5.1.13"
PyPI django ≥ 5.2 < 5.2.7 5.2.7 pip install "django>=5.2.7"
PyPI django ≥ 4.2 < 4.2.25 4.2.25 pip install "django>=4.2.25"
PyPI django ≥ 5.1 < 5.1.13 5.1.13 pip install "django>=5.1.13"
PyPI django ≥ 5.2 < 5.2.7 5.2.7 pip install "django>=5.2.7"

Per OSV / GitHub Advisories (GHSA-hpr9-3m2g-3j9p, PYSEC-2025-106). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
djangoprojectdjango≥ 4.2 < 4.2.25
djangoprojectdjango≥ 5.1 < 5.1.13
djangoprojectdjango≥ 5.2 < 5.2.7

Official advisories

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.