Ipykernel replacement of `getpass` not fully compatible with it

Open
#1,123 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
jupyter, python
Domain
security

Research direction

No file, test, or entry point is named. Start by comparing ipykernel's getpass replacement with Python's standard getpass API, focusing on when GetPassWarning is emitted; done means callers can detect an insecure prompt before the password is requested.

Written by the indexing model from the issue text.

Description

The getpass API requires that the GetPassWarning is generated in case a password cannot be asked to the user in a secure way.

This is an important piece of the API, because it lets the programmer turn the warning into an error to handle the case when the terminal is not suited to securely prompt for a password before the user is asked for a password. In turn this is important because most users will carelessly type in a password regardless of any warning and is particularly bad for interfaces where the password will remain available for view via scrollback. Being able to handle the condition will let the program try different ways to get the password rather than prompting the user in an insecure way.

The problem here is that ipykernel replaces getpass with its own version that does not issue the GetPassWarning, so resulting in a different API from the standard getpass that ends up with the code prompting the user for a password insecurely without even realizing it.

At present time the workaround is clearly for the code to check if getpass comes from ipykernel and deal with this case specially.

Dominant language
Python
Stars
734
Forks
411
Avg merge
1d 2h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ipython/ipykernel

All issues in ipython/ipykernel

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.