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

Merge PR 'Fix HTLC loss when a closed channel's ID is reused in open_channel' (#5562)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Fix HTLC loss when a closed channel's ID is reused in open_channel' (#5562)

from auto-pr-bot/bot/254-peer-can-steal-forwarded-htlcs-b-d76f84 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5562
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This patch fixes a bug in the Lightning Dev Kit where a forwarded payment (HTLC) could be permanently lost if a new channel reused the same temporary ID as a recently closed channel. Previously, the code could look up the new, unfunded channel instead of the closed one, skip writing the payment secret (preimage) to the closed channel's on-chain safety copy (ChannelMonitor), and let the payment expire unclaimed. The fix both rejects incoming channel open attempts that reuse such an ID and ensures claims still reach the correct closed channel's monitor even if an unfunded channel exists under the same ID.

Recommended action

Upgrade to a release containing this commit. Nodes forwarding payments are at risk of losing HTLCs if a peer can induce channel ID reuse and force-close timing. No runtime workaround is described.

Security signals we found

01

Loss of forwarded HTLC preimage persistence

02

Temporary channel ID reuse collision

03

Closed ChannelMonitor update path bypass

04

Unfunded channel shadowing closed channel state

05

Payment forwarding event blocked or delayed

Risk score

Why this scored 76/100

Our methodology →
Potential impact 25/30
Exploitability 15/25
Stealth signal 12/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/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.