-
Notifications
You must be signed in to change notification settings - Fork 912
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
Avoid leaking bitcoin auth secrets to other users #3984
Comments
We could also directly use |
I think connecting to As a simpler workaround maybe this option of
|
The workaround idea by @vasild seems good. Possibly another eventual thing to do would be to move the backend from using the RPC interface to using the P2P interface. |
Would it be possible to prioritize this? The various suggestions in this thread all seem fine to me. |
Please don't break the use of the cookie file for those of us who prefer to use that (more secure) method of authentication. That's already immune to leaky process arguments so long as only authorized users can read the cookie file. |
@whitslack how does cookie file authentication work with c-lightning? I can't find any mention of this in the lightningd-config manpage. |
@jonasnick: Just don't specify |
@whitslack Thank you, I remember. That is not a general solution unfortunately, because cookie authentication prevents using bitcoind's RPC whitelisting capabilities. In nix-bitcoin for example, clightning authenticates to bitcoind as an RPC user that only has access to public RPCs. |
@jonasnick: You prompted me to read a little bit about NixOS. Does it really not use PID namespaces to isolate processes owned by different users, given that unprivileged users are allowed to use the package manager to install packages for their own use? In other words, I'm surprised that snooping on |
@whitslack sorry but that seems a bit too off topic for this thread. Feel free to contact me at [email protected] or join #nix-bitcoin on liberachat. |
Hello everyone, |
On Linux, running
ps -e -o args
frequently enough will eventually show the bitcoin-cli child process spawned by c-lightning including the RPC authentication arguments. The issue is that by default any user on the system can get the authentication secrets doing that - not just the user the c-lightning and bitcoin-cli processes run as.I can reliable reproduce this with a fresh c-lightning datadir,
--network main
and running the following script under a different user:This problem can be mitigated by mounting
/proc
with thehidepid
option. However, process arguments seem to be generally not considered secret. For example, even withhidepid
if you run lightningd as a systemd service, other users can see the arguments of bitcoin-cli throughsystemctl status
(H/T @nixbitcoin, see systemd/systemd#16825).A naive idea for how c-lightning could prevent this is if it created a temporary config file for bitcoin-cli with the authentication secrets and provides the file via the
--config
argument.The text was updated successfully, but these errors were encountered: