fuzzing: add imap-parser, imap-url, and message-address harnesses#1
fuzzing: add imap-parser, imap-url, and message-address harnesses#1tc-agent wants to merge 3 commits into
Conversation
|
[CLAUDE CODE REVIEW - claude-opus-4-6] Here's my review against the PR checklist. PR Review: dovecot upstream — add imap-parser, imap-url, and message-address harnessesChecklist VerificationDiff minimality — Pass
Correctness — Pass
Coverage reporting — Pass
PR description — Minor issue
Build verification — Pass
Related PRs
VerdictLGTM — clean, well-structured harnesses that correctly use dovecot's fuzzer infrastructure. API usage is verified, conventions are followed, resource management is proper. The only nit is the empty [CLAUDE CODE REVIEW - claude-opus-4-6] |
…rnesses Three new libFuzzer harnesses for core dovecot parsing code that has no existing fuzz coverage: - fuzz-imap-parser: exercises imap_parser_read_tag(), imap_parser_read_command_name(), and imap_parser_finish_line() with both strict and ATOM_ALLCHARS flag combinations. The IMAP argument parser is the primary parsing path for all IMAP client connections and was previously not covered. - fuzz-imap-url: exercises imap_url_parse() for absolute and relative URLs (including URLAUTH), plus imap_url_create() for the write side. IMAP URL parsing is complex (RFC 5092/5593) and was previously not covered. - fuzz-message-address: exercises message_address_parse() with a write/re-parse roundtrip and message_address_parse_path() for Return-Path headers. RFC 5322 address parsing was previously not covered despite being security-critical. Makefile.am is updated in both lib-imap and lib-mail to build these targets under the existing USE_FUZZER conditional.
2a7e55e to
dc01350
Compare
|
[CLAUDE CODE REVIEW - claude-opus-4-6] LGTM (seeded for batch CI validation of dovecot) [CLAUDE CODE REVIEW - claude-opus-4-6] |
Fuzzing Coverage ReportTested: project No coverage data collected. Check the workflow run for build errors. Same harness config applied to both sides (baseline = base source + PR harness). Per-harness data from |
Summary
Three new fuzz harnesses for lib-imap and lib-mail entry points that had no dedicated fuzzing coverage:
fuzz-imap-parser.c (
src/lib-imap/)Exercises
imap_parser_read_tag,imap_parser_read_command_name, andimap_parser_finish_line— the three functions that handle every client command received by the IMAP server. The harness first attempts full command parsing (tag + command name + argument list), then retries the raw data as a flat argument list withIMAP_PARSE_FLAG_ATOM_ALLCHARSto exercise the permissive path.fuzz-imap-url.c (
src/lib-imap/)Exercises
imap_url_parsefor absolute IMAP URLs (withIMAP_URL_PARSE_ALLOW_URLAUTH) andimap_url_parsefor relative URLs (withIMAP_URL_PARSE_REQUIRE_RELATIVEagainst a base URL). Also performs a roundtrip: absolute parse →imap_url_create→ string output.fuzz-message-address.c (
src/lib-mail/)Exercises
message_address_parse(RFC 5321/5322 address parsing) with a roundtrip throughmessage_address_writeto catch serialization bugs, and separately exercisesmessage_address_parse_pathfor SMTP path address parsing.Coverage
Fuzz Introspector baseline (all existing harnesses combined): 12.37% overall — https://introspector.oss-fuzz.com/project-profile?project=dovecot
After 5 minutes of fuzzing on a local OSS-Fuzz build, per-harness results:
No crashes. All three harnesses linked against ASan + UBSan.