The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-42005

CVE-2024-42005: Django JSONField SQL Injection Vulnerability

CVE-2024-42005 is a SQL injection vulnerability in Django's QuerySet.values() and values_list() methods affecting JSONField models. Attackers can exploit crafted JSON keys to inject SQL. This article covers the technical details, affected versions, impact, and mitigation strategies.

Published: January 28, 2026

CVE-2024-42005 Overview

CVE-2024-42005 is a SQL Injection vulnerability discovered in Django, the popular Python web framework. The vulnerability affects Django versions 5.0 before 5.0.8 and 4.2 before 4.2.15. The flaw exists in the QuerySet.values() and values_list() methods when used on models containing a JSONField. Attackers can exploit this vulnerability by crafting malicious JSON object keys that are passed as *arg parameters, enabling SQL injection through column aliases.

Critical Impact

This SQL injection vulnerability allows unauthenticated attackers to potentially execute arbitrary SQL commands against the database, leading to data exfiltration, data manipulation, or denial of service conditions in affected Django applications.

Affected Products

  • Django 5.0 before 5.0.8
  • Django 4.2 before 4.2.15
  • Applications using QuerySet.values() or values_list() with JSONField models

Discovery Timeline

  • 2024-08-06 - Django Project releases security patch
  • 2024-08-07 - CVE-2024-42005 published to NVD
  • 2025-11-04 - Last updated in NVD database

Technical Details for CVE-2024-42005

Vulnerability Analysis

This vulnerability is classified as CWE-89 (SQL Injection) and affects Django's Object-Relational Mapping (ORM) layer. The issue arises from improper sanitization of JSON object keys when they are used as column aliases in SQL queries generated by the values() and values_list() methods.

When a Django model includes a JSONField and developers use QuerySet.values() or values_list() with dynamically provided arguments, the framework fails to properly escape or validate JSON object keys before incorporating them into the generated SQL query. This allows attackers to break out of the intended column alias context and inject arbitrary SQL code.

The vulnerability is particularly concerning because it can be triggered through network-accessible input, requires no authentication, and affects multiple aspects of the application including confidentiality, integrity, and availability of the data.

Root Cause

The root cause of CVE-2024-42005 lies in insufficient input validation within Django's query construction logic. When processing JSON object keys as column aliases in the values() and values_list() methods, the framework does not adequately sanitize special characters or enforce proper escaping. This oversight allows crafted JSON keys containing SQL metacharacters to be directly interpolated into the generated SQL query string, breaking the intended query structure and enabling injection attacks.

Attack Vector

The attack vector for this vulnerability is network-based. An attacker can exploit this flaw by sending specially crafted HTTP requests to a Django application that:

  1. Uses a model with a JSONField
  2. Accepts user-controlled input that influences arguments passed to values() or values_list() methods
  3. Does not implement additional input sanitization before ORM operations

The malicious payload is embedded within a JSON object key, which when processed by the vulnerable methods, injects SQL commands into the column alias portion of the query. This can allow attackers to extract sensitive data, modify database contents, or cause denial of service through resource-intensive queries.

The vulnerability mechanism can be understood as follows: when a QuerySet operation like values() receives a JSONField key path as an argument, that key path is used to construct part of the SQL query. If the key contains unescaped SQL syntax, it will be interpreted as part of the query rather than as a literal string value. For detailed technical information, refer to the Django Security Release Notes.

Detection Methods for CVE-2024-42005

Indicators of Compromise

  • Unusual or malformed JSON keys in application logs containing SQL syntax such as single quotes, semicolons, or SQL keywords
  • Database query logs showing unexpected column aliases or additional SQL clauses
  • Error messages indicating SQL syntax errors originating from JSONField-related queries
  • Anomalous database access patterns or data exfiltration attempts

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect SQL injection patterns in JSON payloads
  • Monitor application logs for requests containing suspicious JSON object keys with SQL metacharacters
  • Enable database query logging and alert on queries with unexpected structure or syntax
  • Deploy runtime application self-protection (RASP) solutions to detect injection attempts at the application layer

Monitoring Recommendations

  • Configure alerts for database errors related to malformed queries from Django ORM operations
  • Monitor for unusual data access patterns that may indicate successful exploitation
  • Review access logs for repeated requests targeting endpoints that use values() or values_list() with JSONField models
  • Implement anomaly detection for database query patterns to identify injection attempts

How to Mitigate CVE-2024-42005

Immediate Actions Required

  • Upgrade Django to version 5.0.8 or later for Django 5.0.x installations
  • Upgrade Django to version 4.2.15 or later for Django 4.2.x installations
  • Audit application code for usage of values() and values_list() methods with user-controlled arguments on JSONField models
  • Implement input validation to sanitize any user-provided data used in ORM query construction

Patch Information

Django has released security patches addressing this vulnerability. The fixed versions are Django 5.0.8 and Django 4.2.15. Organizations should upgrade to these versions immediately. Detailed information about the security release is available from the Django Weblog Security Release and the Django Security Release Notes. Additionally, NetApp has published a related advisory at NetApp Security Advisory NTAP-20240905-0007.

Workarounds

  • Avoid passing user-controlled input directly to values() or values_list() method arguments
  • Implement strict allowlisting for any field names or JSON keys accepted from user input
  • Add application-level input validation to reject JSON keys containing SQL metacharacters
  • Consider using parameterized queries or raw SQL with proper escaping for complex JSONField operations until patches can be applied
bash
# Upgrade Django to patched version
pip install --upgrade Django>=5.0.8  # For Django 5.0.x
# or
pip install --upgrade Django>=4.2.15  # For Django 4.2.x

# Verify installed version
python -c "import django; print(django.VERSION)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechDjangoproject Django

  • SeverityHIGH

  • CVSS Score7.3

  • EPSS Probability0.33%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-89
  • Technical References
  • Django Announce Group

  • NetApp Security Advisory NTAP-20240905-0007
  • Vendor Resources
  • Django Security Release Notes

  • Django Weblog Security Release
  • Related CVEs
  • CVE-2026-1312: Djangoproject Django SQLi Vulnerability

  • CVE-2026-1207: Django SQLi Vulnerability in RasterField

  • CVE-2025-59681: Django SQL Injection Vulnerability

  • CVE-2025-57833: Django FilteredRelation SQL Injection Flaw
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English