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-2022-28347

CVE-2022-28347: Django QuerySet SQL Injection Vulnerability

CVE-2022-28347 is a SQL injection vulnerability in Django's QuerySet.explain() method affecting versions 2.2-4.0. Attackers can exploit this through crafted dictionary options. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 17, 2026

CVE-2022-28347 Overview

A SQL injection vulnerability was discovered in Django's QuerySet.explain() method affecting Django versions 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. This vulnerability allows attackers to inject malicious SQL code by passing a crafted dictionary (with dictionary expansion) as the **options argument and placing the injection payload within an option name.

Critical Impact

This SQL injection vulnerability enables unauthenticated remote attackers to execute arbitrary SQL commands against the database, potentially leading to complete database compromise, data theft, data manipulation, or denial of service.

Affected Products

  • Django 2.2 before 2.2.28
  • Django 3.2 before 3.2.13
  • Django 4.0 before 4.0.4
  • Debian Linux 11.0 (via packaged Django)

Discovery Timeline

  • 2022-04-11 - Security releases announced by Django Project
  • 2022-04-12 - CVE CVE-2022-28347 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-28347

Vulnerability Analysis

The vulnerability resides in Django's QuerySet.explain() method, which is designed to provide database query execution plans for debugging and optimization purposes. The flaw occurs due to insufficient input validation when processing the **options keyword arguments passed to the method.

When developers use dictionary expansion (**) to pass options to explain(), the option names themselves are not properly sanitized before being incorporated into the SQL query. This allows an attacker who can control the dictionary keys to inject arbitrary SQL syntax through the option name parameter, bypassing the framework's normal query parameterization protections.

The vulnerability is particularly dangerous because SQL injection through option names is an unconventional attack vector that may not be anticipated by developers following standard security practices. Unlike typical SQL injection through query values, this attack exploits the structural elements of the query construction.

Root Cause

The root cause is CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). The QuerySet.explain() method fails to properly sanitize or escape option names before incorporating them into the generated SQL statement. When dictionary expansion is used to pass options, the keys of the dictionary are directly interpolated into the SQL query without adequate validation, allowing malicious SQL code embedded in option names to be executed.

Attack Vector

The attack is network-accessible and can be executed remotely without authentication. An attacker can exploit this vulnerability by manipulating input that eventually gets passed as dictionary keys to the explain() method. The exploitation requires:

  1. An application endpoint that calls QuerySet.explain() with user-controlled options
  2. The ability to influence the dictionary keys passed via **options expansion
  3. Crafting option names containing SQL injection payloads

The injection payload is placed within the option name itself, not the option value, which is an atypical SQL injection pattern. This attack vector requires low complexity and no user interaction, making it highly exploitable in vulnerable configurations.

Detection Methods for CVE-2022-28347

Indicators of Compromise

  • Unusual database query patterns containing SQL syntax within EXPLAIN statement option fields
  • Error logs showing malformed EXPLAIN queries with suspicious option names
  • Database audit logs revealing unauthorized data access or modification operations
  • Web application logs showing requests with dictionary-like structures containing SQL keywords

Detection Strategies

  • Monitor application logs for errors related to QuerySet.explain() calls with malformed parameters
  • Implement Web Application Firewall (WAF) rules to detect SQL injection patterns in request parameters
  • Deploy database query monitoring to identify anomalous EXPLAIN statements
  • Review Django application code for usage of explain() with user-controlled input

Monitoring Recommendations

  • Enable detailed Django logging for database queries in production environments
  • Configure database audit logging to capture all EXPLAIN statement executions
  • Set up alerting for SQL syntax errors that may indicate injection attempts
  • Monitor for unusual data access patterns that could indicate successful exploitation

How to Mitigate CVE-2022-28347

Immediate Actions Required

  • Upgrade Django to version 2.2.28, 3.2.13, or 4.0.4 or later immediately
  • Audit application code for any usage of QuerySet.explain() with user-controlled input
  • Review database logs for evidence of exploitation attempts
  • Apply the security updates available from your Linux distribution if using packaged Django

Patch Information

The Django Project released security patches on April 11, 2022, addressing this vulnerability across all supported branches. Updated versions include Django 2.2.28, 3.2.13, and 4.0.4. Security advisories and patch details are available through the Django Blog Security Release Update and Django 4.0 Security Release Notes. Debian users should apply the patch from Debian Security Advisory DSA-5254.

Workarounds

  • Remove or disable any application code that uses QuerySet.explain() with dynamic or user-controlled options until patching is complete
  • Implement strict input validation to ensure only predefined, safe option names can be passed to explain()
  • Use a Web Application Firewall to filter requests containing potential SQL injection patterns
  • Restrict access to debugging endpoints that may expose explain() functionality to untrusted users
bash
# Configuration example - Upgrade Django to patched version
pip install --upgrade Django>=4.0.4

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

# For Debian/Ubuntu systems using packaged Django
sudo apt update && sudo apt upgrade python3-django

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 Probability1.03%

  • 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 Announce Google Group

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Debian Security Advisory DSA-5254
  • Vendor Resources
  • Openwall OSS Security Mailing List

  • Django 4.0 Security Release Notes

  • Django Blog Security Release Update
  • Related CVEs
  • CVE-2026-1287: Django FilteredRelation SQLi Vulnerability

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

  • CVE-2024-53908: Django HasKey Lookup SQLi Vulnerability

  • CVE-2022-34265: Django Trunc/Extract 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