Skip to content

fix: replace unreachable panic with error in verify_proof#32

Open
drappi-ai wants to merge 2 commits intozellic-audit-feb-2026from
cdai__fix-205-unreachable-panic
Open

fix: replace unreachable panic with error in verify_proof#32
drappi-ai wants to merge 2 commits intozellic-audit-feb-2026from
cdai__fix-205-unreachable-panic

Conversation

@drappi-ai
Copy link

Summary

  • process_branch used unreachable! when an inline extension node's child decoded as a Leaf/Extension/EmptyRoot, allowing a malicious proof to trigger a panic (DoS)
  • Replaced with ProofVerificationError::UnexpectedNodeChild error return

Addresses SeismicSystems/internal#205.

Test plan

  • malicious_proof_unexpected_extension_child_returns_error regression test
  • All existing tests pass

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
@drappi-ai drappi-ai force-pushed the cdai__fix-205-unreachable-panic branch from 68c493a to 3823227 Compare March 9, 2026 15:54
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.

1 participant