cve.bz

CVE-2024-42005 djangoproject django: SQL Injection

7.3 highEPSS 1.5%Fix available

High (7.3) in djangoproject django. EPSS 1.5% estimated probability of exploitation activity in the next 30 days. Fixed in django 4.2.15, 5.0.8.

On this page
An issue was discovered in Django 5.0 before 5.0.8 and 4.2 before 4.2.15. QuerySet.values() and values_list() methods on models with a JSONField are subject to SQL injection in column aliases via a crafted JSON object key as a passed *arg.

Severity

CVSS 3.1

7.3 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
EPSS
1.5% (unchanged from 1.5% a week ago; 1.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 75th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2024-08-16. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-42005 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-42005?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-42005?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-42005 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
djangoproject:djangofrom 4.2 before 4.2.15
djangoproject:djangofrom 5.0 before 5.0.8

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-pv4p-cwwg-4rphPyPIdjango>=5.0 <5.0.85.0.8
GHSA-pv4p-cwwg-4rphPyPIdjango>=4.2 <4.2.154.2.15
PYSEC-2024-70PyPIdjango>=5.0 <5.0.8
>=4.2 <4.2.15
5.0.8, 4.2.15

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11python-django2:2.2.28-1~deb11u11DLA-4458-1
Debian12python-django3:3.2.25-0+deb12u1DEBIAN-CVE-2024-42005 DSA-6136-1
Debian13, 14python-django3:4.2.15-1DEBIAN-CVE-2024-42005
Ubuntu20.04:LTSpython-django2:2.2.12-1ubuntu0.24USN-6946-1
Ubuntu22.04:LTSpython-django2:3.2.12-2ubuntu1.13UBUNTU-CVE-2024-42005 USN-6946-1
Ubuntu24.04:LTSpython-django3:4.2.11-1ubuntu1.2UBUNTU-CVE-2024-42005 USN-6946-1
UbuntuPro:18.04:LTSpython-django1:1.11.11-1ubuntu1.21+esm6USN-6946-1
Red Hatansible_automation_platform:2.4::el8automation-controller, automation-controller-ui, automation-controller-cli and 2 more0:4.5.10-1.el8apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el8python39-django, python3x-django0:4.2.15-1.el8apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el8python39-grpcio, python3x-grpcio, python39-grpcio-debuginfo and 1 more0:1.58.3-1.el8apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-zipp0:3.19.2-1.el8apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el9automation-controller, automation-controller-ui, automation-controller-cli and 2 more0:4.5.10-1.el9apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el9python-django, python3-django0:4.2.15-1.el9apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el9python-grpcio, python3-grpcio, python3-grpcio-debuginfo and 1 more0:1.58.3-1.el9apRHSA-2024:6428
Red Hatansible_automation_platform:2.4::el9, ansible_automation_platform_developer:2.4::el9, ansible_automation_platform_inside:2.4::el9python-zipp, python3-zipp0:3.19.2-1.el9apRHSA-2024:6428
Red Hatansible_automation_platform_developer:2.4::el8automation-controller, automation-controller-cli0:4.5.10-1.el8apRHSA-2024:6428
Red Hatansible_automation_platform_developer:2.4::el9automation-controller, automation-controller-cli0:4.5.10-1.el9apRHSA-2024:6428
Red Hatrhui:4::el8python-aiohttp, python3.11-aiohttp, python-aiohttp-debugsource and 1 more0:3.9.4-1.el8uiRHSA-2025:1335
Red Hatrhui:4::el8python-cryptography, python3.11-cryptography, python-cryptography-debugsource and 1 more0:42.0.8-1.el8uiRHSA-2025:1335
206 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Package Hub 15 SP6python-Django4.2.11-150600.3.6.1SUSE-SU-2024:2816-1
SUSEPackage Hub 15 SP5python-Django2.2.28-bp155.7.15.1openSUSE-SU-2024:0272-1
openSUSELeap 15.5python-Django2.0.7-150000.1.27.1SUSE-SU-2024:2817-1
openSUSELeap 15.5python-Django2.2.28-bp155.7.15.1openSUSE-SU-2024:0272-1
openSUSELeap 15.6python-Django4.2.11-150600.3.6.1SUSE-SU-2024:2816-1
openSUSETumbleweedpython-Django5.0.8-1.1openSUSE-SU-2024:14247-1
openSUSETumbleweedpython-Django5.2.16-1.1openSUSE-SU-2026:11248-1
openSUSETumbleweedpython-Django44.2.15-1.1openSUSE-SU-2024:14248-1
openSUSETumbleweedpython-Django44.2.30-4.1openSUSE-SU-2026:11235-1
openSUSETumbleweedpython-Django55.2.16-1.1openSUSE-SU-2026:11270-1
openSUSETumbleweedpython-Django66.0-1.1openSUSE-SU-2026:10005-1
Alpinev3.20, v3.21, v3.22 and 2 morepy3-django4.2.16-r0ALPINE-CVE-2024-42005

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This vulnerability is considered of moderate severity rather than high or critical because it requires specific conditions to be exploitable. The potential for SQL injection exists only when QuerySet.values() or values_list() methods are used on models with a JSONField, and an attacker must have control over the JSON object keys passed as arguments. In typical use cases, these methods are often used with predefined or controlled data, limiting the attack surface. Furthermore, the impact is constrained to the manipulation of column aliases, rather than direct injection into more critical parts of the SQL query, reducing the overall risk compared to more direct forms of SQL injection vulnerabilities.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Discovery 1 for RHEL 9discovery/discovery-server-rhel9:1.12.0-1Fixed 2025-02-10RHSA-2025:1249
Discovery 1 for RHEL 9discovery/discovery-ui-rhel9:1.12.0-1Fixed 2025-02-10RHSA-2025:1249
Red Hat Ansible Automation Platform 2.4 for RHEL 8automation-controller-0:4.5.10-1.el8apFixed 2024-09-05RHSA-2024:6428
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-django-0:4.2.15-1.el8apFixed 2024-09-05RHSA-2024:6428
Red Hat Ansible Automation Platform 2.4 for RHEL 9automation-controller-0:4.5.10-1.el9apFixed 2024-09-05RHSA-2024:6428
Red Hat Ansible Automation Platform 2.4 for RHEL 9python-django-0:4.2.15-1.el9apFixed 2024-09-05RHSA-2024:6428
Red Hat Satellite 6.16 for RHEL 8python-django-0:4.2.16-1.el8pcFixed 2024-11-05RHSA-2024:8906
Red Hat Satellite 6.16 for RHEL 9python-django-0:4.2.16-1.el9pcFixed 2024-11-05RHSA-2024:8906
RHUI 4 for RHEL 8python-django-0:4.2.15-1.el8uiFixed 2025-02-12RHSA-2025:1335
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/ee-dellemc-openmanage-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/lightspeed-rhel8Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/platform-resource-runner-rhel8Not affected
Red Hat Ansible Automation Platform 2python3.11-djangoAffected
Red Hat Certification for Red Hat Enterprise Linux 8redhat-certificationFix deferred
Red Hat Certification Program for Red Hat Enterprise Linux 9redhat-certificationFix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-42005.

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON