CVE-2026-87975: CWE-639: Authorization Bypass Through User-Controlled Key in djangoproject Django
Description
CVE-2026-87975 is an authorization bypass vulnerability in Django affecting versions 6.1 before 6.1.2, 6.0 before 6.0.9, and 5.2 before 5.2.18. The issue arises in django.forms.models.BaseModelFormSet.save_existing_objects(), which incorrectly trusts the presence of a primary key on a submitted form's instance as proof that the instance belongs to the formset's limiting queryset. This flaw allows an authenticated user with permission to submit such a formset to delete objects outside the intended queryset by submitting forged management-form data. Models using the default AutoField primary key are not affected. The vulnerability has a medium severity with a CVSS score of 4.3.
CVSS v3.1
Score 4.3medium
Affected software
djangoproject
Django
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Django's BaseModelFormSet.save_existing_objects() method occurs because it uses the presence of a primary key on a submitted form instance as evidence that the instance belongs to the formset's limiting queryset. When the model's primary key is a field accepted by the form (such as OneToOneField, parent link, natural key, or UUID primary key), an attacker can forge management-form data to mark objects outside the queryset for deletion. This allows an authenticated user with permission to submit the formset to delete rows they do not have explicit permission to delete. Models using the default AutoField primary key are not vulnerable. Affected versions are Django 6.1 prior to 6.1.2, 6.0 prior to 6.0.9, and 5.2 prior to 5.2.18.
Potential Impact
An authenticated user permitted to submit the affected formset can delete database rows outside the intended queryset without having permission on those objects. This results in an authorization bypass leading to unintended data deletion. There is no impact on confidentiality or availability, and no known exploitation in the wild has been reported.
Mitigation Recommendations
A fix is available in Django versions 6.1.2, 6.0.9, and 5.2.18. Users should upgrade to these or later versions to remediate the vulnerability. No other mitigation is indicated by the vendor advisory.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- DSF
- Date Reserved
- 2026-09-09T18:18:45.075Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ac4fc562cdf04f656b4d698
Added to database: 10/06/2026, 13:49:10 UTC
Last enriched: 10/06/2026, 14:04:38 UTC
Last updated: 10/06/2026, 19:48:07 UTC
Views: 8
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.