2.1.15.txt 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ===========================
  2. Django 2.1.15 release notes
  3. ===========================
  4. *December 2, 2019*
  5. Django 2.1.15 fixes a security issue and a data loss bug in 2.1.14.
  6. CVE-2019-19118: Privilege escalation in the Django admin.
  7. =========================================================
  8. Since Django 2.1, a Django model admin displaying a parent model with related
  9. model inlines, where the user has view-only permissions to a parent model but
  10. edit permissions to the inline model, would display a read-only view of the
  11. parent model but editable forms for the inline.
  12. Submitting these forms would not allow direct edits to the parent model, but
  13. would trigger the parent model's ``save()`` method, and cause pre and post-save
  14. signal handlers to be invoked. This is a privilege escalation as a user who
  15. lacks permission to edit a model should not be able to trigger its save-related
  16. signals.
  17. To resolve this issue, the permission handling code of the Django admin
  18. interface has been changed. Now, if a user has only the "view" permission for a
  19. parent model, the entire displayed form will not be editable, even if the user
  20. has permission to edit models included in inlines.
  21. This is a backwards-incompatible change, and the Django security team is aware
  22. that some users of Django were depending on the ability to allow editing of
  23. inlines in the admin form of an otherwise view-only parent model.
  24. Given the complexity of the Django admin, and in-particular the permissions
  25. related checks, it is the view of the Django security team that this change was
  26. necessary: that it is not currently feasible to maintain the existing behavior
  27. while escaping the potential privilege escalation in a way that would avoid a
  28. recurrence of similar issues in the future, and that would be compatible with
  29. Django's *safe by default* philosophy.
  30. For the time being, developers whose applications are affected by this change
  31. should replace the use of inlines in read-only parents with custom forms and
  32. views that explicitly implement the desired functionality. In the longer term,
  33. adding a documented, supported, and properly-tested mechanism for
  34. partially-editable multi-model forms to the admin interface may occur in Django
  35. itself.
  36. Bugfixes
  37. ========
  38. * Fixed a data loss possibility in the
  39. :meth:`~django.db.models.query.QuerySet.select_for_update()`. When using
  40. ``'self'`` in the ``of`` argument with :ref:`multi-table inheritance
  41. <multi-table-inheritance>`, a parent model was locked instead of the
  42. queryset's model (:ticket:`30953`).