CVE-2024-42005: Django SQL injection vulnerability
Affects DjangoSource GCVE Database
Not known to be exploited · CVSS 9.8 Critical : upgrade to 5.0.8 as a priority.
Data as of 4 Nov 2026, 17:28 UTC
- Patch
- Available – fixed in 5.0.8, 4.2.15
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 7 Aug 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 4 Nov 2026.
What to do
Upgrade Django to 5.0.8; Django to 4.2.15.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIDjango | Affected
| Fixed in
|
| PyPIDjango | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Apply the official patches by upgrading Django to version 5.0.8 or later, or 4.2.15 or later. These versions contain fixes that address the SQL injection vulnerability in QuerySet.values() and values_list() methods. No other mitigations are indicated by the vendor advisory. Immediate upgrade is recommended to prevent exploitation.
Description
A critical SQL injection vulnerability exists in Django versions 5.0 prior to 5.0.8 and 4.2 prior to 4.2.15. The issue affects the QuerySet.values() and values_list() methods when used on models containing a JSONField. An attacker can exploit crafted JSON object keys passed as *args to inject malicious SQL via column aliases.
References
- nvd.nist.gov/vuln/detail/CVE-2024-42005 (opens in a new tab)
- github.com/django/django/commit/32ebcbf2e1fe3e5ba79a6554a167efce81f7422d (opens in a new tab)
- github.com/django/django/commit/f4af67b9b41e0f4c117a8741da3abbd1c869ab28 (opens in a new tab)
- docs.djangoproject.com/en/dev/releases/security (opens in a new tab)
- github.com/django/django (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2024-70.yaml (opens in a new tab)
- groups.google.com/forum/ (opens in a new tab)
- security.netapp.com/advisory/ntap-20240905-0007 (opens in a new tab)
- djangoproject.com/weblog/2024/aug/06/security-releases (opens in a new tab)