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

read --silent is storing passwords in plaintext in history #7230

Closed
mdenzel opened this issue Jul 28, 2020 · 3 comments
Closed

read --silent is storing passwords in plaintext in history #7230

mdenzel opened this issue Jul 28, 2020 · 3 comments
Milestone

Comments

@mdenzel
Copy link

mdenzel commented Jul 28, 2020

Hello guys,

it seems that fish is storing plaintext passwords when using read --silent to read them in. This makes password prompts a security hazard.

It has already been fixed according to #6438 and #5904 (also #838, #1504) but does not seem to work as expected:

> set | grep fish_private
fish_private_mode
> fish --private
Welcome to fish, the friendly interactive shell.
fish is running in private mode, history will not be persisted.
> set | grep fish_private
fish_private_mode 1
> read --silent password
read> ●●●●●●●●●●●●●●●●
> mysecretpassword
(simply by pressing the "up" arrowkey; it also shows up in the 'history' command)

Attackers could just dump passwords from fish's history.

Systeminfo:

> echo $TERM
xterm-256color
> uname -r
5.7.10-201.fc32.x86_64
> fish --version
fish, version 3.1.2
@faho
Copy link
Member

faho commented Jul 28, 2020

The read history is no longer stored on disk. It is still kept in memory, but at that point you have bigger problems.

@faho faho closed this as completed Jul 28, 2020
@faho faho added this to the will-not-implement milestone Jul 28, 2020
@ridiculousfish
Copy link
Member

ridiculousfish commented Jul 30, 2020

Reopening this - I can reproduce in --private mode only. The password is not written to disk in any scenario, but probably it ought not to be returned by history either.

@ridiculousfish
Copy link
Member

Thanks for filing, good find!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants