# CVE-2021-35042: SQL Injection in Django

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- 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): 44.4%, higher than 98% of CVEs (2026-12-01)
- Published: 2021-07-02T09:54:11.000Z
- Modified: 2026-09-08T08:46:26.608Z
- Also known as: GHSA-xpfp-f569-q3p2, BIT-DJANGO-2021-35042, PYSEC-2021-109
- Weaknesses: CWE-89
- Assigned by: mitre

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

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- django (PyPI): from 3.2a1 before 3.2.5; from 3.0a1 before 3.1.13; from 3.1 before 3.1.13; from 3.2 before 3.2.5
- djangoproject django: from 3.1 before 3.1.13; from 3.2 before 3.2.5
- fedoraproject fedora: 34
- django (Bitnami): from 3.1.0 before 3.1.13; from 3.2.0 before 3.2.5

## Every score

- GitHub: 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`
- GitHub: CVSS:4.0 Critical `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA: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`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://groups.google.com/forum/#%21forum/django-announce> (web)
- <https://docs.djangoproject.com/en/3.2/releases/security/> (advisory, patch, vendor-advisory, web)
- <https://www.openwall.com/lists/oss-security/2021/07/02/2> (advisory, mailing-list, patch, third-party-advisory, web)
- <https://www.djangoproject.com/weblog/2021/jul/01/security-releases/> (advisory, article, patch, vendor-advisory)
- <https://security.netapp.com/advisory/ntap-20210805-0008/> (advisory, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SS6NJTBYWOX6J7G4U3LUOILARJKWPQ5Y/> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-35042> (advisory, web)
- <https://github.com/django/django/commit/0bd57a879a0d54920bb9038a732645fb917040e9> (web)
- <https://github.com/django/django/commit/a34a5f724c5d5adb2109374ba3989ebb7b11f81f> (web)
- <https://github.com/django/django/commit/dae83a24519d6f284c74414e0b81d64d9b5a0db4> (web)
- <https://docs.djangoproject.com/en/3.2/releases/security> (web)
- <https://github.com/advisories/GHSA-xpfp-f569-q3p2> (advisory)
- <https://github.com/django/django> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2021-109.yaml> (web)
- <https://groups.google.com/forum/#!forum/django-announce> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SS6NJTBYWOX6J7G4U3LUOILARJKWPQ5Y> (web)
- <https://security.netapp.com/advisory/ntap-20210805-0008> (web)
- <https://www.djangoproject.com/weblog/2021/jul/01/security-releases> (web)

## Sources

- CVE List: [CVE-2021-35042](https://www.cve.org/CVERecord?id=CVE-2021-35042), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-xpfp-f569-q3p2](https://github.com/advisories/GHSA-xpfp-f569-q3p2), CC-BY-4.0, modified 2025-02-21
- NVD: [CVE-2021-35042](https://nvd.nist.gov/vuln/detail/CVE-2021-35042), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-109](https://osv.dev/vulnerability/PYSEC-2021-109), CC-BY-4.0, modified 2023-12-06
- Bitnami Vulnerability Database: [BIT-DJANGO-2021-35042](https://osv.dev/vulnerability/BIT-DJANGO-2021-35042), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-35042 · Whole record: https://cve.day/CVE-2021-35042.json · Rebuilt by cve.day 2026-11-25T22:58:02.416Z
