Read the docs
TI-2025-37144 Aliases CVE-2025-59681GHSA-hpr9-3m2g-3j9p

SQL injection in djangoproject Django

Priority MEDIUM 43CWE-89Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
SQL injection
Confidentiality · integrity · availability
High · High · High
Fix status
Partial Red Hat: 2 fixed, 3 without a fix

Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-89.

Summary

An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7. QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() are subject to SQL injection in column aliases, when using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to these methods (on MySQL and MariaDB).

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00639 50th percentileScored 2026-11-07
Fix Partial Django (djangoproject): 4.2.25, 5.1.13, 5.2.7Django (PyPI): 4.2.25, 5.1.13, 5.2.7Red Hat: 2 advisoriesRed Hat: 2 fixed, 3 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
djangoprojectDjango4.2 to before 4.2.25; 5.1 to before 5.1.13; 5.2 to before 5.2.74.2.25, 5.1.13, 5.2.7Patch availableCNA
—Django (PyPI)4.2 to before 4.2.254.2.25Patch availableGHSA-hpr9-3m2g-3j9p
—Django (PyPI)5.1 to before 5.1.135.1.13Patch availableGHSA-hpr9-3m2g-3j9p
—Django (PyPI)5.2 to before 5.2.75.2.7Patch availableGHSA-hpr9-3m2g-3j9p
  • Django Vendordjangoproject Affected 4.2 to before 4.2.25; 5.1 to before 5.1.13; 5.2 to before 5.2.7 Fixed in 4.2.25, 5.1.13, 5.2.7 Patch available CNA
  • Django (PyPI) Vendor— Affected 4.2 to before 4.2.25 Fixed in 4.2.25 Patch available GHSA-hpr9-3m2g-3j9p
  • Django (PyPI) Vendor— Affected 5.1 to before 5.1.13 Fixed in 5.1.13 Patch available GHSA-hpr9-3m2g-3j9p
  • Django (PyPI) Vendor— Affected 5.2 to before 5.2.7 Fixed in 5.2.7 Patch available GHSA-hpr9-3m2g-3j9p

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*4.2 to before 4.2.25; 5.1 to before 5.1.13; 5.2 to before 5.2.7Vulnerabledjangoproject
  • cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* Versions 4.2 to before 4.2.25; 5.1 to before 5.1.13; 5.2 to before 5.2.7 Vulnerable ·djangoproject

Remediation

  • Fix · CNA Django (djangoproject) Fixed in 4.2.25, 5.1.13, 5.2.7
  • Fix · GHSA-hpr9-3m2g-3j9p Django (PyPI) Fixed in 4.2.25 Advisory →
  • Fix · GHSA-hpr9-3m2g-3j9p Django (PyPI) Fixed in 5.1.13 Advisory →
  • Fix · GHSA-hpr9-3m2g-3j9p Django (PyPI) Fixed in 5.2.7 Advisory →

Red Hat 2 advisories

  • RHSA-2025:23196 Released 2025-12-15 · Red Hat rating Important
    Red Hat Ansible Automation Platform 2.6 Ansible DevSpaces Container Release Update
    • Red Hat Ansible Automation Platform 2.6 registry.redhat.io/ansible-automation-platform-tech-preview/ansible-devspaces-rhel9
  • RHSA-2025:18984 Released 2025-10-22 · Red Hat rating Important
    Red Hat Ansible Automation Platform 2.5 Container Release Update
    • Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-25/lightspeed-chatbot-rhel8, ansible-automation-platform-25/lightspeed-rhel8

Fixed in the same release

Records fixed by the same vendor advisory or release, as the CNA lists them.

  • Release ·

    djangoproject Django 4.2.25, 5.1.13, 5.2.7

    2 records Highest priority Priority MEDIUM 1 MEDIUM, 1 LOW

    Other records, highest priority first

    • TI-2025-37145 Path traversal in djangoproject DjangoPriority LOW 31

Vendor assessments

Red Hat

Red Hat rating: Important. Red Hat's page for this CVE →

ProductStatusPlan or fix
OpenShift Service Mesh 3AffectedNo fix yet
Red Hat Certification for Red Hat Enterprise Linux 7AffectedNo fix yet
Red Hat Discovery 2AffectedNo fix yet
Red Hat Ansible Automation Platform 2.5 for RHEL 8Fixed RHSA-2025:18984
Red Hat Ansible Automation Platform 2.6Fixed RHSA-2025:23196
Not affected: 10 products
  • OpenShift Service Mesh 3
  • Red Hat Ansible Automation Platform 2
  • Red Hat Ansible Automation Platform 2.5 for RHEL 8
  • Red Hat Ansible Automation Platform 2.5 for RHEL 9
  • Red Hat Discovery 1
  • Red Hat OpenStack Platform 16.2
  • Red Hat OpenStack Platform 17.1
  • Red Hat OpenStack Platform 18.0
  • Red Hat Satellite 6
  • Red Hat Update Infrastructure 4 for Cloud Providers

Timeline

  1. 2026-10-02 Threatist record created from CVE-2025-59681
  2. 2026-10-03 Alias added: GHSA-hpr9-3m2g-3j9p
  3. 2026-10-23 EPSS moved to the 50th–90th percentile

References

  • TI-2022-15177 An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. CVSS 3.1CRITICAL 9.8
  • TI-2020-05994 Django 1.11 before 1.11.28, 2.2 before 2.2.10, and 3.0 before 3.0.3 allows SQL Injection… CVSS 3.1CRITICAL 9.8
  • TI-2023-10198 An issue was discovered in the Multipart Request Parser in Django 3.2 before 3.2.18, 4.0… CVSS 3.1HIGH 7.5
  • TI-2019-14306 Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. CVSS 3.1CRITICAL 9.8
  • TI-2019-10595 An issue was discovered in Django 1.11.x before 1.11.23, 2.1.x before 2.1.11, and 2.2.x… CVSS 3.0CRITICAL 9.8
  • TI-2021-14006 Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection… CVSS 3.1CRITICAL 9.8
See all 156 →

Sources