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

Merge PR 'Refuse to persist fresh monitors that alias archived monitors' (#5645)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Refuse to persist fresh monitors that alias archived monitors' (#5645)

from bot/5631-prevent-monitors-from-aliasing-w-ff2601 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5645
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 change prevents a Lightning node from accidentally overwriting an archived copy of a channel's security monitor with a brand-new one that happens to use the same identifier. In the old code, if a new channel reused the same identifier as a previously closed and archived channel, the new monitor could be saved on top of the archived one. Later, when the new channel closed, its archived copy would overwrite the old archived copy, permanently destroying the historical record needed to detect cheating or recover funds. The fix makes the node refuse to save a new monitor when an archived one already exists under the same key, leaving the new channel 'stuck' instead of silently destroying data. This is a safety improvement rather than a remote-exploitable bug.

Recommended action

Treat this as a defensive hardening commit. Users running nodes should upgrade to ensure archived channel monitors are protected from accidental overwrite. Operators encountering the new log error should investigate why a new channel is reusing a funding outpoint that already has an archived monitor and resolve the key collision before the channel can make progress.

Security signals we found

01

Data-loss prevention: stops archived ChannelMonitor from being overwritten by a later channel with the same key

02

Safety guard added to both sync and async persistence paths

03

Persistence refusal surfaces as InProgress/UnrecoverableError rather than silent overwrite

04

Tests added to enforce the new refusal behavior

05

No cryptographic or network-level exploit vector; risk is state-corruption/data-loss

Risk score

Why this scored 54/100

Our methodology →
Potential impact 18/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 9/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.