CVE-2026-1287: Potential SQL injection in column aliases via control characters
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.
Security readout for executives and security teams
Plain-English summary
CVE-2026-1287 is a high-severity Django SQL injection flaw. Certain dynamic QuerySet arguments can let crafted column aliases alter database queries. This matters most for applications that build ORM query parameters from dictionaries, especially when any key names can be influenced by users or external data.
Executive priority
Treat as a prompt patching item for Django-backed systems handling sensitive data. Prioritize public applications, admin/reporting features, and services with dynamic query builders. Do not wait for exploitation evidence before upgrading supported affected versions.
Technical view
Django FilteredRelation is vulnerable to SQL injection through control characters in column aliases when crafted dictionaries are expanded into QuerySet methods including annotate(), aggregate(), extra(), values(), values_list(), and alias(). Affected supported releases are 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28.
Likely exposure
Internet-facing Django applications are exposed if they run affected versions and pass dynamic dictionaries into the named QuerySet methods. Risk is higher when alias or field names derive from request data, API parameters, reports, filters, or saved user configuration.
Exploitation context
The CVSS vector indicates network reachability, low attack complexity, low privileges, and no user interaction. The source bundle says KEV is false, and no cited source here confirms active exploitation. Earlier unsupported Django series were not evaluated and may also be affected.
Researcher notes
Focus review on crafted dictionary expansion into ORM methods, not raw SQL alone. The advisory scope is specific to column aliases and FilteredRelation. The bundle does not provide enough evidence to assess exploit availability or unsupported-series impact beyond possible exposure.
Mitigation direction
Upgrade Django to 6.0.2, 5.2.11, or 4.2.28 as appropriate.
For unsupported Django series, migrate to a supported fixed release or check vendor guidance.
Review downstream vendor packages and apply relevant Red Hat errata where applicable.
Validate or constrain dynamic alias keys before passing dictionaries into QuerySet methods.
Avoid deriving ORM alias names directly from request or external data.
Validation and detection
Inventory deployed Django versions from package locks, images, and runtime environments.
Search code for FilteredRelation plus dynamic **kwargs in the named QuerySet methods.
Review report, filter, and search features that construct ORM dictionaries dynamically.
Add regression tests for rejecting control characters in alias-like inputs.
Confirm production artifacts include the fixed Django version or downstream patched package.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-89: Database access and collection lookup
Injection into data stores can inform collection, data access, and exfiltration detection reviews. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references database injection or access, so collection and exfiltration review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-89 · source CWE mapping
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.