Repository navigation
fix injected consignment crash - #191
Merged
Merged
Conversation
A peer can crash a counterparty, then keep it crashing on every restart, by opening an ordinary, uncolored channel and separately sending a garbage consignment tagged with that channel's funding txid. Co-Authored-By: Claude
…red channel A peer that also opens a colored channel to the victim and never funds it can send files for the funding txid of its vanilla channel: files name their own txid, so only ChannelPending learns which channel they are for.
The acceptor's ChannelPending handler loaded `consignment_{funding_txid}`
whenever the file existed, but only `handle_funding` validates it, and that
runs for colored channels only. A peer could open a vanilla channel, send
junk tagged with its funding txid and make the node panic, again on every
restart. Gate the load on the channel being colored, and discard whatever
was staged for a vanilla one.
Any peer with a channel could send files, so one with only vanilla channels could still have junk buffered and written to disk. Each chunk now names the temporary ID of the channel it is for, and is accepted only for an inbound colored channel the sender is still funding, one funding's worth per channel. Files staged for a channel that is gone without funding are freed when it closes, or as soon as the peer starts sending another funding, since LDK drops a channel whose funding_created it rejects before ChannelClosed is handled. So a retry after a failed open, or the peer's other colored channel, doesn't wait for the sweep. This narrows who can stage files but doesn't replace the ChannelPending check: files name their own funding txid, so a peer with an unfunded colored channel can still send them for a vanilla funding. Also count pending fundings per peer, so peers reusing a funding txid no longer share a single node-wide slot. Bumps rust-lightning for `ChannelDetails::is_colored`.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #191 +/- ##
==========================================
+ Coverage 87.75% 88.19% +0.44%
==========================================
Files 16 16
Lines 8476 8838 +362
==========================================
+ Hits 7438 7795 +357
- Misses 1038 1043 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes bug shown in #176