Moderate severityNVD Advisory· Published Jan 10, 2011· Updated Apr 29, 2026
CVE-2010-4535
CVE-2010-4535
Description
The password reset functionality in django.contrib.auth in Django before 1.1.3, 1.2.x before 1.2.4, and 1.3.x before 1.3 beta 1 does not validate the length of a string representing a base36 timestamp, which allows remote attackers to cause a denial of service (resource consumption) via a URL that specifies a large base36 integer.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
DjangoPyPI | < 1.1.3 | 1.1.3 |
DjangoPyPI | >= 1.2, < 1.2.4 | 1.2.4 |
Affected products
16cpe:2.3:a:djangoproject:django:1.2.3:*:*:*:*:*:*:*+ 15 more
- cpe:2.3:a:djangoproject:django:1.2.3:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.3:alpha1:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.3:alpha2:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*range: <=1.1.2
- cpe:2.3:a:djangoproject:django:0.91:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:0.95:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:0.95.1:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:0.96:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.0:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.0.1:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.0.2:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.1:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.1.0:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.2:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.2.1:*:*:*:*:*:*:*
- cpe:2.3:a:djangoproject:django:1.2.2:*:*:*:*:*:*:*
Patches
27f8dd9cbac07[1.1.X] Fix a security issue in the auth system. Disclosure and new release forthcoming.
3 files changed · +13 −3
django/contrib/auth/tests/tokens.py+5 −0 modified@@ -34,4 +34,9 @@ >>> p2.check_token(u, tk1) False +This will put a 14-digit base36 timestamp into the token, which is too large. +>>> tk1 = p0._make_token_with_timestamp(u, 175455491841851871349) +>>> p0.check_token(u, tk1) +False + """
django/contrib/auth/urls.py+2 −2 modified@@ -1,4 +1,4 @@ -# These URLs are normally mapped to /admin/urls.py. This URLs file is +# These URLs are normally mapped to /admin/urls.py. This URLs file is # provided as a convenience to those who want to deploy these URLs elsewhere. # This file is also used to provide a reliable view deployment for test purposes. @@ -11,7 +11,7 @@ (r'^password_change/done/$', 'django.contrib.auth.views.password_change_done'), (r'^password_reset/$', 'django.contrib.auth.views.password_reset'), (r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'), - (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'), + (r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm'), (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'), )
django/utils/http.py+6 −1 modified@@ -73,8 +73,13 @@ def http_date(epoch_seconds=None): def base36_to_int(s): """ - Convertd a base 36 string to an integer + Converts a base 36 string to an ``int``. To prevent + overconsumption of server resources, raises ``ValueError` if the + input is longer than 13 base36 digits (13 digits is sufficient to + base36-encode any 64-bit integer). """ + if len(s) > 13: + raise ValueError("Base36 input too large") return int(s, 36) def int_to_base36(i):
d5d8942a1606Fix a security issue in the auth system. Disclosure and new release forthcoming.
3 files changed · +19 −3
django/contrib/auth/tests/tokens.py+11 −0 modified@@ -50,3 +50,14 @@ def _today(self): p2 = Mocked(date.today() + timedelta(settings.PASSWORD_RESET_TIMEOUT_DAYS + 1)) self.assertFalse(p2.check_token(user, tk1)) + + def test_date_length(self): + """ + Make sure we don't allow overly long dates, causing a potential DoS. + """ + user = User.objects.create_user('ima1337h4x0r', 'test4@example.com', 'p4ssw0rd') + p0 = PasswordResetTokenGenerator() + + # This will put a 14-digit base36 timestamp into the token, which is too large. + tk1 = p0._make_token_with_timestamp(user, 175455491841851871349) + self.assertFalse(p0.check_token(user, tk1))
django/contrib/auth/urls.py+2 −2 modified@@ -1,4 +1,4 @@ -# These URLs are normally mapped to /admin/urls.py. This URLs file is +# These URLs are normally mapped to /admin/urls.py. This URLs file is # provided as a convenience to those who want to deploy these URLs elsewhere. # This file is also used to provide a reliable view deployment for test purposes. @@ -11,7 +11,7 @@ (r'^password_change/done/$', 'django.contrib.auth.views.password_change_done'), (r'^password_reset/$', 'django.contrib.auth.views.password_reset'), (r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'), - (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'), + (r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm'), (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'), )
django/utils/http.py+6 −1 modified@@ -73,8 +73,13 @@ def http_date(epoch_seconds=None): def base36_to_int(s): """ - Convertd a base 36 string to an integer + Converts a base 36 string to an ``int``. To prevent + overconsumption of server resources, raises ``ValueError` if the + input is longer than 13 base36 digits (13 digits is sufficient to + base36-encode any 64-bit integer). """ + if len(s) > 13: + raise ValueError("Base36 input too large") return int(s, 36) def int_to_base36(i):
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
21- code.djangoproject.com/changeset/15032nvdPatchWEB
- www.djangoproject.com/weblog/2010/dec/22/security/nvdPatchVendor Advisory
- www.openwall.com/lists/oss-security/2010/12/23/4nvdPatchWEB
- www.openwall.com/lists/oss-security/2011/01/03/5nvdPatchWEB
- bugzilla.redhat.com/show_bug.cginvdPatchWEB
- secunia.com/advisories/42715nvdVendor Advisory
- github.com/advisories/GHSA-7wph-fc4w-wqp2ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2010-4535ghsaADVISORY
- lists.fedoraproject.org/pipermail/package-announce/2011-January/053041.htmlnvdWEB
- lists.fedoraproject.org/pipermail/package-announce/2011-January/053072.htmlnvdWEB
- www.djangoproject.com/weblog/2010/dec/22/securityghsaWEB
- www.ubuntu.com/usn/USN-1040-1nvdWEB
- github.com/django/django/commit/7f8dd9cbac074389af8d8fd235bf2cb657227b9aghsaWEB
- github.com/django/django/commit/d5d8942a160685c403d381a279e72e09de5489a9ghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2011-9.yamlghsaWEB
- web.archive.org/web/20200228193349/http://www.securityfocus.com/bid/45563ghsaWEB
- secunia.com/advisories/42827nvd
- secunia.com/advisories/42913nvd
- www.securityfocus.com/bid/45563nvd
- www.vupen.com/english/advisories/2011/0048nvd
- www.vupen.com/english/advisories/2011/0098nvd
News mentions
0No linked articles in our index yet.