test(fuzz): libFuzzer targets for the QUIC, HTTP/2, HTTP/3, HPACK and QPACK decoders

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, github-actions

Research direction

Start with the existing HTTP/1 targets in fuzz/fuzz_fastparse.c and fuzz/fuzz_chunked.c, and the make fuzz target, to see how a libFuzzer target is built and run under ASan and UBSan. Then read the entry points in hpack.h, qpack.h, h2.h, h3.h and quic.h to choose one decoder for a first target. Done means that target runs in CI, with its seed corpus and any crashes saved under fuzz/regressions/. The whole-connection targets and the remaining decoders are larger follow-up work.

Written by the indexing model from the issue text.

Description

enhancement P0: release blocker

libFuzzer only covers the HTTP/1 parsers today (fuzz/fuzz_fastparse.c, fuzz_fbparse.c, fuzz_batchparse.c, fuzz_chunked.c). Nothing fuzzes the other decoders of untrusted network input, and those are where memory-safety bugs in a C network stack would be:

  • quic.h: packet header and frame decoding, transport parameters, ACK ranges, stream reassembly
  • hpack.h and qpack.h: header block decoding, the dynamic tables, and QPACK encoder/decoder stream instructions
  • h2.h and h3.h: frame parsing and the stream state machines

Plan:

  1. One libFuzzer target per decoder, with seed corpora taken from the existing tests' traffic (nghttp2, nghttp3 and ngtcp2 runs).
  2. A whole-connection target: an established quic_conn (keys from a fixed handshake) fed fuzzed decrypted payloads, so the frame handlers are reached past packet protection. The same for h2_recv and h3_recv.
  3. Run them in CI with the HTTP/1 targets (make fuzz), and add their crashes to fuzz/regressions/.

Done when: every decoder above has a target running in CI under ASan and UBSan, and a long local run (hours per target) finds nothing open.

Dominant language
C
Stars
0
Forks
0
Avg merge
20h 4m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from public/cursed-http

All issues in public/cursed-http

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.