Closed Bug 771163 Opened 13 years ago Closed 11 years ago

[traceback][prod] Error: MemcachedKeyLengthError: Key length is > 250

Categories

(Participation Infrastructure :: Phonebook, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mbrandt, Unassigned)

References

()

Details

(Whiteboard: [kb=1017576] [traceback][prod])

Traceback (most recent call last): File "/data/www/mozillians.org/mozillians/vendor/src/django/django/core/handlers/base.py", line 89, in get_response response = middleware_method(request) File "/data/www/mozillians.org/mozillians/vendor/src/django-session-csrf/session_csrf/__init__.py", line 53, in process_request token = cache.get(PREFIX + key, '') File "/data/www/mozillians.org/mozillians/vendor/src/django/django/core/cache/backends/memcached.py", line 58, in get val = self._cache.get(key) File "/data/www/mozillians.org/mozillians/vendor/lib/python/memcache.py", line 779, in get return self._get('get', key) File "/data/www/mozillians.org/mozillians/vendor/lib/python/memcache.py", line 747, in _get self.check_key(key) File "/data/www/mozillians.org/mozillians/vendor/lib/python/memcache.py", line 940, in check_key % self.server_max_key_length) MemcachedKeyLengthError: Key length is > 250 <WSGIRequest path:/en-US/about, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'anoncsrf': 'invalid../../../../../../../../../../etc/passwd/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.! /./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.! /././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././ ./././././././././././././././././././././././././././././././././././! ././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././! ./././././././././././././././././././././././././././././././././././././././././././.', 'messages': '67a8dbc8410dcebaa91e76e6a12685dd91b0e82c$[["__json_message",40,"Ooops, something went wrong. Please try again."]]'}, META:{'DOCUMENT_ROOT': '/data/www/mozillians.org/mozillians', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTPS': 'on', 'HTTP_ACCEPT': '*/*', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACUNETIX_PRODUCT': 'WVS/8.0 (Acunetix Web Vulnerability Scanner - NORMAL)', 'HTTP_ACUNETIX_SCANNING_AGREEMENT': 'Third Party Scanning PROHIBITED', 'HTTP_ACUNETIX_USER_AGREEMENT': 'http://www.acunetix.com/wvs/disc.htm', 'HTTP_CONNECTION': 'Keep-alive', 'HTTP_COOKIE': 'anoncsrf=invalid../../../../../../../../../../etc/passwd/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.! /./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.! /././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././ ./././././././././././././././././././././././././././././././././././! ././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././! ./././././././././././././././././././././././././././././././././././././././././././././.; messages="67a8dbc8410dcebaa91e76e6a12685dd91b0e82c$[[\\"__json_message\\"\\05440\\054\\"Ooops\\054 something went wrong. Please try again.\\"]]"', 'HTTP_HOST': 'mozillians.org', 'HTTP_SSLCLIENTCERTSTATUS': 'NoClientCert', 'HTTP_SSLCLIENTCIPHER': 'SSL_RSA_WITH_RC4_128_SHA, version=SSLv3, bits=128', 'HTTP_SSLSESSIONID': 'CF0380B51F69FCF4BB6B60C64676ECF78DD7A12079D9EF66769F344FFC86156C', 'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)', 'HTTP_X_CLUSTER_CLIENT_IP': '89.123.95.77', 'HTTP_X_FORWARDED_FOR': '89.123.95.77', 'PATH_INFO': u'/en-US/about', 'PATH_TRANSLATED': '/data/www/mozillians.org/mozillians/wsgi/playdoh.wsgi/en-US/about', 'QUERY_STRING': '', 'REMOTE_ADDR': '10.8.81.216', 'REMOTE_PORT': '3893', 'REQUEST_METHOD': 'GET', 'REQUEST_URI': '/en-US/about', 'SCRIPT_FILENAME': '/data/www/mozillians.org/mozillians/wsgi/playdoh.wsgi', 'SCRIPT_NAME': u'', 'SCRIPT_URI': 'http://mozillians.org/en-US/about', 'SCRIPT_URL': '/en-US/about', 'SERVER_ADDR': '10.8.81.95', 'SERVER_ADMIN': 'webmaster@mozilla.com', 'SERVER_NAME': 'mozillians.org', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SIGNATURE': '', 'SERVER_SOFTWARE': 'Apache', 'mod_wsgi.application_group': 'mozillians', 'mod_wsgi.callable_object': 'application', 'mod_wsgi.handler_script': '', 'mod_wsgi.input_chunked': '0', 'mod_wsgi.listener_host': '', 'mod_wsgi.listener_port': '81', 'mod_wsgi.process_group': 'mozillians', 'mod_wsgi.request_handler': 'wsgi-script', 'mod_wsgi.script_reloading': '1', 'mod_wsgi.version': (3, 3), 'wsgi.errors': <mod_wsgi.Log object at 0x7f1a91ad7cb0>, 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f1a9175daf8>, 'wsgi.input': <mod_wsgi.Input object at 0x7f1a91ad70b0>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'https', 'wsgi.version': (1, 1)}>
Matt, This a traceback from a failed attempt to break into the website, probably from some generic security script. The exception is generated correctly since the requested URL is way too long and that's something the end user should never come across. Do you still believe that's a bug? If yes can you explain what you would like fixed? Thanks!
Yes, this is still a bug. User requests, even those with bad (or whitehat) intentions should not be able to cause server errors. I realize that is a lofty, probably unachievable goal, but we should still fix things like this when we find them.
And what's an acceptable fix for that?
It's django-session-csrf's bug. It should probably do *something* to validate the anoncsrf cache key. (See the 2nd highest frame of the stack, the process_request call.) And possibly raise PermissionDenied? I'm not 100% sure how it should react there.
Looks like this was fixed in https://github.com/mozilla/django-session-csrf/pull/14 so we should update django-session-csrf and that will resolve this bug.
Group: mozilla-corporation-confidential
Whiteboard: [traceback][prod] → [kb=1017576] [traceback][prod]
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Thank you :giorgos - bumping to verifed
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.