Security fix released

Today we're releasing a fix for a security vulnerability discovered in Django's internationalization framework. The complete details are below, but the executive summary is that you should updated to a fixed version of Django immediately.

We are releasing point-releases of all affected Django versions. You can download them at http://www.djangoproject.com/download/. Those tracking trunk development should "svn update" as soon as possible.

Please direct any questions about this release to django-users (http://groups.google.com/group/django-users).

Description of vulnerability

A per-process cache used by Django's internationalization ("i18n") system to store the results of translation lookups for particular values of the HTTP Accept-Language header used the full value of that header as a key. An attacker could take advantage of this by sending repeated requests with extremely large strings in the Accept-Language header, potentially causing a denial of service by filling available memory.

Due to limitations imposed by Web server software on the size of HTTP header fields, combined with reasonable limits on the number of requests which may be handled by a single server process over its lifetime, this vulnerability may be difficult to exploit. Additionally, it is only present when the "USE_I18N" setting in Django is "True" and the i18n middleware component is enabled*. Nonetheless, all users of affected versions of Django are encouraged to update.

Affected versions

  • Django trunk prior to revision [6608].
  • Django 0.96
  • Django 0.95 (including 0.95.1)
  • Django 0.91


New versions of Django containing this fix have been released today which alter this caching mechanism to store shortened, normalized values and to reject improperly formatted headers.

These versions are called:

  • Django 0.96.1 (replaces Django 0.96)
  • Django 0.95.2 (replaces Django 0.95.1)
  • Django 0.91.1 (replaces Django 0.91.1)

Anyone using a stable Django release should upgrade to one of these point releases immediately. These fixed versions have already been provided to maintainers of Django packages for various OS distributions and should be released shortly.

Anyone tracking Django's trunk development should use Subversion to update to at least revision [6608].

Additionally, these fixes have been committed to the various "bugfixes" branches:

* This post originally failed to mention that the i18n middleware component must be enabled to trigger the bug.

Posted by Jacob on October 26, 2007