-
Notifications
You must be signed in to change notification settings - Fork 61
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
x/interchainstaking: Keeper.UpdateWithdrawalRecordsForSlash should validate that each Distribution.Valoper's amount is positive before additions otherwise an overflow can trigger wrong results #607
Comments
I see this code is updated |
joe-bowman
pushed a commit
that referenced
this issue
Nov 18, 2023
1 task
joe-bowman
pushed a commit
that referenced
this issue
Dec 4, 2023
faddat
pushed a commit
that referenced
this issue
Dec 10, 2023
* fix: defensive checks in UpdateWithdrawalRecordsForSlash; add tests; fixes #607 * remove debug lines * lint
joe-bowman
pushed a commit
that referenced
this issue
Dec 19, 2023
joe-bowman
pushed a commit
that referenced
this issue
Dec 21, 2023
joe-bowman
pushed a commit
that referenced
this issue
Dec 27, 2023
joe-bowman
pushed a commit
that referenced
this issue
Dec 27, 2023
* add improved supply queries * make supply endpoint config * fix: improve performance of lsm share token validation; fixes #787 * fix: defensive checks in UpdateWithdrawalRecordsForSlash; add tests; fixes #607 * lint * lint * bump depdendencies; remove hanging reference to lsm types * fixes * tools: use xbuild for release builds * tools: bump go/alpine * tools: makefile build tags * tools: bump hermes to v1.7.4 * fix: further lint fixes * fix error response on no validator found * upgrade: add v1.4.5-rc2 upgrade handler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary of Bug
This code
quicksilver/x/interchainstaking/keeper/keeper.go
Lines 362 to 363 in bbf9ef9
sdk.NewInt(int64(d.Amount))
then performs operations on it assuming the result will always be positive! Same as inquicksilver/x/interchainstaking/keeper/keeper.go
Line 369 in bbf9ef9
Firstly let's note that
WithdrawalRecord.Distribution[].Amount
is a uint64 perquicksilver/proto/quicksilver/interchainstaking/v1/interchainstaking.proto
Line 86 in c26b22e
If someone wanted to control how much money was to be withdrawn they could intercept traffic or maliciously set a large to be sent into amount that's larger than int64 (given .Amount is a uint64) and that would cause a negative value which could then when subtracted from record.Amount cause a large value or any value of the attacker's choosing
Suggestion
then also for
quicksilver/x/interchainstaking/keeper/keeper.go
Line 369 in bbf9ef9
Version
13bf586
/cc @elias-orijtech
For Admin Use
The text was updated successfully, but these errors were encountered: