Skip to content

Improve defenses against malicious bitcoin RPC endpoint - #3343

Open
t-bast wants to merge 7 commits into
masterfrom
improve-bitcoin-rpc-client
Open

Improve defenses against malicious bitcoin RPC endpoint#3343
t-bast wants to merge 7 commits into
masterfrom
improve-bitcoin-rpc-client

Conversation

@t-bast

@t-bast t-bast commented Aug 11, 2026

Copy link
Copy Markdown
Member

This PR contains three independent commits that improve security in case the bitcoin RPC endpoint is malicious. Note that this isn't foolproof: a fully compromised Bitcoin Core client is hard to protect against, and eclair isn't yet fully secure if that happens. But we're taking steps towards that goal with incremental improvements.

Reported by AI scanning from @Rob1Ham 🙏

t-bast added 3 commits August 11, 2026 11:36
When using Bitcoin Core RPC, we now validate that the returned
transaction matches the request. This is part of a defense-in-depth
strategy in case our batching client messes up the order of RPC
responses.
We previously only relied on the order of requests to match responses
that we receive from bitcoind, but there is no guarantee that the order
will be preserved. In practice it seems to be the case, but we should
be resilient if that changes.

We now use unique request IDs and match the corresponding response using
this ID instead of relying on position only.
We verify that the amount contributed by our Bitcoin Core wallet matches
what we requested. A malicious Bitcoin Core may underfund or overfund,
which in both cases is undesirable behavior.
@t-bast
t-bast requested a review from sstone August 11, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants