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
btcpayserver: BTCPay can read NBXplorer's bitcoind RPC password because the secret and the API cookie share a group #128
modules/btcpayserver.nix puts the btcpayserver user in the nbxplorer group so that BTCPay can read NBXplorer's API cookie (btcexplorercookiefile=${nbxplorer.dataDir}/<network>/.cookie, with the data dir at 0770 nbxplorer:nbxplorer), but the same module gives the bitcoind RPC secret for NBXplorer to that group too:
The secrets module installs it 0440, so BTCPay can read the bitcoind RPC password of the btcpayserver RPC user. BTCPay never talks to bitcoind, it talks to NBXplorer, and the password is in its reach only because the cookie and the password share a group.
What that user can do is the public whitelist plus getblockfrompeer (the whitelist is cfg.bitcoind.rpc.users.public.rpcwhitelist ++ [ "getblockfrompeer" ]). The public list includes sendrawtransaction, getrawmempool, getpeerinfo and getnodeaddresses, so a compromised BTCPay gets direct access to bitcoind's P2P view and mempool, and to any method a later change adds to the public list or to this user. It also makes the web app the second holder of a credential that the whitelist comment in bitcoind-rpc-public-whitelist.nix treats as per consumer. BTCPay already carries a history of authentication bypasses (2.4.2 in August 2026 drained Lightning nodes through stolen credentials), so each credential it can read is one more thing to rotate after an incident.
Fix: separate the two files' groups. Either create a group for the NBXplorer cookie (nbxplorer-api), add btcpayserver to that one and keep bitcoin-rpcpassword-btcpayserver on NBXplorer's primary group, or keep the group and set the secret's group to cfg.nbxplorer.user (the primary group, which only NBXplorer has) while the cookie dir keeps the shared group. The .cookie file is written by NBXplorer at start, so its mode comes from NBXplorer's umask, and it's worth checking that it stays group readable after the change. The btcpayserver test covers the connection.
I can send that PR with the default and regtest scenario runs if you want it.
Found by DeepSeek V4.1 Flash 1017 at max thinking in the review of #73's tree. GPT-6 Astra, run at xhigh reasoning as the second opinion, confirmed it and rated it medium, and I checked it against master 4452d89.
Activity
lnd: turn off Multipath TCP in the lnd listeners (#187)
btcpayserver: make NBXplorer's RPC password readable only by NBXplorer
btcpayserver: make NBXplorer's RPC password readable only by NBXplorer
btcpayserver: make NBXplorer's RPC password readable only by NBXplorer (