Skip to content
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

chore: backport proof fix #582

Merged
merged 3 commits into from
Oct 8, 2022
Merged

chore: backport proof fix #582

merged 3 commits into from
Oct 8, 2022

Conversation

tac0turtle
Copy link
Member

No description provided.

tac0turtle and others added 2 commits October 8, 2022 23:34
* convert poc to test

* cleanup

* cleanup

* error on both left and right being set

* address comments

Co-authored-by: Marko Baricevic <markobaricevic3778@gmail.com>
@tac0turtle tac0turtle marked this pull request as ready for review October 8, 2022 21:36
@tac0turtle tac0turtle requested a review from a team as a code owner October 8, 2022 21:36
@tac0turtle tac0turtle changed the title chore: bckport proof fix chore: backport proof fix Oct 8, 2022
@tac0turtle tac0turtle merged commit 7f698ba into release/v0.19.x Oct 8, 2022
@tac0turtle tac0turtle deleted the backport-proof branch October 8, 2022 22:14
grepsuzette added a commit to grepsuzette/gno that referenced this pull request Mar 10, 2023
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.
grepsuzette added a commit to grepsuzette/gno that referenced this pull request Mar 10, 2023
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
grepsuzette added a commit to grepsuzette/gno that referenced this pull request Apr 10, 2023
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
grepsuzette added a commit to grepsuzette/gno that referenced this pull request Apr 10, 2023
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.
moul added a commit to gnolang/gno that referenced this pull request Sep 22, 2023
This is a fix for the 2022-10-07 Binance vuln demonstrated in #583.

**Original fix** was simply (cosmos/iavl#582):

```
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 the vuln, for comments and archival:

* https://twitter.com/buchmanster/status/1578879225574350848
*
https://medium.com/@Beosin_com/how-did-the-bnb-chain-exploiter-pass-iavl-proof-verification-an-in-depth-analysis-by-beosin-c925b77bc13e

---------

Co-authored-by: grepsuzette <grepsuzette@users.noreply.github.com>
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
gfanton pushed a commit to gfanton/gno that referenced this pull request Nov 9, 2023
This is a fix for the 2022-10-07 Binance vuln demonstrated in gnolang#583.

**Original fix** was simply (cosmos/iavl#582):

```
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 the vuln, for comments and archival:

* https://twitter.com/buchmanster/status/1578879225574350848
*
https://medium.com/@Beosin_com/how-did-the-bnb-chain-exploiter-pass-iavl-proof-verification-an-in-depth-analysis-by-beosin-c925b77bc13e

---------

Co-authored-by: grepsuzette <grepsuzette@users.noreply.github.com>
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
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.

2 participants