Repository navigation
test: FuzzUnmarshalBinary; audit entry for the decoder - #47
Merged
Merged
Conversation
UnmarshalBinary (v0.10.0) takes bytes that may come from anywhere, and nothing fuzzed it. The new target requires that a refusal wraps ErrFormat, that nothing panics, that an accepted array re-encodes to no more bytes than it was decoded from (so a few bytes cannot claim a huge array), and that re-encoding is a fixed point. 11 million inputs, no failure. A copy accepting fewer bytes than the shape needs fails it in 0.09 s (6 bytes decoded as 48 bools). govulncheck at go1.27.2 with go-fft v0.23.0: none. SECURITY.md gains the guarantee and the audit entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1<<40 does not fit the int of 386, arm and the other 32-bit targets, so the test did not compile there. maxSize is the package's own bound on every architecture. Compiled for linux/386, arm and mipsle, and run on linux/386. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
UnmarshalBinary(v0.10.0) decodes bytes that may come from a file, a notebook or the network. No fuzz target covered it, and the audit log had no entry for it.FuzzUnmarshalBinary(marshal_fuzz_test.go) requires four things:ErrFormat;The seed corpus covers:
(0, 2^40);Measured:
!= sizeto> size. The fuzzer failed in 0.09 s with "6 input bytes decoded to an array of 54 encoded bytes (bool [48])", so it can see the defect it guards against.govulncheck ./...at go1.27.2 with go-fft v0.23.0 reports no vulnerabilities.SECURITY.md gains the guarantee and an audit-log entry. There are no library changes: the decoder held.
🤖 Generated with Claude Code