nginx: add fuzz harnesses for HTTP parsers, HTTP/2, PROXY protocol, upstream, DNS resolver#61
Open
tc-agent wants to merge 2 commits into
Open
nginx: add fuzz harnesses for HTTP parsers, HTTP/2, PROXY protocol, upstream, DNS resolver#61tc-agent wants to merge 2 commits into
tc-agent wants to merge 2 commits into
Conversation
Fuzzing Coverage ReportTested: project
Per-harness
Δ = (after − before) / before, to accommodate that denominators may change. "new" when before is 0; "deleted" when after is 0. |
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 13, 2026 18:37
3031ad7 to
f6e05c0
Compare
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 13, 2026 19:48
f6e05c0 to
0833157
Compare
tc-agent
force-pushed
the
master
branch
2 times, most recently
from
May 14, 2026 09:51
07a0cf6 to
ad01771
Compare
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 14, 2026 09:51
0833157 to
360a72a
Compare
tc-agent
force-pushed
the
master
branch
8 times, most recently
from
May 16, 2026 15:20
64e909c to
77ade48
Compare
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 16, 2026 15:20
360a72a to
c3ae2b9
Compare
tc-agent
force-pushed
the
master
branch
6 times, most recently
from
May 17, 2026 09:43
b54c0d2 to
1b028e2
Compare
…pstream, DNS resolver
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 17, 2026 09:43
c3ae2b9 to
5f092fe
Compare
tc-agent
force-pushed
the
master
branch
2 times, most recently
from
May 21, 2026 05:13
5573df7 to
9a36aa8
Compare
tc-agent
force-pushed
the
master
branch
4 times, most recently
from
May 27, 2026 06:33
6125235 to
e512e7e
Compare
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 27, 2026 07:14
5f092fe to
d2f0145
Compare
tc-agent
force-pushed
the
master
branch
5 times, most recently
from
May 27, 2026 16:16
b5fd10c to
712a52f
Compare
tc-agent
force-pushed
the
nginx-add-parser-fuzzers
branch
from
May 27, 2026 16:45
d2f0145 to
969f50f
Compare
tc-agent
force-pushed
the
master
branch
6 times, most recently
from
May 28, 2026 18:05
af7f9a7 to
806b281
Compare
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 six direct-call libFuzzer harnesses + a small in-build source-exposure patch, targeting parsing and protocol code that the existing
http_request_fuzzercovers little or not at all.Harnesses
h2_fuzzer— brings up an in-process nginx cycle with anhttp2-enabled unix listener, prepends the HTTP/2 connection preface to each fuzz input. Drivesngx_http_v2.c,ngx_http_v2_table.c(HPACK),ngx_http_v2_filter_module.c. Config enables gzip / charset / userid / add_header on the server and gives the H2 layer 8 free connections so stream allocation + the response filter chain are also exercised.upstream_fuzzer— same cycle pattern ashttp_request_fuzzer, but feeds a fixed valid HTTP/1.1 request from the client side and fuzzes the upstream HTTP/1 response. Targetsngx_http_upstream.c,ngx_http_proxy_module.c, and the response filter chain. Shipsupstream_fuzzer.optionsdisabling leak detection — the leak path inngx_http_upstream_connectis shared withhttp_request_fuzzerand is tracked in google/oss-fuzz#15401.parser_fuzzer— 13-way selector multiplexing ofngx_http_parse_request_line(),ngx_http_parse_header_line(),ngx_http_parse_status_line(),ngx_http_parse_chunked(),ngx_http_parse_complex_uri(),ngx_http_parse_unsafe_uri(),ngx_http_parse_uri(),ngx_http_arg(),ngx_http_split_args(),ngx_http_parse_multi_header_lines(),ngx_http_parse_cookie_lines(),ngx_http_parse_set_cookie_lines()(src/http/ngx_http_parse.c).pp_fuzzer— drivesngx_proxy_protocol_read()andngx_proxy_protocol_get_tlv()for v1 (text) and v2 (binary) PROXY protocol variants, including v2 TLV decoding (src/core/ngx_proxy_protocol.c).inet_fuzzer— drivesngx_inet_addr,ngx_inet6_addr,ngx_ptocidr,ngx_parse_addr,ngx_parse_addr_port,ngx_parse_url, thengx_atoi/ngx_hextoi/ngx_atotmfamily,ngx_unescape_uri,ngx_escape_uriandngx_decode_base64(src/core/ngx_inet.c,src/core/ngx_string.c).resolver_fuzzer— drivesngx_resolver_process_response()directly with fuzzed DNS packets against a minimally-mockedngx_resolver_t.build.shcarries an inline source patch that removesstaticfromngx_resolver_process_response/_a/_srv/_ptrandngx_resolver_copyso the harness can link against them. These five functions are the bug-rich entry points historically responsible for resolver CVEs (e.g. CVE-2016-0742).Each ships a seed corpus generated from human-readable code in
build.sh(no binary blobs) and a libFuzzer dictionary.make_fuzzersandbuild.share extended to compile and seed the new binaries against the same nginx object set as the existinghttp_request_fuzzer. The existinghttp_request_fuzzeris not modified.Coverage
Baseline numbers are from Fuzz Introspector; per-file FI numbers for nginx have known accuracy caveats (google/oss-fuzz#13267, google/oss-fuzz#13413). After-numbers come from a single
fuzz_for_pr --minutes 5run followed by an LLVM coverage build with all seven harnesses running concurrently.src/http/ngx_http_parse.csrc/http/v2/ngx_http_v2.csrc/http/v2/ngx_http_v2_table.csrc/http/v2/ngx_http_v2_filter_module.csrc/core/ngx_proxy_protocol.csrc/core/ngx_inet.csrc/core/ngx_string.csrc/core/ngx_resolver.csrc/http/ngx_http_upstream.csrc/http/modules/ngx_http_proxy_module.csrc/http/ngx_http_request.csrc/http/modules/ngx_http_userid_filter_module.cThe largest unreached files remaining (
ngx_resolver.c,ngx_http_grpc_module.c,ngx_http_ssi_filter_module.c, the SSL/mail/stream subsystems) require build or runtime configuration outside this PR's scope (TLS,grpc_pass, response generators that trigger specific filters), which bounds how far global line coverage can move in a single integration change; the per-subsystem deltas above are the more representative signal of this PR's effect.Per-harness 5-minute libFuzzer summary (cov = unique edges):
Why the harnesses are bundled
The six harnesses are submitted together because they share build-system plumbing (
make_fuzzersrules,build.shseed generation, the same nginx object set). Splitting would create churn against the same files in each follow-up PR. Happy to split if reviewers prefer.