Skip to content

Conversation

nategraf
Copy link
Contributor

@nategraf nategraf commented Mar 31, 2025

On main the RiscZeroSetVerifier.verifyIntegrity function will accept internal nodes in the Merkle tree, and complete with reverting. This is not an intended use of this interface, and is a violation of the calling requirements as the passed hash is not the digest of a claim (this is similar to running ECDSA's verify operation on an unhashed message). However, this is misuse that can be mitigated by following the best practice of tagging Merkle tree leaves.

This PR makes the aggregation set verifier more misuse resistant by tagging and hashing the leaves of the tree.

Additionally, the documentation on IRiscZeroVerifier.verifyIntegrity is updated to highlight the importance of the caller hashing the claim digest and to be more precise about the guarantees provided.

Resolves: #525
Resolves: WEB3-397

@nategraf nategraf requested a review from a team as a code owner March 31, 2025 20:21
@github-actions github-actions bot changed the title Use tagged leaf hashing in aggregation set to improve missue resistance WEB3-398: Use tagged leaf hashing in aggregation set to improve missue resistance Mar 31, 2025
Copy link

linear bot commented Mar 31, 2025

@nategraf nategraf merged commit cb8fd75 into main Apr 1, 2025
11 checks passed
@nategraf nategraf deleted the victor/aggregation-hash-leaves branch April 1, 2025 16:24
capossele pushed a commit that referenced this pull request Apr 1, 2025
…e resistance (#526)

On `main` the `RiscZeroSetVerifier.verifyIntegrity` function will accept
internal nodes in the Merkle tree, and complete with reverting. This is
not an intended use of this interface, and is a violation of the calling
requirements as the passed hash is not the digest of a claim (this is
similar to running ECDSA's verify operation on an unhashed message).
However, this is misuse that can be mitigated by following the best
practice of tagging Merkle tree leaves.

This PR makes the aggregation set verifier more misuse resistant by
tagging and hashing the leaves of the tree.

Additionally, the documentation on `IRiscZeroVerifier.verifyIntegrity`
is updated to highlight the importance of the caller hashing the claim
digest and to be more precise about the guarantees provided.

Resolves: #525
Resolves: WEB3-397
capossele added a commit that referenced this pull request Apr 2, 2025
…e resistance (#526) (#530)

On `main` the `RiscZeroSetVerifier.verifyIntegrity` function will accept
internal nodes in the Merkle tree, and complete with reverting. This is
not an intended use of this interface, and is a violation of the calling
requirements as the passed hash is not the digest of a claim (this is
similar to running ECDSA's verify operation on an unhashed message).
However, this is misuse that can be mitigated by following the best
practice of tagging Merkle tree leaves.

This PR makes the aggregation set verifier more misuse resistant by
tagging and hashing the leaves of the tree.

Additionally, the documentation on `IRiscZeroVerifier.verifyIntegrity`
is updated to highlight the importance of the caller hashing the claim
digest and to be more precise about the guarantees provided.

Resolves: #525
Resolves: WEB3-397

Co-authored-by: Victor Snyder-Graf <victor@risczero.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.

The set verifier accepts non-leaf nodes
2 participants