7z (on Linux) echoes password prompts
A free file archiver for extremely high compression
Brought to you by:
ipavlov
On Linux 7z echoes password prompts.
Expected behavior is to either hide the input completely or replace all characters with '*'.
Debian maintainer introduced a fix at: Fix available here: https://salsa.debian.org/debian/7zip/-/blob/master/debian/patches/0005-Disable-local-echo-display-when-in-input-passwords-C.patch
Instead of defining hundreds of macros like MY_DISABLE_ECHO_WIN32, MY_DISABLE_ECHO_UNIX, and what else, MY_DISABLE_ECHO_MACOS, , MY_DISABLE_ECHO_IOS, XOS, YOS... it should test system within `#ifdef MY_DISABLE_ECHO'
I'v experiences this today as well on MacOS.
When testing an 7z encrypted archive using
7zz t archive.7z
the tool asks for the password to decrypt the archive. While entering that password it echoes the entered password which makes it readable in cleartext. I think this should be prevented.I've created an encrypted archive using Keka on MacOS. I've installed 7zz (from the forumula sevenzip) via Homebrew on my Mac.
Installed version of
7zz
is:7-Zip (z) 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20 64-bit
.Running
7zz t your_encrypted_archive.7z
will ask you for the password. Enter it and you'll see your entered password in cleartext.Anybody reading logs of a script output using 7zz in this scenario would find the password in cleartext in the log file.
Output showing the issue
Expected behaviour
It should have not echoed my entered password. Not even stars because that would tell me something about the entered password's length.
How to reproduce
Create an encrypted 7z archive. I've used Keka on MacOS.
$ 7zz t your_encrypted_archive.7z
P7zip does that.
Wow, it still isn't fixed despite having a Debian maintainer's patch.
Same problem on macOS 14.5 (ARM).
Output showing problem:
Expected behavior: Password should not be echoed to the terminal; it should remain hidden.
Steps to reproduce: 7zz l encryptedfile.7z