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

VerifyLeafHashes can panic in the completeness check if proof.nodes are not namespaced #141

Closed
staheri14 opened this issue Mar 17, 2023 · 0 comments · Fixed by #179
Closed
Assignees
Labels
enhancement New feature or request

Comments

@staheri14
Copy link
Collaborator

Problem

Link to the completeness check: https://github.com/celestiaorg/nmt/blob/master/proof.go#L199
The proof.nodes length are not checked before extracting their namespace IDs. This may cause panic.

Acceptance Criteria

Call ValidateNode() on the proof.nodes at the beginning of the VerifyLeafHashes and make an early return if they are invalid.

@staheri14 staheri14 self-assigned this Mar 17, 2023
@staheri14 staheri14 added the enhancement New feature or request label Apr 18, 2023
staheri14 added a commit that referenced this issue Apr 19, 2023
… same namespace hash format (#179)

## Overview

Closes #141 

## Checklist
- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [x] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant