Ipykernel replacement of `getpass` not fully compatible with it
- 主要語言
- Python
- 星號
- 734
- 分支
- 412
- 平均合併
- 1 天 5 小時
- 30 天內合併 PR
- 8
描述
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.
貢獻指南
研究方向
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.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- jupyter, python
- 領域
- security
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100