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-53908

CVE-2024-53908: Django HasKey Lookup SQLi Vulnerability

CVE-2024-53908 is a SQL injection vulnerability in Django's HasKey lookup when using Oracle databases, allowing attackers to inject malicious SQL code. This article covers technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2024-53908 Overview

CVE-2024-53908 is a SQL injection vulnerability discovered in the Django web framework affecting versions 5.1 before 5.1.4, 5.0 before 5.0.10, and 4.2 before 4.2.17. The vulnerability exists in the direct usage of the django.db.models.fields.json.HasKey lookup when an Oracle database backend is used. If untrusted data is passed as the left-hand side (lhs) value, attackers can inject malicious SQL code, potentially leading to unauthorized data access, modification, or deletion.

Critical Impact

This SQL injection vulnerability allows unauthenticated remote attackers to execute arbitrary SQL commands against Oracle databases running Django applications, potentially compromising data confidentiality, integrity, and availability.

Affected Products

  • Django 5.1 before 5.1.4
  • Django 5.0 before 5.0.10
  • Django 4.2 before 4.2.17

Discovery Timeline

  • 2024-12-06 - CVE CVE-2024-53908 published to NVD
  • 2025-06-09 - Last updated in NVD database

Technical Details for CVE-2024-53908

Vulnerability Analysis

This vulnerability is classified as CWE-89 (SQL Injection) and affects Django applications that directly use the HasKey lookup from django.db.models.fields.json module with Oracle database backends. The core issue lies in improper input validation when processing the left-hand side (lhs) parameter of the HasKey lookup.

When developers directly invoke the HasKey lookup with user-controlled input as the lhs value, the Oracle-specific implementation fails to properly sanitize or parameterize this input before constructing the SQL query. This allows attackers to craft malicious input that breaks out of the intended SQL context and executes arbitrary SQL commands.

It's important to note that applications using the standard jsonfield.has_key lookup via the double-underscore (__) syntax are not affected by this vulnerability, as Django properly handles input sanitization in that code path.

Root Cause

The root cause of this vulnerability stems from insufficient input sanitization in the Oracle database backend implementation of the HasKey lookup class. While other database backends may properly escape or parameterize the lhs value, the Oracle-specific code path did not adequately protect against SQL injection when untrusted data was directly passed to the lookup.

Attack Vector

The attack can be executed remotely over the network without authentication or user interaction. An attacker targeting a vulnerable Django application must:

  1. Identify an endpoint or functionality that passes user-controlled input directly to the HasKey lookup
  2. Craft a malicious payload that exploits the lack of input sanitization in the Oracle backend
  3. Submit the payload through the vulnerable application endpoint
  4. The malicious SQL is executed against the Oracle database with the privileges of the database user configured for the Django application

The vulnerability enables attackers to potentially read sensitive data from the database, modify or delete existing records, execute administrative operations, or in some cases, interact with the underlying operating system depending on database permissions and configuration.

Detection Methods for CVE-2024-53908

Indicators of Compromise

  • Unusual SQL query patterns in Oracle database logs containing unexpected HasKey operations
  • Application error logs showing malformed JSON field queries or Oracle syntax errors
  • Database audit logs revealing unauthorized data access or modification operations
  • Unexpected database queries executing outside normal application behavior patterns

Detection Strategies

  • Monitor web application firewall (WAF) logs for SQL injection patterns targeting JSON field operations
  • Implement database activity monitoring to detect anomalous query structures involving JSON operations
  • Review application logs for errors related to django.db.models.fields.json.HasKey lookups
  • Deploy intrusion detection rules targeting SQL injection payloads in HTTP parameters

Monitoring Recommendations

  • Enable detailed Oracle database auditing for all JSON-related operations
  • Configure alerting for failed or suspicious SQL queries originating from the Django application
  • Monitor for unusual data exfiltration patterns from the database
  • Track application performance anomalies that may indicate exploitation attempts

How to Mitigate CVE-2024-53908

Immediate Actions Required

  • Upgrade Django to patched versions: 5.1.4, 5.0.10, or 4.2.17 or later
  • Audit application code for direct usage of django.db.models.fields.json.HasKey with user-controlled input
  • Implement input validation and sanitization for any data passed to JSON field lookups
  • Consider switching to the standard jsonfield.has_key lookup via __ syntax which is not affected

Patch Information

The Django project has released security patches addressing this vulnerability. Administrators should upgrade to the following versions immediately:

  • Django 5.1.x: Upgrade to version 5.1.4 or later
  • Django 5.0.x: Upgrade to version 5.0.10 or later
  • Django 4.2.x: Upgrade to version 4.2.17 or later

For detailed patch information, refer to the Django Security Release Notes and the Django Announcements Group.

Workarounds

  • Avoid direct usage of django.db.models.fields.json.HasKey lookup with untrusted data until patching is complete
  • Use the standard Django ORM syntax with double-underscore (__) for has_key lookups which is unaffected
  • Implement strict input validation on any user data before it reaches database queries
  • Consider temporarily restricting access to affected functionality while patches are applied

If upgrading is not immediately possible, refactor code to use the unaffected jsonfield.has_key lookup via the double-underscore syntax. Additionally, implement strict allow-listing of acceptable input values where user data must be used in JSON field lookups, and consider deploying a web application firewall with SQL injection protection rules as a defense-in-depth measure.

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

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechDjango

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.69%

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

  • Openwall OSS-Security Discussion
  • Vendor Resources
  • Django Security Release Notes
  • Related CVEs
  • CVE-2026-1287: Django FilteredRelation SQLi Vulnerability

  • CVE-2025-64459: Django QuerySet SQL Injection Vulnerability

  • CVE-2022-34265: Django Trunc/Extract SQL Injection Flaw

  • CVE-2022-28347: Django QuerySet SQL Injection Vulnerability
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