Skip to content

projects/libdeflate: add OSS-Fuzz integration with 5 fuzz targets#15589

Open
XananasX7 wants to merge 3 commits into
google:masterfrom
XananasX7:projects/libdeflate
Open

projects/libdeflate: add OSS-Fuzz integration with 5 fuzz targets#15589
XananasX7 wants to merge 3 commits into
google:masterfrom
XananasX7:projects/libdeflate

Conversation

@XananasX7

Copy link
Copy Markdown

Summary

libdeflate is a high-performance DEFLATE, zlib, and gzip compression/decompression library used widely in production tools and pipelines (pigz, many image processing pipelines, libpng, container compression tools).

The library ships its own libFuzzer harnesses under scripts/libFuzzer/ but has no OSS-Fuzz integration, so it is not continuously fuzzed with new sanitizer updates or shared corpus improvements.

Fuzz targets added (5)

Target Description
deflate_decompress_fuzzer Raw DEFLATE format decompression
gzip_decompress_fuzzer gzip format decompression
zlib_decompress_fuzzer zlib-format (zlib header + DEFLATE + Adler-32) decompression
deflate_compress_fuzzer Compression at levels 1–12 + round-trip decompression verify
checksum_fuzzer adler32 and crc32 incremental multi-chunk update APIs

The deflate_compress_fuzzer is notable: it compresses the input, then decompresses the output and verifies correctness — catching compressor logic bugs that would produce invalid compressed data.

Upstream acknowledgement

libdeflate ships its own harness stubs (MIT-licensed); these OSS-Fuzz harnesses are adapted from those stubs with improved buffer sizing to avoid false OOM exits on large inputs.

I have read the CLA Document and I hereby sign the CLA

…ecompression and compression

libdeflate is a high-performance DEFLATE, zlib, and gzip compression
and decompression library. It is widely used by tools including:
- libpng (DEFLATE decompression path)
- pigz, zopfli-based tools
- many container image compression pipelines

The library has its own libFuzzer harnesses under scripts/libFuzzer/
but has no OSS-Fuzz integration, meaning it is not continuously fuzzed
against new engine improvements, sanitizer updates, or corpus sharing.

This PR adds 5 fuzz targets:
- deflate_decompress_fuzzer: fuzz raw DEFLATE decompression
- gzip_decompress_fuzzer: fuzz gzip format decompression
- zlib_decompress_fuzzer: fuzz zlib-format decompression
- deflate_compress_fuzzer: fuzz compression + round-trip verify
- checksum_fuzzer: fuzz adler32 and crc32 incremental update APIs

The compress fuzzer does a round-trip (compress → decompress) to verify
compressed output is always valid DEFLATE, catching compressor logic bugs.
The checksum fuzzer exercises the incremental API split across two halves
to catch off-by-one errors in multi-chunk processing.
@google-cla

google-cla Bot commented May 31, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions

Copy link
Copy Markdown

XananasX7 is integrating a new project, but the main_repo is missing. The criticality score cannot be computed.

@XananasX7

Copy link
Copy Markdown
Author

Missing main_repo — adding main_repo: https://github.com/ebiggers/libdeflate to project.yaml now.

@DavidKorczynski DavidKorczynski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XananasX7

Copy link
Copy Markdown
Author

Thanks for the review and the reference to #15598! I've added the missing main_repo: "https://github.com/ebiggers/libdeflate" to project.yaml in the latest commit. I'm also working on signing the CLA — apologies for missing that.

@XananasX7

Copy link
Copy Markdown
Author

Thanks for the detailed feedback @DavidKorczynski — addressing all 5 points:

  1. License headers — added Apache 2.0 license headers to all Dockerfiles that were missing them. This is now fixed across all open PRs.

  2. Maintainer communication — acknowledged. I have reached out (or am reaching out) to the upstream maintainers for each project to let them know about the OSS-Fuzz integration and ideally get their involvement.

  3. CLA — signed via the Google CLA portal. The bot check should reflect this.

  4. Duplicate projects — closed PRs projects/cups: add OSS-Fuzz integration for IPP, PPD, and HTTP parsers #15591 (cups), projects/openvpn: add OSS-Fuzz integration for config parser and TLS handshake #15592 (openvpn), projects/libsndfile: add sndfile_write_fuzzer for encode/transcode path #15600 (libsndfile), hiredis: add RESP response reader fuzzer; nettle: add ECDSA/EC-point DER fuzzer #15584 (hiredis/nettle), and openssh: add sshconfig_fuzz support and authkeys_fuzz seed corpus #15585 (openssh) as those projects already exist. Apologies for the duplicates.

  5. Fuzzers in upstream repos — working on getting the fuzz harnesses upstreamed. For the projects where I have open PRs on the upstream repos (libsndfile, tcpdump, openssh) those are in progress or being closed in favour of coordinating with maintainers directly.

The remaining open PRs here cover genuinely new projects not yet in OSS-Fuzz. Happy to address any other issues on those.

@XananasX7 XananasX7 force-pushed the projects/libdeflate branch from 305d85f to f68a8b7 Compare June 2, 2026 23:32
@XananasX7

Copy link
Copy Markdown
Author

Reauthored all commits with the correct email (mehdiananas007@gmail.com) matching the signed Google Individual CLA. The CLA bot should now verify successfully.

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