Skip to content

trustedcoin: the plugin logs the public bitcoind RPC password at startup, so it ends up in the journal #191

Done

Description

@ostermayer

With services.clightning.plugins.trustedcoin.enable = true, the public bitcoind RPC password ends up in the journal.

modules/clightning.nix always writes bitcoin-rpcuser into the config and appends bitcoin-rpcpassword from the secret at every start (lines 136 and 197 on master 963bff8), whether or not bcli is the backend. Trustedcoin registers the same option names, reads them, and when both are set it logs them at startup, password included:

// nbd-wtf/trustedcoin v0.8.7, main.go:192 (same on master)
p.Logf("bitcoind RPC settings: {user: %s, password: %s, connect: %s, port: %s}", user, pass, hostname, port)

p.Logf goes to lightningd's log, which on a bitcoinix node is the journal. The operator account is in systemd-journal (modules/operator.nix:43), so the operator can read the public RPC password with journalctl -u clightning. So can anything that ships or mirrors the journal.

The public user has the trimmed whitelist, so this isn't admin access. It still turns a secret that setup-secrets guards with mode 0440 into log text, and secure-node doesn't promise the operator that credential.

Two ways to close it:

  1. Patch the log line in pkgs/trustedcoin to print password: <redacted>. One-line patch, no dependency change. I have it ready as a PR with the build checked on my KVM host.
  2. Send the same change upstream to nbd-wtf/trustedcoin so the patch can go away later.

I'd do both. Found by the review gate (Codex GPT-6 Astra, xhigh) on the tree of #190, and checked in the trustedcoin source and the two modules.

Activity

  1. ostermayer commented on Oct 31, 2026

    @ostermayer
    CollaboratorAuthor

    Sent the fix upstream: nbd-wtf/trustedcoin#43. #193 carries it as a patch until a release has it.

  2. prusnak commented on Oct 31, 2026

    @prusnak
    Contributor

    closed in favor of upstream PR nbd-wtf/trustedcoin#43

  3. seberm commented on Nov 9, 2026

    @seberm
    Contributor

    I think we should keep this one open until it's resolved upstream. The nbd-wtf/trustedcoin#43 is still open and 0.8.7 is still the latest release. Our master has no local patch, so the public RPC password still lands in the clightning journal.

  4. reopened this on Nov 9, 2026
  5. added
    status: blocked
    type: security
    area: packages
    on Nov 9, 2026
  6. sebsgent commented on Nov 30, 2026

    @sebsgent
    Contributor

    @ostermayer could you reopen #193, or open a new PR, with the trustedcoin patch? nbd-wtf/trustedcoin#43 has had no response from fiatjaf for over 3 weeks and 0.8.7 is still the latest release, so let's carry the fix in bitcoinix until it's released upstream. Please add a TODO comment next to the patch linking nbd-wtf/trustedcoin#43, so we drop it once a release includes it. Thanks!

    @prusnak since you closed #193 in favour of the upstream PR, are you OK with carrying the patch until then?

    Assisted-by: Claude Code (Claude Opus 5.5)

  7. prusnak commented on Nov 30, 2026

    @prusnak
    Contributor

    @prusnak since you closed #193 in favour of the upstream PR, are you OK with carrying the patch until then?

    reopened PR 193 as #362 because the original PR branch has been removed

  8. added this to the v0.2.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagesstatus: blockedtype: security

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions