CVE-2025-59681Django vulnerable to SQL injection in column aliases
A critical-severity vulnerability reachable over the network, needing no privileges and no user interaction. EPSS estimates a 0.8% chance of exploitation in the next 30 days. A fixed version is named.
- Exploited in the wild
- Not in KEV
- EPSS
- 0.8%
- percentile 51%
- Fix
- Named by a source
- CVE published 1 Oct 2025
Reference
None of the "Needs attention" rules apply right now.
EPSS 0.8% (+1) · Network attack vector (+10) · No privileges required (+5) · No user interaction (+5)
Immediate actions
- django (PyPI): upgrade to 4.2.25 / 5.1.13 / 5.2.7 or later on your release line.
- Commit / pull request: https://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a
- Commit / pull request: https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e
- Advisory: https://docs.djangoproject.com/en/dev/releases/security/
- Advisory: https://groups.google.com/g/django-announce
- Advisory: https://www.djangoproject.com/weblog/2025/oct/01/security-releases/
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2025-59681
Who should check
django (PyPI) pkg:pypi/django
- Affected>= 4.2, < 4.2.25Fixed in4.2.25OSV (PYSEC-2025-106)
- Affected>= 5.1, < 5.1.13Fixed in5.1.13OSV (PYSEC-2025-106)
- Affected>= 5.2, < 5.2.7Fixed in5.2.7OSV (PYSEC-2025-106)
djangoproject django product:djangoproject/django
- Affected>= 4.2, < 4.2.25Affected range ends before4.2.25as published by CNA (CVE List)
- Affected>= 5.1, < 5.1.13Affected range ends before5.1.13as published by CNA (CVE List)
- Affected>= 5.2, < 5.2.7Affected range ends before5.2.7as published by CNA (CVE List)
- Affected>= 4.2, < 4.2.25Affected range ends before4.2.25as published by CPE data (via the NVD API)
- Affected>= 5.1, < 5.1.13Affected range ends before5.1.13as published by CPE data (via the NVD API)
- Affected>= 5.2, < 5.2.7Affected range ends before5.2.7as published by CPE data (via the NVD API)
Products (not packages) are shown as their sources publish them. We check no product version against these ranges; a fixed version is the one the source names. Ask the vendor's advisory.
Confirmed facts
- CVSS
- 9.8 CRITICAL (version 3.1)
- Score from
- NVD
- Attack vector
- network
- Attack complexity
- low
- Privileges required
- none
- User interaction
- none
- Weakness
- CWE-89
- Exploitation (CISA SSVC)
- none
- Automatable (CISA SSVC)
- no
- Assigned by
- [email protected]
Unknowns
- We show one CVSS score. Other sources may score this CVE differently.
Advisory text
Quoted from the source advisory (untrusted)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).
Update history
- 1 Oct 2025Published
References
- advisoryhttps://docs.djangoproject.com/en/dev/releases/security/
- advisoryhttps://groups.google.com/g/django-announce
- advisoryhttps://www.djangoproject.com/weblog/2025/oct/01/security-releases/
- otherhttp://www.openwall.com/lists/oss-security/2025/10/01/3
- advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2025-59681
- commit / pull requesthttps://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a
- commit / pull requesthttps://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e
- otherhttps://docs.djangoproject.com/en/dev/releases/security
- otherhttps://github.com/django/django
- otherhttps://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2025-106.yaml
- otherhttps://www.djangoproject.com/weblog/2025/oct/01/security-releases
- advisoryhttps://github.com/advisories/GHSA-hpr9-3m2g-3j9p
Sources
- EPSS by FIRST.org, Free to use, attribution requested. Scores generated by Empirical Security.
- CVE-2025-59681 (CVE List (CNA and CISA ADP data, through the NVD API)), CVE terms of use. Copyright The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation.
- NVD API 2.0 (NIST), the API we query, NVD API terms of use. This product uses the NVD API but is not endorsed or certified by the NVD.
- GHSA-hpr9-3m2g-3j9p (GitHub Advisory Database), CC BY 4.0.
- PYSEC-2025-106 (PyPA Advisory Database), CC BY 4.0.
- OSV.dev, Per database.
This page is our own presentation: records are shortened, normalised and merged. Licences
Last checked: kev 49 min ago · osv 49 min ago · nvd 49 min ago · epss 49 min ago · JSON · ask via MCP: explain_vulnerability
Also known as BIT-django-2025-59681, GHSA-hpr9-3m2g-3j9p, PYSEC-2025-106