What’s Vulnerable › Vulnerabilities
CVE-2021-35042: SQL Injection in Django
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 44.4% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2021-07-02 · updated 2026-06-17
- Weakness: CWE-89
Description
Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection if order_by is untrusted input from a client of a web application.
Affected products
- Django: from 3.1 before 3.1.13; from 3.2 before 3.2.5 — fixed in 3.1.13, 3.2.5
- Fedoraproject Fedora: 34
- Pypi Django: from 3.1 before 3.1.13; from 3.2 before 3.2.5; 3.1, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.2 (+12) — fixed in 3.1.13, 3.2.5
How to fix
Upgrade to a fixed version: Django 3.1.13, 3.2.5; Pypi Django 3.1.13, 3.2.5. Check the vendor advisory for mitigations.
References
- https://docs.djangoproject.com/en/3.2/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SS6NJTBYWOX6J7G4U3LUOILARJKWPQ5Y/
- https://security.netapp.com/advisory/ntap-20210805-0008/
- https://www.djangoproject.com/weblog/2021/jul/01/security-releases/
- https://www.openwall.com/lists/oss-security/2021/07/02/2
- https://docs.djangoproject.com/en/3.2/releases/security/
- https://groups.google.com/forum/#%21forum/django-announce
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SS6NJTBYWOX6J7G4U3LUOILARJKWPQ5Y/
- https://security.netapp.com/advisory/ntap-20210805-0008/
- https://www.djangoproject.com/weblog/2021/jul/01/security-releases/
- https://www.openwall.com/lists/oss-security/2021/07/02/2
Get alerted when CVE-2021-35042 or the next vulnerability affects your stack