Repository navigation
test(fuzz): fuzz five more untrusted decoders, and fix a pack offset overflow they found - #360
Merged
Merged
Conversation
… parser fuzz targets
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
tonibergholm
approved these changes
Nov 20, 2026
tonibergholm
left a comment
Member
There was a problem hiding this comment.
Reviewed: sol-loop (2 rounds), all checks green including the six fuzz targets (600 s each, no crash), Codex review has no findings.
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.
The only fuzz target,
wire_decode, left most of the untrusted decoders unfuzzed. That included the pack index and record readers a bucket remote feeds. Writing the first new target found a real bug: an index offset nearu64::MAXoverflowedrecord_boundsincrates/core/src/pack.rs. Debug builds panic on it. Release builds have overflow checks off, so the sum wraps instead.This PR adds five targets and fixes that overflow:
pack_decode: pack index parse, pack reader, andread_object_at_boundedwith a full 8-byte offset and the expected id taken from the input. Seeded with a valid record and a raw pack.pack_stream:read_pack_streamwith a budget below libFuzzer's default input size, so the cap path is reachable.walfmt_decode: bucket manifest, log entry and checkpoint decoders.http_opening: the three HTTP opening readers, run with-max_len=8192so the 8 KiB limit is reachable.text_files: the TLS pin file and serve-token parsers.record_boundsnow converts the offset withtry_fromand useschecked_add, and the bounded zstd read usessaturating_add. A hostile offset or length now returnsPackCorrupt. The fuzz workflow runs the six targets as a matrix. Three#[doc(hidden)] pubhooks inscl-repoexpose private parsers to the harness;serve_tokens::loadandtls_pins::listcall them, so behaviour is unchanged.Proof:
record_bounds_rejects_overflowing_offsets_and_lengthscovers offsetsu64::MAX,u64::MAX - 3andusize::MAX - 3, and au32::MAXlength. The reproducer panicked before the fix.cargo test -p scl-corepasses. The harness replay tests andcargo check --binspass infuzz/. No libFuzzer run was possible locally (no nightly toolchain), so the first nightly run is the first real fuzzing.Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: round 2 left one item, a corpus seed for the streaming parser, which the last commit adds.
Created with Claude Opus 5.5 and Claude Sonnet 5.5 in Claude Code.