Skip to content

[Crash/Fuzzing] IndexError during Attestation SSZ parsing (container empty) #931

@pventuzelo

Description

@pventuzelo

During fuzzing, I triggered an IndexError during parsing of Attestation ssz file with mainnet preset.

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

Reproducing

Download:
IndexError_attestation_empty_container_nimbus_devel.zip

branch: devel
commit: fe30b24abad112a6fed9a6d4d18df1978f2350f6

Load the file using ncli_hash_tree_root:

$ make

$ cd ncli

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

$ ./ncli_hash_tree_root --kind=attestation --file= IndexError_attestation_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/ncli/ncli_hash_tree_root2.nim(14) CLI
XXX/nim-beacon-chain/beacon_chain/ssz.nim(583) hash_tree_root
XXX/nim-beacon-chain/beacon_chain/ssz.nim(444) hashTreeRootImpl
XXX/nim-beacon-chain/beacon_chain/ssz.nim(570) hash_tree_root
XXX/nim-beacon-chain/beacon_chain/ssz.nim(466) bitlistHashTreeRoot
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system.nim(2515) X5BX5D
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/chcks.nim(23) raiseIndexError2
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/fatal.nim(51) sysFatal
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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions