1.3.5.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ==========================
  2. Django 1.3.5 release notes
  3. ==========================
  4. *December 10, 2012*
  5. Django 1.3.5 addresses two security issues present in previous Django releases
  6. in the 1.3 series.
  7. Please be aware that this security release is slightly different from previous
  8. ones. Both issues addressed here have been dealt with in prior security updates
  9. to Django. In one case, we have received ongoing reports of problems, and in
  10. the other we've chosen to take further steps to tighten up Django's code in
  11. response to independent discovery of potential problems from multiple sources.
  12. Host header poisoning
  13. ---------------------
  14. Several earlier Django security releases focused on the issue of poisoning the
  15. HTTP Host header, causing Django to generate URLs pointing to arbitrary,
  16. potentially-malicious domains.
  17. In response to further input received and reports of continuing issues
  18. following the previous release, we're taking additional steps to tighten Host
  19. header validation. Rather than attempt to accommodate all features HTTP
  20. supports here, Django's Host header validation attempts to support a smaller,
  21. but far more common, subset:
  22. * Hostnames must consist of characters ``[A-Za-z0-9]`` plus hyphen ('-') or dot
  23. ('.').
  24. * IP addresses -- both IPv4 and IPv6 -- are permitted.
  25. * Port, if specified, is numeric.
  26. Any deviation from this will now be rejected, raising the exception
  27. :exc:`django.core.exceptions.SuspiciousOperation`.
  28. Redirect poisoning
  29. ------------------
  30. Also following up on a previous issue: in July of this year, we made changes to
  31. Django's HTTP redirect classes, performing additional validation of the scheme
  32. of the URL to redirect to (since, both within Django's own supplied
  33. applications and many third-party applications, accepting a user-supplied
  34. redirect target is a common pattern).
  35. Since then, two independent audits of the code turned up further potential
  36. problems. So, similar to the Host-header issue, we are taking steps to provide
  37. tighter validation in response to reported problems (primarily with third-party
  38. applications, but to a certain extent also within Django itself). This comes in
  39. two parts:
  40. 1. A new utility function, ``django.utils.http.is_safe_url``, is added; this
  41. function takes a URL and a hostname, and checks that the URL is either
  42. relative, or if absolute matches the supplied hostname. This function is
  43. intended for use whenever user-supplied redirect targets are accepted, to
  44. ensure that such redirects cannot lead to arbitrary third-party sites.
  45. 2. All of Django's own built-in views -- primarily in the authentication system
  46. -- which allow user-supplied redirect targets now use ``is_safe_url`` to
  47. validate the supplied URL.