You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bitcoind: custom RPC users' passwordHMAC is written to the world-readable Nix store #64
modules/bitcoind.nix writes bitcoin.conf with builtins.toFile (line 294). For each RPC user with passwordHMACFromFile = false, the file contains rpcauth=<name>:<salt>$<hmac> (line 334). The Nix store is world-readable. So every local user can read the salt and the HMAC of that RPC password.
With the salt and the HMAC, a local user can test password guesses offline. A strong random password is safe. A weak user-chosen password isn't.
The built-in users public, privileged and btcpayserver set passwordHMACFromFile = true (lines 371 to 374), so they aren't affected. The option passwordHMACFromFile defaults to false (line 141). So every custom RPC user is affected unless the operator knows this option.
Suggested fix
One of:
Default passwordHMACFromFile to true and make passwordHMAC an error when the file option is set. The secret then stays in secretsDir.
Keep the default but add a warning in the option description and in docs/configuration.md: "This value is written to the world-readable Nix store. Use passwordHMACFromFile for passwords that a person chose."
How found
LLM review (Kimi K3 max, GLM 5.3 max) flagged this. I verified it against the code. Severity: medium for weak passwords, low otherwise.
Activity
bitcoind: warn that a custom RPC user's passwordHMAC lands in the Nix…
bitcoind: warn that a custom RPC user's passwordHMAC lands in the Nix…
bitcoind: warn that a custom RPC user's passwordHMAC lands in the Nix…