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-2026-1287

CVE-2026-1287: Django FilteredRelation SQLi Vulnerability

CVE-2026-1287 is a SQL injection flaw in Djangoproject Django's FilteredRelation that allows attackers to inject malicious SQL via column aliases. This post covers technical details, affected versions, impact, and mitigation.

Published: February 6, 2026

CVE-2026-1287 Overview

CVE-2026-1287 is a SQL Injection vulnerability discovered in Django's FilteredRelation class. The vulnerability allows attackers to inject malicious SQL code through column aliases by leveraging control characters within specially crafted dictionaries. This can be exploited when dictionary expansion (**kwargs) is passed to various QuerySet methods including annotate(), aggregate(), extra(), values(), values_list(), and alias().

Critical Impact

Authenticated attackers with network access can exploit this SQL injection vulnerability to potentially read or modify sensitive database information, compromising data confidentiality and integrity.

Affected Products

  • Django 6.0 before 6.0.2
  • Django 5.2 before 5.2.11
  • Django 4.2 before 4.2.28

Discovery Timeline

  • 2026-02-03 - Vulnerability disclosed by Solomon Kebede to Django
  • 2026-02-03 - Django releases security patch
  • 2026-02-03 - CVE-2026-1287 published to NVD
  • 2026-02-04 - Last updated in NVD database

Technical Details for CVE-2026-1287

Vulnerability Analysis

This SQL injection vulnerability exists in Django's FilteredRelation class, which is used to create filtered joins in database queries. The root issue is that column aliases are not properly sanitized when processing dictionary arguments passed to QuerySet methods.

When an attacker can influence the keys of dictionaries passed to methods like annotate() or values(), they can inject control characters that break out of the expected SQL context. This allows arbitrary SQL code to be inserted into the generated queries. The attack requires the attacker to have authenticated access to the application and the ability to control dictionary keys that are expanded into QuerySet method calls.

Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated by the Django team and may also be affected by this vulnerability.

Root Cause

The vulnerability stems from insufficient input validation and sanitization of column alias names in the FilteredRelation class. When constructing SQL queries, Django failed to properly escape or validate control characters within dictionary keys before incorporating them into column aliases. This allows specially crafted dictionary keys containing SQL metacharacters to manipulate the structure of the generated SQL statement.

Attack Vector

The attack is network-based and requires low privileges (authenticated user access). An attacker must be able to supply a crafted dictionary that gets expanded as **kwargs to one of the vulnerable QuerySet methods. The attack involves:

  1. Constructing a dictionary with keys containing SQL injection payloads embedded within control characters
  2. Having this dictionary passed to a vulnerable method such as annotate(), aggregate(), extra(), values(), values_list(), or alias()
  3. The malicious SQL payload executes within the context of the database query

The vulnerability can be exploited through any application endpoint that allows user-controlled input to influence QuerySet method parameters. The attack does not require user interaction beyond the initial authenticated request.

Detection Methods for CVE-2026-1287

Indicators of Compromise

  • Unusual SQL query patterns in database logs containing control characters in column aliases
  • Error messages indicating malformed SQL queries from Django ORM operations
  • Unexpected database query results or data modifications
  • Application errors related to FilteredRelation or QuerySet annotation methods

Detection Strategies

  • Monitor web application logs for requests containing unusual control characters in parameters
  • Implement database activity monitoring to detect anomalous query patterns
  • Review application code for dynamic dictionary construction passed to QuerySet methods
  • Deploy web application firewalls with rules to detect SQL injection patterns in JSON/dictionary inputs

Monitoring Recommendations

  • Enable Django's database query logging to capture all generated SQL statements
  • Configure alerting on database errors related to syntax violations in ORM-generated queries
  • Monitor for unusual data access patterns that could indicate successful SQL injection
  • Implement real-time log analysis for suspicious parameter values in authenticated sessions

How to Mitigate CVE-2026-1287

Immediate Actions Required

  • Upgrade Django to patched versions: 6.0.2, 5.2.11, or 4.2.28 immediately
  • Audit application code for any user-controlled dictionary expansion in QuerySet methods
  • Implement input validation for any parameters that influence query annotations or aliases
  • Review database access logs for signs of exploitation attempts

Patch Information

Django has released security patches addressing this vulnerability. Upgrade to the following versions based on your Django series:

Current VersionPatched Version
Django 6.0.x6.0.2
Django 5.2.x5.2.11
Django 4.2.x4.2.28

For detailed patch information, refer to the Django Security Release Notes and the Django Weblog Security Releases announcement.

Workarounds

  • Validate and sanitize all dictionary keys before passing them to QuerySet methods
  • Implement allowlists for acceptable column alias names in application code
  • Avoid using user-controlled input in dictionary keys that are expanded to QuerySet methods
  • Consider using parameterized queries or raw SQL with proper escaping as temporary alternatives
bash
# Upgrade Django to patched version
pip install --upgrade Django>=6.0.2

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

# For Django 5.2.x series
pip install --upgrade 'Django>=5.2.11,<6.0'

# For Django 4.2.x series (LTS)
pip install --upgrade 'Django>=4.2.28,<5.0'

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

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechDjango

  • SeverityMEDIUM

  • CVSS Score5.4

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-89
  • Technical References
  • Django Announcement Group
  • Vendor Resources
  • Django Security Release Notes

  • Django Weblog Security Releases
  • Related CVEs
  • 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

  • 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