fix(sync): validate discovery hash responses#318
Open
evan-forbes wants to merge 1 commit into
Open
Conversation
evan-forbes
marked this pull request as ready for review
July 1, 2026 14:48
evan-forbes
force-pushed
the
codex/sync-discovery-validation
branch
2 times, most recently
from
July 1, 2026 22:53
b252cda to
d44bd7d
Compare
evan-forbes
force-pushed
the
codex/sync-discovery-validation
branch
from
July 1, 2026 23:20
d44bd7d to
abebf4e
Compare
ValarDragon
approved these changes
Jul 2, 2026
ValarDragon
left a comment
There was a problem hiding this comment.
LGTM, lets merge in after Friday
7 tasks
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.
Motivation
Closes: N/A
This fixes a DoS variant of GHSA-h9hm-m2xj-4rq9 where malformed nonempty
FindBlocksresponses could poison sync state. For example, a response shaped like[unknown, known, random]could cause Zebra to enqueue known hashes and then cancel future downloads when the known block download failed.Solution
[R].[U,K,R], duplicates,[R], and malformed extension responses.Validation
cargo test -p zebrad components::synccargo fmt --all -- --checkIn this environment the
zebradtests were run withCXXFLAGS='-include cstdint'to work around a locallibrocksdb-sysC++ include issue.AI Disclosure
Used OpenAI Codex to audit, implement, and test this change.