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

proposal: use pipe instead of cmdline arg to pass $otp_secret to oathtool #167

Open
flosnvjx opened this issue Aug 21, 2022 · 2 comments
Open

Comments

@flosnvjx
Copy link

flosnvjx commented Aug 21, 2022

In current implementation (otp.bash#L360) of pass-otp, when generating pincodes, the implementation use a command line argument to pass the $otp_secret to external binary oathtool.

The problem with this approach is, in strictly managed environment, things like audit log is usually enabled (e.g. enabled for exec* syscall, which is quite common in enterprise server/thin-client environment), arguments to invoke external binary may written to syslogd, which is possibly stored in unencrypted form in terms of on-disk sectors and sudoers (privileged sysadmins). The manual of oathtool(1) also point out this:

oathtool [OPTIONS]... [KEY [OTP]]...

...KEY and OTP is the string '-' to read from standard input

'@file' to read from indicated filename, or a hex encoded value (not recommended on multi-user systems).

This also applies to some consumer-level single user runtime, like Termux on Android (things like logcat may get uploaded to OS vendor. Note that Termux also have pass-otp packaged in their repository). It should have fairly no drawback if switched to pipe appoarch instead.

@guijan
Copy link

guijan commented Mar 26, 2023

Command line args are also visible via top, a program running under a different user could call the syscalls top uses to monitor other processes and watch for your key as a command line arg.

pabs3 added a commit to pabs3/pass-otp that referenced this issue May 12, 2023
Check if the oathtool version supports this first and prefer
the safe oathtool version to the always unsafe otptool.

Fixes: tadfisher#167
@pabs3
Copy link

pabs3 commented May 12, 2023

I sent a fix for this issue in pull request #182.

pabs3 added a commit to pabs3/pass-otp that referenced this issue Jan 6, 2024
Check if the oathtool version supports this first.

Fixes: tadfisher#167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants