fuzz: add fuzz_jp2_metadata for JP2 container header and box parsing#1639
Open
XananasX7 wants to merge 1 commit into
Open
fuzz: add fuzz_jp2_metadata for JP2 container header and box parsing#1639XananasX7 wants to merge 1 commit into
XananasX7 wants to merge 1 commit into
Conversation
Add a libFuzzer harness targeting opj_read_header() which parses JP2 container boxes (JP2H, COLR, PCLR, CMAP, CDEF, RES, XML, UUID, etc.) and embedded metadata (XMP, ICC profiles) without decoding the full codestream. The existing fuzzers focus on full image decoding; this harness targets the metadata/header parsing path which processes variable-length boxes of arbitrary type and can be reached even with truncated or malformed JP2 files that fail codestream decoding.
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.
Summary
Adds a new libFuzzer harness targeting the JP2 container box/metadata parsing path in openjpeg.
New fuzzer:
tests/fuzzers/fuzz_jp2_metadata.cWhat it exercises:
opj_read_header()— parses JP2 box structure (JP2H, COLR, PCLR, CMAP, CDEF, RES, XML, UUID boxes)Why this matters:
The existing fuzzers in
tests/fuzzers/focus on full image decoding. The JP2 container parsing code insrc/lib/openjp2/jp2.cprocesses variable-length boxes of arbitrary type and length, reading embedded strings, binary color profiles, and palette data. A malformed JP2 file with adversarial box lengths could trigger out-of-bounds reads before the codestream decoder is ever invoked.Build: integrates with the existing
build_google_oss_fuzzers.shscript.