4 ms·
Not to disagree, but could you provide some references to the statement?
by SSLy 9y ago
Not to disagree, but could you provide some references to the statement?
- alister 9y ago>> It's been known for decades on other Unix systems that you shouldn't pass passwords by command line parameter > could you provide some references to the statement? If you search the Usenet archives, you can find many discussions about this. It's one of those topics that came up frequently in the comp.unix newsgroup as early as 1991 that I see in some messages. Usenet discussion from 1994: "ps e gets you a processes environment. It is totally unsafe to store anything that should be secret. if there needs to be secret data, the best way to get it is with scanf(), once the program is running."[1] And here is the Secure UNIX Programming FAQ from 1999: "A security hole related to FreeBSD's 'ps' utility. The utility would allow users to view another process' environment variables. Consequently applications like pppd that accepted passwords via environment variables became vulnerable to unauthorized release of privileged information attacks. In fact, thehole was not related to 'ps' if you think about it critically. The application that places privileged information in the environment variable is at fault."[2] [1]https://groups.google.com/forum/m/#!search/ https://groups.google.com/forum/m/#!search/ then search for "ps shows command line parameters" (for the exact message, search for "ps e gets you a processes environment") [2]http://faqs.cs.uu.nl/na-dir/unix-faq/programmer/secure-programming.html http://faqs.cs.uu.nl/na-dir/unix-faq/programmer/secure-progr...
- tinus_hn 9y agoIf you run the ps command you can see all processes with all the command line arguments. They’re not secret, which is why you shouldn’t put passwords there. Now typically these processes only run for a short time so it’s difficult to catch passwords manually but it’s predictable so a script can.
- your-nanny 9y agoSo what is the proper way?
- tinus_hn 9y agoEither store them in environment variables or pass them through file descriptors, such as standard input. Note that you do need to take care to clean up the environment if you create new, unprivileged subprocesses or these secrets may leak.
- your-nanny 9y agoThanks.
- deleted 9y ago[deleted]