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

Validator node hashing does not use domain separation #5205

Closed
AaronFeickert opened this issue Feb 24, 2023 · 0 comments · Fixed by #5207
Closed

Validator node hashing does not use domain separation #5205

AaronFeickert opened this issue Feb 24, 2023 · 0 comments · Fixed by #5207

Comments

@AaronFeickert
Copy link
Collaborator

AaronFeickert commented Feb 24, 2023

Validator node public keys and shard identifiers are hashed for the purpose of computing the root of a Merkle mountain range (soon to be replaced with a balanced binary hash tree). However, the hasher uses raw Blake256 with concatenation instead of a safer domain-separated hasher.

Because both the Merkle mountain range and (proposed) balanced binary hash tree implementations are generically vulnerable to second-preimage attacks, they must rely on application-specific data context or caller-provided domain separated for mitigation.

It would be safer (and good practice) to use domain separation for computation of leaf node hashes computed from validator node data.

stringhandler pushed a commit that referenced this issue Feb 28, 2023
Description
---
Uses the consensus hashing API to construct the hasher used to pre-hash validator node data for Merkle roots. Updates a test.

Closes [issue 5205](#5205).

Motivation and Context
---
The hasher currently used to pre-hash validator node keys and shard identifiers does not use domain separation or the consensus hashing API. This PR updates the hasher construction using the API.

How Has This Been Tested?
---
Existing tests pass.

BREAKING CHANGE: Renders existing validator node Merkle roots invalid.
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 a pull request may close this issue.

1 participant