# CVE-2025-59681: Django vulnerable to SQL injection in column aliases

- Severity: High 7.1 (CVSS:3.1, scored by mitre) `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.66%, higher than 52% of CVEs (2026-12-01)
- Published: 2025-10-01T00:00:00.000Z
- Modified: 2026-10-12T15:10:00.207Z
- Also known as: GHSA-hpr9-3m2g-3j9p, BIT-DJANGO-2025-59681, PYSEC-2025-106
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: mitre

## Description

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

(As written by CVE List.)

## Affected

- djangoproject Django: from 4.2 before 4.2.25; from 5.1 before 5.1.13; from 5.2 before 5.2.7
- django (PyPI): from 4.2 before 4.2.25; from 5.1 before 5.1.13; from 5.2 before 5.2.7
- django (Bitnami): from 4.2.0 before 4.2.25; from 5.1.0 before 5.1.13; from 5.2.0 before 5.2.7

## Every score

- mitre: CVSS:3.1 7.1 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N`
- GitHub: CVSS:3.1 7.1 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://docs.djangoproject.com/en/dev/releases/security/> (advisory, vendor-advisory)
- <https://groups.google.com/g/django-announce> (advisory, release-notes, vendor-advisory, web)
- <https://www.djangoproject.com/weblog/2025/oct/01/security-releases/> (advisory, release-notes, vendor-advisory)
- <http://www.openwall.com/lists/oss-security/2025/10/01/3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-59681> (advisory, web)
- <https://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a> (web)
- <https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e> (web)
- <https://docs.djangoproject.com/en/dev/releases/security> (web)
- <https://github.com/django/django> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2025-106.yaml> (web)
- <https://www.djangoproject.com/weblog/2025/oct/01/security-releases> (web)
- <https://github.com/advisories/GHSA-hpr9-3m2g-3j9p> (advisory)

## Sources

- CVE List: [CVE-2025-59681](https://www.cve.org/CVERecord?id=CVE-2025-59681), CVE Terms of Use, modified 2025-11-04
- GitHub Advisory Database: [GHSA-hpr9-3m2g-3j9p](https://github.com/advisories/GHSA-hpr9-3m2g-3j9p), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-59681](https://nvd.nist.gov/vuln/detail/CVE-2025-59681), Public domain, modified 2026-10-12
- PyPA Advisory Database: [PYSEC-2025-106](https://osv.dev/vulnerability/PYSEC-2025-106), CC-BY-4.0, modified 2026-06-10
- Bitnami Vulnerability Database: [BIT-DJANGO-2025-59681](https://osv.dev/vulnerability/BIT-DJANGO-2025-59681), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2025-59681 · Whole record: https://cve.day/CVE-2025-59681.json · Rebuilt by cve.day 2026-11-25T22:59:05.412Z
