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

Fix bug with non ascii passwords in notebook login #4524

Closed
lev112 opened this issue Nov 12, 2013 · 2 comments · Fixed by #4526
Closed

Fix bug with non ascii passwords in notebook login #4524

lev112 opened this issue Nov 12, 2013 · 2 comments · Fixed by #4526
Milestone

Comments

@lev112
Copy link

lev112 commented Nov 12, 2013

When a password is entered with non ascii characters, a 500: Internal Server Error is returned.
I don't think non ascii passwords should be supported, but a 'Invalid password' message should be returned.

2013-11-12 11:43:19.608 [tornado.application] ERROR | Uncaught exception POST /login?next=%2F (127.0.0.1)
HTTPRequest(protocol='http', host='127.0.0.1:8888', method='POST', uri='/login?next=%2F', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Origin': 'http://127.0.0.1:8888', 'Content-Length': '63', 'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip,deflate,sdch', 'Host': '127.0.0.1:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36', 'Connection': 'keep-alive', 'Referer': 'http://127.0.0.1:8888/login', 'Content-Type': 'application/x-www-form-urlencoded'})
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\tornado\web.py", line 1141, in _when_complete
    callback()
  File "C:\Python27\lib\site-packages\tornado\web.py", line 1162, in _execute_method
    self._when_complete(method(*self.path_args, **self.path_kwargs),
  File "C:\Python27\lib\site-packages\IPython\html\auth\login.py", line 48, in post
    if passwd_check(self.password, pwd):
  File "C:\Python27\lib\site-packages\IPython\lib\security.py", line 116, in passwd_check
    h.update(cast_bytes(passphrase, 'utf-8') + str_to_bytes(salt, 'ascii'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 0: ordinal not in range(128)
@takluyver
Copy link
Member

I think we should aim to support non-ascii passwords properly. I'll look into it.

@takluyver
Copy link
Member

Should be fixed in PR #4526.

minrk added a commit that referenced this issue Nov 12, 2013
Allow unicode arguments to passwd_check on Python 2

Closes #4524
@minrk minrk added this to the 2.0 milestone Mar 26, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Allow unicode arguments to passwd_check on Python 2

Closes ipython#4524
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

Successfully merging a pull request may close this issue.

3 participants