cve.bz

CVE-2026-1287 djangoproject django: SQL Injection

5.4 mediumEPSS 0.8%Fix available

Medium (5.4) in djangoproject django. EPSS 0.8% estimated probability of exploitation activity in the next 30 days. Fixed in django 4.2.28, 5.2.11, 6.0.2.

On this page
An issue was discovered in 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28. `FilteredRelation` is subject to SQL injection in column aliases via control characters, using a suitably crafted dictionary, with dictionary expansion, as the `**kwargs` passed to `QuerySet` methods `annotate()`, `aggregate()`, `extra()`, `values()`, `values_list()`, and `alias()`. Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected. Django would like to thank Solomon Kebede for reporting this issue.

Severity

CVSS 3.1

5.4 medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
EPSS
0.8% (unchanged from 0.8% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 59th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-02-03. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-1287 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-1287?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-1287?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-1287 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
djangoproject Djangofrom 6.0 before 6.0.2
djangoproject Djangofrom 5.2 before 5.2.11
djangoproject Djangofrom 4.2 before 4.2.28

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-gvg8-93h5-g6qqPyPIdjango>=6.0a1 <6.0.26.0.2
GHSA-gvg8-93h5-g6qqPyPIdjango>=5.2a1 <5.2.115.2.11
GHSA-gvg8-93h5-g6qqPyPIdjango>=4.2a1 <4.2.284.2.28
PYSEC-2026-46PyPIdjango>=4.2 <4.2.28
>=5.2 <5.2.11
>=6.0 <6.0.2
4.2.28, 5.2.11, 6.0.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11python-django2:2.2.28-1~deb11u12DLA-4484-1
Debian12python-django3:3.2.25-0+deb12u2DEBIAN-CVE-2026-1287 DSA-6150-1
Debian13python-django3:4.2.28-0+deb13u1DEBIAN-CVE-2026-1287 DSA-6150-1
Debian14python-django3:4.2.28-1DEBIAN-CVE-2026-1287
Ubuntu22.04:LTSpython-django2:3.2.12-2ubuntu1.25UBUNTU-CVE-2026-1287
Ubuntu24.04:LTSpython-django3:4.2.11-1ubuntu1.14UBUNTU-CVE-2026-1287
Ubuntu25.10python-django3:5.2.4-1ubuntu2.3UBUNTU-CVE-2026-1287
Ubuntu26.04:LTSpython-django3:5.2.9-0ubuntu3UBUNTU-CVE-2026-1287
UbuntuPro:14.04:LTSpython-django1.6.11-0ubuntu1.3+esm10UBUNTU-CVE-2026-1287
UbuntuPro:16.04:LTSpython-django1.8.7-1ubuntu5.15+esm11UBUNTU-CVE-2026-1287
UbuntuPro:18.04:LTSpython-django1:1.11.11-1ubuntu1.21+esm14UBUNTU-CVE-2026-1287
UbuntuPro:20.04:LTSpython-django2:2.2.12-1ubuntu0.29+esm7UBUNTU-CVE-2026-1287
Red Hatansible_automation_platform:2.5::el8automation-controller, automation-controller-ui, automation-controller-cli and 2 more0:4.6.26-1.el8apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el8automation-gateway, automation-gateway-config, automation-gateway-server0:2.5.20260225-1.el8apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el8python3.12-aiohttp, python3.12-aiohttp-debuginfo, python3.12-aiohttp-debugsource0:3.13.3-2.el8apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el8python3.12-protobuf, python3.12-protobuf-debuginfo, python3.12-protobuf-debugsource0:5.29.6-1.el8apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el8receptor, receptorctl, receptor-debuginfo and 1 more0:1.6.3-4.el8apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8python3.12-django0:4.2.28-1.el8apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el9automation-controller, automation-controller-ui, automation-controller-cli and 2 more0:4.6.26-1.el9apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el9automation-gateway, automation-gateway-config, automation-gateway-server0:2.5.20260225-1.el9apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el9python3.12-aiohttp, python3.12-aiohttp-debuginfo, python3.12-aiohttp-debugsource0:3.13.3-2.el9apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el9python3.12-protobuf, python3.12-protobuf-debuginfo, python3.12-protobuf-debugsource0:5.29.6-1.el9apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el9receptor, receptorctl, receptor-debuginfo and 1 more0:1.6.3-4.el9apRHSA-2026:3959
Red Hatansible_automation_platform:2.5::el9, ansible_automation_platform_developer:2.5::el9python3.12-django0:4.2.28-1.el9apRHSA-2026:3959
52 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Package Hub 15 SP7python-Django4.2.11-150600.3.47.1SUSE-SU-2026:0440-1
openSUSELeap 15.6python-Django4.2.11-150600.3.47.1SUSE-SU-2026:0440-1
openSUSELeap 16.0python-Django5.2.4-bp160.5.1openSUSE-SU-2026:20184-1
openSUSETumbleweedpython-Django5.2.11-1.1openSUSE-SU-2026:10160-1
openSUSETumbleweedpython-Django44.2.28-1.1openSUSE-SU-2026:10247-1
openSUSETumbleweedpython-Django55.2.16-1.1openSUSE-SU-2026:11270-1
openSUSETumbleweedpython-Django66.0.2-1.1openSUSE-SU-2026:10145-1
Alpinev3.23, v3.24py3-django4.2.28-r0ALPINE-CVE-2026-1287

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This IMPORTANT SQL injection flaw in Django allows a remote attacker to execute arbitrary SQL commands by crafting column aliases. This vulnerability affects Red Hat products that incorporate Django, such as Red Hat Ansible Automation Platform, Red Hat Discovery, Red Hat Satellite, Insights, and Ansible Services, potentially leading to unauthorized data access or modification.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.5 for RHEL 8python3.12-django-0:4.2.28-1.el8apFixed 2026-03-06RHSA-2026:3959
Red Hat Ansible Automation Platform 2.5 for RHEL 9python3.12-django-0:4.2.28-1.el9apFixed 2026-03-06RHSA-2026:3959
Red Hat Ansible Automation Platform 2.6 for RHEL 9python3.12-django-0:4.2.28-1.el9apFixed 2026-03-06RHSA-2026:3958
Red Hat Satellite 6.16 for RHEL 8python-django-0:4.2.28-0.1.el8pcFixed 2026-03-26RHSA-2026:5971
Red Hat Satellite 6.16 for RHEL 9python-django-0:4.2.28-0.1.el9pcFixed 2026-03-26RHSA-2026:5971
Red Hat Satellite 6.17 for RHEL 9foreman-0:3.14.0.14-1.el9satFixed 2026-03-26RHSA-2026:5970
Red Hat Satellite 6.17 for RHEL 9libcomps-0:0.1.23-0.3.el9pcFixed 2026-03-26RHSA-2026:5970
Red Hat Satellite 6.17 for RHEL 9python-brotli-0:1.2.0-0.1.el9pcFixed 2026-03-26RHSA-2026:5970
Red Hat Satellite 6.17 for RHEL 9python-django-0:4.2.28-0.1.el9pcFixed 2026-03-26RHSA-2026:5970
Red Hat Satellite 6.17 for RHEL 9python-pulp-container-0:2.22.3-1.el9pcFixed 2026-03-26RHSA-2026:5970
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/de-minimal-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/de-minimal-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/lightspeed-rhel8Will not fix
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-minimal-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-minimal-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/de-minimal-rhel9Not affected
Red Hat Ansible Automation Platform 2automation-controllerWill not fix
Red Hat Ansible Automation Platform 2python-djangoNot affected
Red Hat OpenStack Platform 16.2python-django20Not affected
Red Hat OpenStack Platform 17.1python-djangoNot affected
15 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-1287.

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON