AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 64 Bitcoin

Several improvements suggested by Loupe (#3348)

Public commit record

What the developer wrote

Authored by Bastien Teinturier

88/100 · Strong
Several improvements suggested by Loupe (#3348)

* Remove transport keys from DEBUG logs

While `DEBUG` logs shouldn't be activated on mainnet, it is dangerous
that they expose key material. We remove those logs.

* Remove onion shared secrets from unparsable failure logs

When receiving a failure that we couldn't parse, we added the shared
secrets in the logs to help us troubleshoot (because we've seen that
error frequently on our node). It didn't let us figure out the issue,
which most likely comes from a buggy intermediate or final node. We
now remove those secrets from the logs for safety.

* Make incoming connection tracker idempotent

If we receive multiple times a request to track a given node, we ignore
the redundant ones.

* More robust network DB clean-up on restart

On restart, we remove `channel_update`s that we cannot decode from our
network DB. The way the code was written could be an issue depending
on the postgres driver, because it potentially interleaved SELECT and
DELETE clauses. It apparently doesn't matter for our current version
of the postgres driver, but it's more future-proof to explicitly split
the SELECTs from the DELETEs.

* Check wake-up config before trying message wake-up

We didn't check the wake-up config parameter when relaying onion
messages, which wasted resources by creating actors that would be
useless.

* Include wallet node_id encoding when resolving blinded paths

When resolving the introduction point of a blinded path and checking
whether one of the nodes is ourselves, we must check that with all
potential encodings, including the wallet-reserved one.

* Don't include extraneous HTLCs in trampolinefee calculation

When relaying a trampoline payment, we must ensure that we don't include
extraneous payments (that are rejected), otherwise we will use a very
large route fee budget.

* Correctly clean up MPP payment-initiator state

When directly crafting MPP payments using the `sendtoroute` API, we
use the child payment ID as tracking key in the `PaymentInitiator`
internal state. If the payment fails, the `PaymentFailed` event will
correctly use that ID, so the state will be cleaned up. But if the
payment succeeds, the `PaymentSent` event uses the *parent* payment ID
so the state wasn't correctly cleaned up. We now clean up the child
state as well.

* Explicitly handle empty payment types

We've recently improved our liquidity ads codec, but we weren't
properly handling the case where no payment types are provided
(even though this will likely be rejected by remote nodes).
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit is a bundled maintenance patch for the Eclair Lightning node. It removes sensitive cryptographic keys and shared secrets from debug/error logs, fixes a bug where rejected payments could still be counted when calculating trampoline routing fees, prevents state leaks in manually crafted multi-part payments, makes incoming-connection tracking idempotent, avoids unnecessary peer wake-up attempts, handles an edge case in liquidity-ads encoding, separates database SELECT and DELETE operations for safety, and correctly recognizes wallet-encoded node IDs when resolving blinded payment paths. Several of these changes have clear security relevance, particularly the logging cleanup and the trampoline-fee fix, but they are defensive hardening and bug fixes rather than a single critical vulnerability.

Recommended action

Apply the patch and review node log retention policies to ensure any historical DEBUG logs containing the removed key material are purged. Operators should also monitor for any unexpected trampoline fee behavior and verify that manually routed MPP payments clean up state correctly after the fix.

Security signals we found

01

Sensitive key material removed from DEBUG logs (ChaCha20Poly1305)

02

Onion shared secrets removed from failure-packet logs (PaymentLifecycle)

03

Trampoline fee budget could be inflated by rejected/extraneous HTLCs before fix (NodeRelay)

04

PaymentInitiator state leak for manually crafted MPP payments before fix

05

Blinded path introduction-point check bypassed by wallet-encoded node ID before fix (BlindedPathsResolver)

06

Database cleanup interleaved SELECT/DELETE before fix (PgNetworkDb)

07

Redundant incoming connection tracking could cause unintended disconnections before fix (IncomingConnectionsTracker)

08

Unnecessary peer wake-up actors created when feature disabled before fix (MessageRelay)

Risk score

Why this scored 64/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 12/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.