-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rollapp ibc state validation upon state update #641
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #641 +/- ##
==========================================
+ Coverage 29.87% 30.50% +0.63%
==========================================
Files 225 226 +1
Lines 31861 31984 +123
==========================================
+ Hits 9517 9756 +239
+ Misses 20855 20669 -186
- Partials 1489 1559 +70 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you fix what I wrote the tests don't pass
|
@mtsitrin is correct. better running it per UpdateState. |
f6709d1
to
74c085d
Compare
added right issue number in the description |
0fe8389
to
63ec364
Compare
Description
The objective of this PR is to prevent potential vector attacks that utilises other cosmos chains with the same chain id of an existing rollappid to enable malicious ibc-transfers to other chains that are not the rollapp itself.
For that, we need to prevent that any ibc-transfer can use the chain id of an existing rollapp, without coming from the real rollapp, authenticating the rollapp id. In the following we list 3 potential solutions:
Solution 1: Reject channels creation with same id of rollapp id
Main drawback: it is not possible to prevent channel creations with the chain id equal to a rollappid, that is not yet registered in the hub, but it can be known beforehand by an attacker.
Solution 2: Reject light clients update for a channel with a rollapp id equal to a registered rollapp id, when it does not come from the registered sequencer after the rollapp is created. By doing that, ibc will fail to accept packets from a channel that does not match rollapp sequencer info.
Main drawback: Headers received from an attacker channel until the first state info update from the valid rollapp sequencer, will be accepted as valid, being a vulnerability.
Solution 3: Checking the next validator hash in light client headers for the channel, corresponds to the same next validator hash created with a single validator, which is the sequencer registered for the rollapp in the state info.
Main drawback: The solution requires authenticating the rollapp id per ibc packet.
In this PR the solution 3 has been implemented, since even though is not the most efficient, it does not have the vulnerability issues of the first two.
Note that this is a short-term solution built with the assumptions of having a single honest sequencer for a rollapp.
Closes #643
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
PR review checkboxes:
I have...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
----;
For Reviewer:
---;
After reviewer approval: