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

[Crash/Fuzzing] IndexError during Beaconstate SSZ parsing (container empty) #896

Closed
pventuzelo opened this issue Apr 16, 2020 · 3 comments
Closed

Comments

@pventuzelo
Copy link

@pventuzelo pventuzelo commented Apr 16, 2020

During fuzzing with beacon-fuzz, I triggered an IndexError during parsing of Beaconstate ssz file with mainnet preset.

Error:
Error: unhandled exception: index out of bounds, the container is empty [IndexError]

Reproducing

Download:
indexError_beaconstate_empty_container_nimbus_devel.zip

branch: devel
commit: 7b8d6ea61c46ceb0edce1418a38275d7859f1334

Load the file using ncli_pretty:

$ make

$ cd ncli

$ ../env.sh nim c -d:const_preset=mainnet ncli_pretty

$ ./ncli_pretty --kind=state --file= indexError_beaconstate_empty_container_nimbus_devel.ssz 
Traceback (most recent call last, using override)
XXX/nim-beacon-chain/vendor/nim-confutils/confutils.nim(981) confutils
XXX/nim-beacon-chain/vendor/nim-faststreams/faststreams/input_stream.nim(68) CLI
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(418) nimLeaveFinally
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(407) reportUnhandledError
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(358) reportUnhandledErrorAux
Error: unhandled exception: index out of bounds, the container is empty [IndexError]
@tersec
Copy link
Contributor

@tersec tersec commented Apr 16, 2020

I can confirm I see the same error/result.

@tersec
Copy link
Contributor

@tersec tersec commented Apr 16, 2020

For reference, zcli:

$ zcli_mainnet pretty state indexError_beaconstate_empty_container_nimbus_devel.ssz 
cannot load input
cannot decode ssz: expected to be at 0 bytes, but currently at 2687377

@zah
Copy link
Member

@zah zah commented Apr 17, 2020

Fixed by #898

@zah zah closed this as completed Apr 17, 2020
@pventuzelo pventuzelo changed the title [Crash/Fuzzing] IndexError during Beaconstate SSZ parsing [Crash/Fuzzing] IndexError during Beaconstate SSZ parsing (container empty) Apr 22, 2020
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

No branches or pull requests

3 participants