-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Pkg.clone shows password in cleartext on screen when cloning via https #17422
Comments
It was either @wildart or @stevengj who wrote the authentication code I believe. Re: pinging me personally, I'd rather you didn't, x-ref #15068 (comment) |
I can reproduce this (on Windows, not on Linux). |
I'm very confused. When I call julia/base/libgit2/callbacks.jl Line 175 in edb112a
|
ha, it's a terminal issue. |
Happy to test if you have a proposed patch/PR. |
I can confirm that |
It looks like it works differently depending on whether you're running from mintty (in cygwin or msys2) or cmd. |
I tried 0.4.5 and |
It's not a difference between 0.4 and 0.5, it's a difference in what terminal you're using to run Julia. |
Question is from where |
cmd in my tests. Probably powershell for @davidanthoff, but that's usually the same console host. |
I'm running @davidanthoff What terminal do you use when running julia? |
You can clone a private package over https with recent 0.5-dev in cmd, without the password getting echoed? I seem to get the password echoed sometimes in cmd if Pkg.clone is the first thing I run, but not if I do anything else in the REPL first. Something might be racy or very sensitive to REPL state. |
Yes, no echo for me. The only problem that enter key is swallowed and following output starts right after password prompt. |
I'm not using mintty, I'm just starting julia from the startmenu shortcut to reproduce this, so there is also no powershell involved. Things got even weirder just now. I essentially got this output (I added line numbers in
I typed in everything. In line 2, I entered my username and then hit Enter. In line 3 I entered my password and hit Enter. Then nothing happened. Then I hit Enter again, and line 4 appeared. And that is now echoing back the password that I entered as the username in front of the |
Oh, and I get the same behavior that @tkelman mentioned, i.e. if I execute any simple julia command at the REPL first, things work:
There should still be a line-break before the |
Note that Python's |
cc @Keno on the terminal weirdness here. |
No the native version of Python is pretty much unusable in mintty, which we've generally been doing a much better job of. How hard can it be to not echo input back to the screen, do we need to do a ccall for that? |
Most of the sources I can find suggest that you use |
We can look at how pdcurses and cygwin's ncurses work. |
Maybe just pop up a text box? Windows does have that available as an API function if I remember correctly. |
(See also mintty/mintty#56) |
that might be better if we're prompting for interaction anyway |
Unfortunately I can't find the API function with text input. There's one with buttons, but unless we want the user to encode their password in ternary first that probably doesn't work. |
extremely awful. We fork stty.exe twice every time you hit a character at the repl to provide this. (the alternative is to build against cygwin1.dll and hope the user gets lucky with libc dll versioning + fork + rebase triple hell all matching against the buildbot) If GPL2 is OK for this, there's pinentry, https://www.gnupg.org/download/, implementing the Assuan protocol https://www.gnupg.org/documentation/manuals/assuan/index.html |
I don't think GPL is okay for this unless we make a separate wrapper program that we shell out to. winapi looks more promising. |
That's probably why it says to use the newer API when you're on Vista or newer? |
Some software (e.g. winpty) actually just creates a hidden console window for user input. |
I think any of these dialog boxes would be ok for now, i.e. fix this security bug. Long term it would be nicer if the password prompt was console based, but imo that could come after 0.5.0. |
I'm closing this, seems resolved. |
Yes, fixed by #17506. |
When I
Pkg.clone
a private repo on github using the https URL, I get a prompt that asks for the username, and then a prompt that asks for the password. When I type my password, I can see it in cleartext on the screen. Instead,*
should be shown on the screen for each character I type.I think this should get the labels
bug
and assigned to the 0.5.0 milestone because this is quite a no-no from a security point of view.@tkelman (Tony, feel free to stop me from CCing you on the things that I think should be assigned to 0.5.0, but I'm treating you as the release manager until I hear push back from you :)
The text was updated successfully, but these errors were encountered: