fix: replace unreachable panic with error in verify_proof#32
Open
drappi-ai wants to merge 2 commits intozellic-audit-feb-2026from
Open
fix: replace unreachable panic with error in verify_proof#32drappi-ai wants to merge 2 commits intozellic-audit-feb-2026from
drappi-ai wants to merge 2 commits intozellic-audit-feb-2026from
Conversation
Adds a test that demonstrates a malicious proof can trigger a panic via the unreachable! macro in process_branch when an inline extension node's child decodes as a Leaf instead of a Branch. This is the regression test for audit finding #205.
A malicious proof containing an inline extension node whose child decodes as a Leaf, Extension, or EmptyRoot would trigger an unreachable! panic in process_branch, causing a DoS. Replace it with a new ProofVerificationError::UnexpectedNodeChild variant that returns a proper error instead of panicking. Fixes SeismicSystems/internal#205
68c493a to
3823227
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
process_branchusedunreachable!when an inline extension node's child decoded as a Leaf/Extension/EmptyRoot, allowing a malicious proof to trigger a panic (DoS)ProofVerificationError::UnexpectedNodeChilderror returnAddresses SeismicSystems/internal#205.
Test plan
malicious_proof_unexpected_extension_child_returns_errorregression test