Add test for push_asset_amount underflow DoS on funding acceptor - #138
Conversation
zoedberg
left a comment
There was a problem hiding this comment.
Thank you! I requested some changes, also this branch has conflicts that must be resolved. Finally please do not commit the updated submodule pointer, I first would like to see the CI fail, then I'll push your fix on the upstream remote so you will be able to change the pointer without any change to the .gitmodules file
|
Addressed all review points: CI should now fail on the new test, ready for you to push the LDK fix upstream. |
|
@0xaudron the CI cannot run because the branch has still conflicts that must be resolved. You should rebase this on top of the latest master tip. Please before the rebase also squash the commits into a single one |
d4a1065 to
6be3835
Compare
|
@zoedberg can you check it now ? |
|
LGTM, I'm waiting for your rebase in RGB-Tools/rust-lightning#33 , after that I'll push the branch on the public repo so you can add a commit here that updates the submodule pointer |
|
done @zoedberg |
|
@0xaudron I pushed the branch, you can now add a commit here that updates the submodule pointer |
|
@0xaudron I will add the commit myself, so we can then proceed to merging this |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #138 +/- ##
==========================================
- Coverage 87.78% 87.77% -0.01%
==========================================
Files 13 13
Lines 7613 7617 +4
==========================================
+ Hits 6683 6686 +3
- Misses 930 931 +1
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:
|
The acceptor computed remote_rgb_amount = channel_rgb_amount - push_amount without checking push_amount <= channel_rgb_amount, so a counterparty sending a larger value underflowed it (release builds have overflow checks off), aborting RGB coloring and panicking the acceptor's event handler.
The REST layer clamps push_asset_amount, so reaching this needs a modified wire client; FORCE_WIRE_PUSH_ASSET_AMOUNT_ON_NODE models that by making the initiator emit an out-of-range value on the wire. The test asserts the acceptor rejects the funding and stays responsive.
Bumps rust-lightning to the commit rejecting out-of-range push_asset_amount in handle_funding.