CVEfocus › CVE database › CVE-2026-87975

CVE-2026-87975Privilege abuse in model formsets with editable primary keys

CVSS 4.3 MediumEPSS 0.4% (higher than 22% of CVEs)Published 2026-10-06Updated 2026-10-06Assigner: DSF

An issue was discovered in Django 6.1 before 6.1.2, 6.0 before 6.0.9, and 5.2 before 5.2.18. `django.forms.models.BaseModelFormSet.save_existing_objects()` used the presence of a primary key on a submitted form's instance as evidence that the instance belonged to the formset's limiting queryset. An object outside that queryset is represented by a newly constructed instance whose primary key can still be populated from submitted data when the model's primary key is a field accepted by the form, such as a `OneToOneField` or parent link used as the primary key of an inline formset's model, or a natural or UUID primary key included in the form's fields. This allows an authenticated user permitted to submit such a formset to delete rows outside the limiting queryset, without any permission on the targeted object, via forged management-form data marking an out-of-queryset object for deletion. Models using the default AutoField primary key are not affected. Earlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected. Django would like to thank Seonggwon Yoon for reporting this issue.

CWE-639

What to do

Fixed builds are available from Alpine, Debian: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

3Fixed
6Fix pending
3Under investigation

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10python-djangoFix pendingUBUNTU-CVE-2026-87975
Ubuntu 26.04python-djangoUnder investigationUBUNTU-CVE-2026-87975
Ubuntu 24.04python-djangoUnder investigationUBUNTU-CVE-2026-87975
Ubuntu 22.04python-djangoUnder investigationUBUNTU-CVE-2026-87975
Ubuntu 20.04python-djangoFix pendingUBUNTU-CVE-2026-87975
Ubuntu 18.04python-djangoFix pendingUBUNTU-CVE-2026-87975
Ubuntu 16.04python-djangoFix pendingUBUNTU-CVE-2026-87975
Ubuntu 14.04python-djangoFix pendingUBUNTU-CVE-2026-87975
Debian 14python-djangoFixed3:5.2.18-1DEBIAN-CVE-2026-87975
Debian 13python-djangoFix pendingDEBIAN-CVE-2026-87975
Debian 12python-djangoFixed3:3.2.25-0+deb12u6DEBIAN-CVE-2026-87975
Alpine Linux 3.24py3-djangoFixed5.2.18-r0ALPINE-CVE-2026-87975

What the vendor says

As published in the CVE record by DSF, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.