Critical
Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-35042
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 05:13 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-35042
Complete source record
{
"id": "f6a8aca0f8364de70a6d1fd4001850c1fa903a1d5e07b052efca47085bb63397",
"url": "https://osv.dev/vulnerability/CVE-2021-35042",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-35042",
"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.",
"evidence": "osv:CVE-2021-35042",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2021-35042",
"aliases": [
"BIT-django-2021-35042",
"CVE-2021-35042",
"GHSA-xpfp-f569-q3p2",
"PYSEC-2021-109"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/django/django",
"type": "GIT",
"events": [
{
"introduced": "0b8a0296bfd30748f08021834e95cdae241686e8"
},
{
"fixed": "43873b9c92cfe68a082c7feda86f6fb95a3e902c"
},
{
"introduced": "3591e1c1acbd7c13174275367c3fdf012cb0413b"
},
{
"fixed": "0eca7a66239ef646f59fe2af643199275dae7a35"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.1"
},
{
"fixed": "3.1.13"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.2"
},
{
"fixed": "3.2.5"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-35042.json"
}
}
],
"modified": "2026-10-24T10:30:25.922640930Z",
"provider": "osv",
"references": [
"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://docs.djangoproject.com/en/3.2/releases/security/",
"https://www.djangoproject.com/weblog/2021/jul/01/security-releases/",
"https://www.openwall.com/lists/oss-security/2021/07/02/2"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*"
],
"vendor_product": "fedoraproject:fedora",
"extracted_events": [
{
"range": [
{
"introduced": "34"
},
{
"last_affected": "34"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2021-35042",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 431483,
"published_at": "2021-07-02T10:15:07.653+00:00"
}