Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemcachedKeyLengthError with a long anoncsrf cookie #10

Open
rik opened this issue May 18, 2012 · 6 comments
Open

MemcachedKeyLengthError with a long anoncsrf cookie #10

rik opened this issue May 18, 2012 · 6 comments

Comments

@rik
Copy link

rik commented May 18, 2012

From a traceback on affiliates:

Traceback (most recent call last):

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django/django/core/handlers/base.py", line 89, in get_response
response = middleware_method(request)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django-session-csrf/session_csrf/init.py", line 53, in process_request
token = cache.get(PREFIX + key, '')

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/src/django/django/core/cache/backends/memcached.py", line 58, in get
val = self._cache.get(key)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/lib/python/memcache.py", line 779, in get
return self._get('get', key)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/lib/python/memcache.py", line 747, in _get
self.check_key(key)

File "/data/www/affiliates.mozilla.org/affiliates-app/vendor/lib/python/memcache.py", line 940, in check_key
% self.server_max_key_length)

MemcachedKeyLengthError: Key length is > 250

@jbalogh
Copy link
Contributor

jbalogh commented May 18, 2012

Where is the super long token coming from? Django defaults to 32 characters.

@rik
Copy link
Author

rik commented May 18, 2012

Oops, sorry, forgot to paste an example:

COOKIES:{'anoncsrf': '//%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/%25252e%25252e/etc/passwd'},

@jbalogh
Copy link
Contributor

jbalogh commented May 18, 2012

Is this from @stephendonner?

@stephendonner
Copy link

I haven't run any security testing against Affiliates in a while; when was this from?

@rik
Copy link
Author

rik commented May 18, 2012

Almost two hours ago. Discussing with security at the same time on IRC.

@Sancus
Copy link

Sancus commented Jun 20, 2013

This was fixed by the above PR, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants