1.4.18.txt 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ===========================
  2. Django 1.4.18 release notes
  3. ===========================
  4. *January 13, 2015*
  5. Django 1.4.18 fixes several security issues in 1.4.17 as well as a regression
  6. on Python 2.5 in the 1.4.17 release.
  7. WSGI header spoofing via underscore/dash conflation
  8. ===================================================
  9. When HTTP headers are placed into the WSGI environ, they are normalized by
  10. converting to uppercase, converting all dashes to underscores, and prepending
  11. `HTTP_`. For instance, a header ``X-Auth-User`` would become
  12. ``HTTP_X_AUTH_USER`` in the WSGI environ (and thus also in Django's
  13. ``request.META`` dictionary).
  14. Unfortunately, this means that the WSGI environ cannot distinguish between
  15. headers containing dashes and headers containing underscores: ``X-Auth-User``
  16. and ``X-Auth_User`` both become ``HTTP_X_AUTH_USER``. This means that if a
  17. header is used in a security-sensitive way (for instance, passing
  18. authentication information along from a front-end proxy), even if the proxy
  19. carefully strips any incoming value for ``X-Auth-User``, an attacker may be
  20. able to provide an ``X-Auth_User`` header (with underscore) and bypass this
  21. protection.
  22. In order to prevent such attacks, both Nginx and Apache 2.4+ strip all headers
  23. containing underscores from incoming requests by default. Django's built-in
  24. development server now does the same. Django's development server is not
  25. recommended for production use, but matching the behavior of common production
  26. servers reduces the surface area for behavior changes during deployment.
  27. Mitigated possible XSS attack via user-supplied redirect URLs
  28. =============================================================
  29. Django relies on user input in some cases (e.g.
  30. :func:`django.contrib.auth.views.login` and :doc:`i18n </topics/i18n/index>`)
  31. to redirect the user to an "on success" URL. The security checks for these
  32. redirects (namely ``django.utils.http.is_safe_url()``) didn't strip leading
  33. whitespace on the tested URL and as such considered URLs like
  34. ``\njavascript:...`` safe. If a developer relied on ``is_safe_url()`` to
  35. provide safe redirect targets and put such a URL into a link, they could suffer
  36. from a XSS attack. This bug doesn't affect Django currently, since we only put
  37. this URL into the ``Location`` response header and browsers seem to ignore
  38. JavaScript there.
  39. Denial-of-service attack against ``django.views.static.serve``
  40. ==============================================================
  41. In older versions of Django, the :func:`django.views.static.serve` view read
  42. the files it served one line at a time. Therefore, a big file with no newlines
  43. would result in memory usage equal to the size of that file. An attacker could
  44. exploit this and launch a denial-of-service attack by simultaneously requesting
  45. many large files. This view now reads the file in chunks to prevent large
  46. memory usage.
  47. Note, however, that this view has always carried a warning that it is not
  48. hardened for production use and should be used only as a development aid. Now
  49. may be a good time to audit your project and serve your files in production
  50. using a real front-end web server if you are not doing so.
  51. Bugfixes
  52. ========
  53. * To maintain compatibility with Python 2.5, Django's vendored version of six,
  54. ``django.utils.six``, has been downgraded to 1.8.0 which is the last
  55. version to support Python 2.5.