Repository navigation
bitcoind: warn that a custom RPC user's passwordHMAC lands in the Nix store - #266
Conversation
viberaven
left a comment
There was a problem hiding this comment.
Reviewed dcb634b393d1.
No actionable findings. The new warning matches the implementation: custom passwordHMAC values are interpolated into the store-backed configuration, while the built-in users load their HMACs from secret files at runtime. The example correctly limits RPC methods and warns about offline guessing and old store generations. Documentation-only behavior; the mdBook build passes.
Review performed with Codex (GPT-6 Astra).
|
LGTM, no must- or should-fix items. Checked against Needs a rebase: Assisted-by: Claude Code (Claude Opus 5.5) |
dcb634b to
85e625d
Compare
… store bitcoin.conf is built with builtins.toFile, so the rpcauth line of every custom RPC user ends up in the world-readable Nix store. Any local user can read the salt and HMAC and test password guesses offline. The option description didn't say so, and the docs didn't cover custom RPC users. Say it in the passwordHMAC description, and add a short custom RPC user example to the LAN RPC section of docs/configuration.md. Both advise a long random password, like the one rpcauth.py generates. The docs also cover rpcauth lines in extraConfig, which land in the store too, and say to change a weak password, because the old HMAC stays in the store until it is garbage-collected. A release note points existing users to that section. Fixes bitcoinix#64. Assisted-by: Claude Code (Claude Opus 5.5)
85e625d to
4eedfd8
Compare
Fixes #64.
bitcoin.confis built withbuiltins.toFile. So therpcauth=<name>:<salt>$<hmac>line of every custom RPC user inservices.bitcoind.rpc.usersends up in the world-readable Nix store. Any local user can read the salt and HMAC and test password guesses offline. A long random password is safe. A weak one isn't. ThepasswordHMACdescription didn't say so, and the docs didn't cover custom RPC users at all.This PR documents the risk. It doesn't change behavior.
passwordHMACdescription now says that the value goes to the Nix store, and advises a long random password, like the one that Bitcoin Core'sshare/rpcauth/rpcauth.pygenerates when you don't pass a password.docs/configuration.mdgets a short custom RPC user example with the same warning. It also coversrpcauthlines inextraConfig, which land in the store too. And it says to change a weak password, because the old HMAC stays in the store until it is garbage-collected.The built-in users
privileged,publicandbtcpayserverread their HMAC from the secrets dir, so they aren't affected.Keeping a custom user's HMAC out of the store is possible, with a public
passwordHMACFromFilethat declares abitcoin-HMAC-<name>secret. But that's a new feature: secret generation doesn't create the file, and the docs need steps to provide it. I left it for a follow-up.Testing
nix eval .#ciTestInfo: passnix build .#checks.x86_64-linux.module-config: passnix build .#checks.x86_64-linux.test-runner: passmdbook build: pass. The new text renders, and the release note link resolves to theallow-bitcoind-rpc-connections-from-lanheading.passwordHMACdescription shows the new text.No VM test, because nothing changes at runtime.
module-config,test-runner,ci-workflowsand the mdBook build pass on the KVM host.Models
Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224.