CVE-2021-35042 in the critical feed json
SQL Injection in Django
published 2021-07-02 5 y ago modified 2026-09-08 2 mo ago also BIT-django-2021-35042 , EUVD-2021-0061 , GHSA-xpfp-f569-q3p2 , PYSEC-2021-109
- cvss
- 9.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 44.4%
- EPSS 44.4% chance of exploitation in 30 days, percentile 98%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi django 3.1.13, 3.2.5
- bitnami django 3.1.13, 3.2.5
- djangoproject django 3.1.13, 3.2.5
- python-Django5 openSUSE Tumbleweed 5.2.16-1.1
- python-Django openSUSE Tumbleweed 5.2.16-1.1
- python-Django4 openSUSE Tumbleweed 4.2.30-4.1
- python-Django6 openSUSE Tumbleweed 6.0-1.1
- python-Django4 openSUSE Tumbleweed 4.2.14-1.1
- python-Django openSUSE Tumbleweed 3.2.7-2.3
- python-Django openSUSE Tumbleweed 4.2.11-2.1
opensuse advisories openSUSE-SU-2026:11270-1openSUSE-SU-2026:11248-1openSUSE-SU-2026:11235-1openSUSE-SU-2026:10005-1openSUSE-SU-2024:14208-1openSUSE-SU-2024:11205-1
- py3-django Alpine 3.24, Alpine 3.23, Alpine 3.22 +9 more 3.1.13-r0
alpine advisories ALPINE-CVE-2021-35042
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-django Arch Linux 3.2.5-1
arch linux advisories AVG-2123
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-35042 updated cvss 9.8
django: potential SQL injection via unsanitized QuerySet.order_by() input
-
Red Hat Ansible Automation Platform 1.2 django, python-django Red Hat Ansible Tower 3 django Red Hat Ceph Storage 2 python-django, calamari-server, python-django-bash-completion Red Hat Ceph Storage 3 python-django, python-django-bash-completion Red Hat OpenStack Platform 10 (Newton) python-django, python-django-bash-completion Red Hat OpenStack Platform 13 (Queens) python-django, python2-django, python-django-bash-completionnot affected: vulnerable code not present
+5 more productsfewer
Red Hat OpenStack Platform 16.1 python-django20, python3-django20, python-django20-bash-completion Red Hat OpenStack Platform 16.2 python-django20, python3-django20, python-django20-bash-completion Red Hat Satellite 6 python-django, python2-django, python3-django, python-django-bash-completion Red Hat Storage 3 python-django, python2-django, python-django-bash-completion Red Hat Update Infrastructure 3 for Cloud Providers python-django
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
44.37% chance of exploitation in the next 30 days, higher than 98% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | django | >=3.2a1, <3.2.5 >=3.0a1, <3.1.13 >=3.1, <3.1.13 >=3.2, <3.2.5 |
3.2.5 3.1.13 |
| bitnami | django | >=3.1.0, <3.1.13 >=3.2.0, <3.2.5 |
3.1.13 3.2.5 |
Classification
- Weakness
-
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command
- Technology feeds
References
-
docs.djangoproject.com
/en/3.2/releases/security/
patch, vendor-advisory, advisory, web
-
openwall.com
/lists/oss-security/2021/07/02/2
web, mailing-list, patch, third-party-advisory, advisory
-
djangoproject.com
/weblog/2021/jul/01/security-releases/
patch, vendor-advisory, advisory, article
-
github.com
/django/django/commit/0bd57a879a0d54920bb9038a732645fb917040e9
web
-
github.com
/django/django/commit/a34a5f724c5d5adb2109374ba3989ebb7b11f81f
web
-
github.com
/django/django/commit/dae83a24519d6f284c74414e0b81d64d9b5a0db4
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/SS6NJTBYWOX6J7G4U3LUOILARJKWPQ5Y/
vendor-advisory, web
-
groups.google.com
/forum/#%21forum/django-announce
web
-
security.netapp.com
/advisory/ntap-20210805-0008/
third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-35042
advisory, web
-
docs.djangoproject.com
/en/3.2/releases/security
web
-
github.com
/advisories/GHSA-xpfp-f569-q3p2
advisory
-
github.com
/django/django
package
-
github.com
/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-109.yaml
web
-
groups.google.com
/forum/#!forum/django-announce
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/SS6NJTBYWOX6J7G4U3LUOILARJKWPQ5Y
web
-
security.netapp.com
/advisory/ntap-20210805-0008
web
-
djangoproject.com
/weblog/2021/jul/01/security-releases
web
Sources
- CVE List CVE-2021-35042
- GitHub Advisory GHSA-xpfp-f569-q3p2
- NVD CVE-2021-35042
- OSV BIT-django-2021-35042
- OSV PYSEC-2021-109
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.