Quick answers
- Is CVE-2025-59681 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2025-59681 being exploited in the wild.
- How severe is CVE-2025-59681?
- High severity, with a CVSS score of 7.1, published 1 October 2025.
- Which products and versions are affected?
- Django (PyPI) ECOSYSTEM:introduced=4.2,fixed=4.2.25, ECOSYSTEM:introduced=4.2,fixed=4.2.25,introduced=5.1,fixed=5.1.13,introduced=5.2,fixed=5.2.7.
- Is there a fix for CVE-2025-59681?
- Yes. Django (PyPI): upgrade to 4.2.25, 5.2.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2025-59681 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2025-59681?
- Check whether you run Django (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- Django (PyPI): upgrade to 4.2.25, 5.2.7 or later
pip install "Django>=5.2.7"
Technical details
A SQL injection vulnerability exists in Django's QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() methods. The root cause is improper neutralization of special elements in column aliases when using dictionary expansion (**kwargs) on MySQL and MariaDB backends. An attacker with low privileges can exploit this over the network by providing a specially crafted dictionary to these methods, potentially leading to unauthorized data access or modification. The vulnerability is mitigated by high attack complexity as it requires specific application-level coding patterns. Patches are available in versions 4.2.25, 5.1.13, and 5.2.7.
Affected products
- Django Software Foundation Django >= 4.2, < 4.2.25
- Django Software Foundation Django >= 5.1, < 5.1.13
- Django Software Foundation Django >= 5.2, < 5.2.7
Identifiers
- CVE-2025-59681
- GHSA-hpr9-3m2g-3j9p
- PYSEC-2025-106
Timeline
- 2025-10-01: disclosed
- 2025-10-01: advisory
- 2025-10-01: patched
References
- https://docs.djangoproject.com/en/dev/releases/security
- https://groups.google.com/g/django-announce
- https://www.djangoproject.com/weblog/2025/oct/01/security-releases
- https://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a
- https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e