-
Notifications
You must be signed in to change notification settings - Fork 374
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
fix: fix vuln demonstrated by #583 #584
Merged
Merged
Commits on Apr 10, 2023
-
fix vuln demonstrated by gnolang#583
Original fix at cosmos/iavl#582, is simply: ``` if len(pin.Left) > 0 && len(pin.Right) > 0 { return nil, errors.New("both left and right child hashes are set") } ``` Our iavl functions however don't return errors. Proposing to use `panic()` instead, as it does in other parts of this file. More about this 2022-10-07 vuln: https://medium.com/@Beosin_com/how-did-the-bnb-chain-exploiter-pass-iavl-proof-verification-an-in-depth-analysis-by-beosin-c925b77bc13e https://twitter.com/buchmanster/status/1578879225574350848
Configuration menu - View commit details
-
Copy full SHA for d7bcd68 - Browse repository at this point
Copy the full SHA d7bcd68View commit details -
import original iavl proof_forgery_test.go 2022-10-08
Won't compile yet. Is a test of the iavl proof forgery as exploited during BSC 2022-10-07 hack. Notes: 1. proof_forgery_test.go comes from cosmos/iavl#582 2. gist showing the same vuln at https://gist.github.com/samczsun/8635f49fac0ec66a5a61080835cae3db The test is not going to compile as is, it needs some work.
Configuration menu - View commit details
-
Copy full SHA for 2074287 - Browse repository at this point
Copy the full SHA 2074287View commit details -
proof_forgery_test.go compiles, and fails the test as expected (-> vu…
…lnerable) output follows --- FAIL: TestProofForgery (0.00s) proof_forgery_test.go:69: Error Trace: /home/bob/opt/src/COINS/Cosmos/GNO/gno/pkgs/iavl/proof_forgery_test.go:69 Error: Should be empty, but was [73 209 82 89 222 179 131 99 170 27 180 58 80 20 211 (...) 94 7 254 45 183 20 244] Test: TestProofForgery Messages: roothash must be empty if both left and right are set FAIL FAIL command-line-arguments 0.003s FAIL
Configuration menu - View commit details
-
Copy full SHA for fc32b17 - Browse repository at this point
Copy the full SHA fc32b17View commit details -
Test now passes whenever gnolang#583 is applied
and fails otherwise (fails when vuln not fixed) It should now be ok for review.
Configuration menu - View commit details
-
Copy full SHA for 81cac3b - Browse repository at this point
Copy the full SHA 81cac3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for f65e6ce - Browse repository at this point
Copy the full SHA f65e6ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e835d6 - Browse repository at this point
Copy the full SHA 7e835d6View commit details
Commits on Jun 1, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e4a0544 - Browse repository at this point
Copy the full SHA e4a0544View commit details
Commits on Sep 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for f4766e5 - Browse repository at this point
Copy the full SHA f4766e5View commit details
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.