Skip to content

Add Atheris fuzz harnesses for URL, header, and decoder parsing#955

Draft
Kludex wants to merge 1 commit into
mainfrom
add-atheris-fuzz-harnesses
Draft

Add Atheris fuzz harnesses for URL, header, and decoder parsing#955
Kludex wants to merge 1 commit into
mainfrom
add-atheris-fuzz-harnesses

Conversation

@Kludex
Copy link
Copy Markdown
Member

@Kludex Kludex commented May 17, 2026

Summary

  • Adds coverage-guided fuzz targets under fuzz/ for the parts of httpx2 that consume untrusted server input: urlparse, Headers, and the content-encoding decoders (deflate, gzip, brotli, zstd).
  • Each module is a self-contained Atheris harness, structured to be picked up by OSS-Fuzz's compile_python_fuzzer (same layout as python-multipart). No production code is touched.
  • A follow-up PR will wire these into google/oss-fuzz for continuous fuzzing.

Test plan

  • uv pip install atheris (requires a libFuzzer-enabled Clang locally)
  • uv run python fuzz/fuzz_urlparse.py -atheris_runs=10000 exits cleanly
  • uv run python fuzz/fuzz_headers.py -atheris_runs=10000 exits cleanly
  • uv run python fuzz/fuzz_decoders.py -atheris_runs=10000 exits cleanly

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

Adds coverage-guided fuzz targets for the parts of httpx2 that consume
untrusted server input: `urlparse`, `Headers`, and the content-encoding
decoders (deflate, gzip, brotli, zstd). Designed to be wired into OSS-Fuzz.
@Kludex
Copy link
Copy Markdown
Member Author

Kludex commented May 17, 2026

@manunio as the fuzzer expert, and since you've helped me a lot on python-multipart, would you be able to help me here? I'm not sure I have the best fuzzer setup. 😞

@manunio
Copy link
Copy Markdown

manunio commented May 17, 2026 via email

@Kludex
Copy link
Copy Markdown
Member Author

Kludex commented May 17, 2026

Hey! Thanks for the ping. I'm actually out sick with a fever right now, but I'd be happy to take a look at your fuzzer setup as soon as I'm recovered and back at my desk 🤒. Kind regards, Manu

No hurry here. Wishing you a quick recover! 🙏

@Kludex Kludex marked this pull request as draft May 17, 2026 17:21
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