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

Merge PR 'Tie inbound channel requests to their OpenChannelRequest events' (#5742)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Tie inbound channel requests to their OpenChannelRequest events' (#5742)

from auto-pr-bot/bot/271-stale-openchannelrequest-after-p-7e4672 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5742
✓ 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 fixes a design weakness in how Lightning Dev Kit handles incoming channel requests. Previously, a malicious peer could cancel a channel request and reuse the same temporary ID for a new request. If a user (or automated bot) still had the old request open, they might accidentally approve the new, different channel while thinking they were approving the original one. The fix adds a unique counter to each request so that approvals can only match the exact request they were meant for.

Recommended action

Treat this as a security-hardening fix with API breakage. Downstream users must update all handlers of `Event::OpenChannelRequest` to capture `inbound_channel_request_counter` and pass it verbatim to the corresponding accept call. Review any automated channel-acceptance logic for stale-event race conditions. No emergency deployment is indicated unless the application automatically accepts inbound channels without user confirmation.

Security signals we found

01

TOCTOU-like stale-event acceptance prevented by binding event to request via unique counter

02

Peer can withdraw and re-use temporary_channel_id while old OpenChannelRequest event is still pending

03

New regression test `test_inbound_channel_request_counter_ties_accept_to_event` demonstrates the fix

04

Existing test `test_stale_inbound_request_does_not_replace_funded_channel` updated to use counter

05

API breaking change: accept_inbound_channel signatures gain an extra u64 parameter

Risk score

Why this scored 60/100

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