1.5.9.txt 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ==========================
  2. Django 1.5.9 release notes
  3. ==========================
  4. *August 20, 2014*
  5. Django 1.5.9 fixes several security issues in 1.5.8.
  6. ``reverse()`` could generate URLs pointing to other hosts
  7. =========================================================
  8. In certain situations, URL reversing could generate scheme-relative URLs (URLs
  9. starting with two slashes), which could unexpectedly redirect a user to a
  10. different host. An attacker could exploit this, for example, by redirecting
  11. users to a phishing site designed to ask for user's passwords.
  12. To remedy this, URL reversing now ensures that no URL starts with two slashes
  13. (//), replacing the second slash with its URL encoded counterpart (%2F). This
  14. approach ensures that semantics stay the same, while making the URL relative to
  15. the domain and not to the scheme.
  16. File upload denial-of-service
  17. =============================
  18. Before this release, Django's file upload handing in its default configuration
  19. may degrade to producing a huge number of ``os.stat()`` system calls when a
  20. duplicate filename is uploaded. Since ``stat()`` may invoke IO, this may produce
  21. a huge data-dependent slowdown that slowly worsens over time. The net result is
  22. that given enough time, a user with the ability to upload files can cause poor
  23. performance in the upload handler, eventually causing it to become very slow
  24. simply by uploading 0-byte files. At this point, even a slow network connection
  25. and few HTTP requests would be all that is necessary to make a site unavailable.
  26. We've remedied the issue by changing the algorithm for generating file names
  27. if a file with the uploaded name already exists.
  28. :meth:`Storage.get_available_name()
  29. <django.core.files.storage.Storage.get_available_name>` now appends an
  30. underscore plus a random 7 character alphanumeric string (e.g. ``"_x3a1gho"``),
  31. rather than iterating through an underscore followed by a number (e.g. ``"_1"``,
  32. ``"_2"``, etc.).
  33. ``RemoteUserMiddleware`` session hijacking
  34. ==========================================
  35. When using the :class:`~django.contrib.auth.middleware.RemoteUserMiddleware`
  36. and the ``RemoteUserBackend``, a change to the ``REMOTE_USER`` header between
  37. requests without an intervening logout could result in the prior user's session
  38. being co-opted by the subsequent user. The middleware now logs the user out on
  39. a failed login attempt.
  40. Data leakage via query string manipulation in ``contrib.admin``
  41. ===============================================================
  42. In older versions of Django it was possible to reveal any field's data by
  43. modifying the "popup" and "to_field" parameters of the query string on an admin
  44. change form page. For example, requesting a URL like
  45. ``/admin/auth/user/?pop=1&t=password`` and viewing the page's HTML allowed
  46. viewing the password hash of each user. While the admin requires users to have
  47. permissions to view the change form pages in the first place, this could leak
  48. data if you rely on users having access to view only certain fields on a model.
  49. To address the issue, an exception will now be raised if a ``to_field`` value
  50. that isn't a related field to a model that has been registered with the admin
  51. is specified.