fuzz: add parser harnesses for raw requests & templates - #7459
Conversation
Add go-fuzz harnesses for raw request and template parsing. The new coverage exercises input raw request parsing, HTTP raw request parsing across safe and unsafe modes, and YAML/JSON template parsing with lightweight compile-time validation. Seed corpora cover common ingestion shapes, host reconstruction, full URL paths, empty path automerge, relative query paths, and raw HTTP template requests. Part of #7312 Signed-off-by: Dwi Siswanto <git@dw1.io>
Add a go-fuzz harness for `ParseRawRequest` and `ParseRawRequestWithURL`. The seed corpus covers common raw request ingestion shapes, including simple GET requests, form posts, JSON bodies, and URL override cases. Signed-off-by: Dwi Siswanto <git@dw1.io>
Add a go-fuzz harness for `Parse` and `ParseRawRequest`. The corpus covers unsafe requests, self-contained host reconstruction, empty path handling, path automerge, full URL paths, and relative query paths. Signed-off-by: Dwi Siswanto <git@dw1.io>
Add a go-fuzz harness for YAML and JSON template parsing. Generated templates are parsed in both formats and passed thru lightweight compile-time validation. Helper file loading is disabled so fuzz inputs cannot turn the compile check into filesystem access, and no protocol execution is run. Signed-off-by: Dwi Siswanto <git@dw1.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughAdds gofuzz entrypoints, harnesses, normalization helpers, corpus seeds, and harness tests to exercise parsing for input/types (HTTP requests), protocols/http/raw, and templates. ChangesInput Types HTTP Request Fuzzing
Raw HTTP Protocol Fuzzing
Template Fuzzing
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Dwi Siswanto <git@dw1.io>
|
Reviewed this PR. Assessment: Implementation looks solid and follows project conventions. Clean code quality. Approved ✅ |
Proposed changes
Add go-fuzz harnesses for raw request and template
parsing.
The new coverage exercises input raw request
parsing, HTTP raw request parsing across safe and
unsafe modes, and YAML/JSON template parsing with
lightweight compile-time validation. Seed corpora
cover common ingestion shapes, host reconstruction,
full URL paths, empty path automerge, relative
query paths, and raw HTTP template requests.
Part of #7312
Proof
Checklist
Summary by CodeRabbit
New Features
Tests
Chores