{"id":"CVE-2026-1312","published":"2026-02-03T14:36:23Z","modified":"2026-07-15T01:21:55Z","title":"Potential SQL injection via QuerySet.order_by and FilteredRelation","vendor":"djangoproject","product":"Django","tier":"tail","description":{"text":"An issue was discovered in 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28.\n`.QuerySet.order_by()` is subject to SQL injection in column aliases containing periods when the same alias is, using a suitably crafted dictionary, with dictionary expansion, used in `FilteredRelation`.\nEarlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected.\nDjango would like to thank Solomon Kebede for reporting this issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.00897,"percentile":0.60449,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://docs.djangoproject.com/en/dev/releases/security/","tags":["vendor-advisory"]},{"url":"https://groups.google.com/g/django-announce","tags":["mailing-list"]},{"url":"https://www.djangoproject.com/weblog/2026/feb/03/security-releases/","tags":["vendor-advisory"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-1312","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2436342","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-1312.json","tags":["x_sadp-csaf-vex"]},{"url":"https://access.redhat.com/errata/RHSA-2026:3959","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:5971","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:3958","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:5970","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:14835","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:3962","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:3960","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:2694","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:6291","tags":["vendor-advisory","x_refsource_REDHAT"]}],"priority":{"score":20.9,"factors":[{"name":"EPSS percentile","points":12.09},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":3.78}]},"exploitSources":{"pocGithub":{"count":1,"skipped":1,"earliest":"2026-02-21","earliestUrl":"https://github.com/sw0rd1ight/CVE-2026-1312","repos":[{"name":"sw0rd1ight/CVE-2026-1312","url":"https://github.com/sw0rd1ight/CVE-2026-1312","stars":2,"created":"2026-02-21"}]},"first":{"date":"2026-02-21","source":"PoC-in-GitHub","url":"https://github.com/sw0rd1ight/CVE-2026-1312"},"provenance":"source"},"vendorSlug":"djangoproject","affectedVersions":[{"vendor":"djangoproject","product":"Django","versions":[">= 6.0, < 6.0.2",">= 5.2, < 5.2.11",">= 4.2, < 4.2.28"]}],"fixedVersions":[{"vendor":"djangoproject","product":"Django","versions":["6.0.2","5.2.11","4.2.28"]}],"capec":[{"id":"CAPEC-66","name":"SQL Injection"}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-02-03T16:56:09.077282Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Django","vulnerableRanges":[">=6.0a1, <6.0.2",">=5.2a1, <5.2.11",">=4.2a1, <4.2.28",">=4.2, <4.2.28",">=5.2, <5.2.11",">=6.0, <6.0.2"],"patched":["6.0.2","5.2.11","4.2.28"],"from":["GHSA-6426-9fv3-65x8","PYSEC-2026-47"],"provenance":"source"}],"summary":{"text":"The flaw is an SQL injection in Django's QuerySet.order_by() method, affecting column aliases that contain periods and that are also used in FilteredRelation through a crafted dictionary expansion, in Django 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28. An attacker with network access and low-privileged authenticated access can exploit this with low complexity and no user interaction to read some confidential data and modify some integrity-protected data, though availability is not affected.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:29:59Z"},"euvd":{"id":"EUVD-2026-5236","exploited":false,"provenance":"source"}}