Skip to content

Reject outbound channels if the total reserve is larger than funding - #1463

Merged
valentinewallace merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2022-05-lol-more-underflow
May 5, 2022
Merged

valentinewallace merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2022-05-lol-more-underflow

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

In 2826af7 we fixed a fuzz crash
in which the total reserve values in a channel were greater than
the funding amount, checked when an incoming channel is accepted.

This, however, did not fix the same issue for outbound channels,
where a peer can accept a channel with a nonsense reserve value in
the accept_channel message. The full_stack_target fuzzer
eventually found its way into the same issue, which this resolves.

Thanks (again) to Chaincode Labs for providing the fuzzing
resources which found this bug!

In 2826af7 we fixed a fuzz crash
in which the total reserve values in a channel were greater than
the funding amount, checked when an incoming channel is accepted.

This, however, did not fix the same issue for outbound channels,
where a peer can accept a channel with a nonsense reserve value in
the `accept_channel` message. The `full_stack_target` fuzzer
eventually found its way into the same issue, which this resolves.

Thanks (again) to Chaincode Labs for providing the fuzzing
resources which found this bug!
@TheBlueMatt TheBlueMatt added this to the 0.0.107 milestone May 2, 2022

@dunxen dunxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f2de2f3

Another one for the fuzz trophy cabinet 🏆

@dunxen

dunxen commented May 3, 2022

Copy link
Copy Markdown
Contributor

Would some docs like in L814 need to be changed to make clear the even lower upper bound for the reserve?

@vincenzopalazzo vincenzopalazzo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Would some docs like in L814 need to be changed to make clear the even lower upper bound for the reserve?

I think the issue here is more that the fuzzer is opening channels with the full value of the channel as reserve, or close to it, less that our reserve value is higher than it should be.

@valentinewallace
valentinewallace merged commit d96a492 into lightningdevkit:main May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants