Skip to content

Fix panic on HistoryTreeProof length mismatch#3659

Closed
jsdanielh wants to merge 0 commit into
albatrossfrom
fix/history-tree-proof-length-mismatch
Closed

Fix panic on HistoryTreeProof length mismatch#3659
jsdanielh wants to merge 0 commit into
albatrossfrom
fix/history-tree-proof-length-mismatch

Conversation

@jsdanielh

Copy link
Copy Markdown
Member

Summary

  • HistoryTreeProof::verify used assert_eq! to check that history and positions vectors have equal length. A malicious peer could send a proof with mismatched lengths, panicking the verifying node.
  • Replace the assert with a guard that returns None on mismatch, consistent with the method's documented error-returning contract.

@pkg-pr-new

pkg-pr-new Bot commented Mar 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nimiq/core@3659

commit: 955b33b

@jsdanielh jsdanielh closed this Mar 27, 2026
@jsdanielh jsdanielh force-pushed the fix/history-tree-proof-length-mismatch branch from 955b33b to 6ff0800 Compare March 27, 2026 22:28
@jsdanielh

Copy link
Copy Markdown
Member Author

Merged into albatross: 6ff0800

@jsdanielh jsdanielh deleted the fix/history-tree-proof-length-mismatch branch May 22, 2026 20:34
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.

2 participants