Skip to content

Expand adversarial HTTP request parser coverage - #3131

Open
HarshPopat23 wants to merge 3 commits into
sourcemeta:mainfrom
HarshPopat23:http-request-parser-adversarial-tests
Open

HarshPopat23 wants to merge 3 commits into
sourcemeta:mainfrom
HarshPopat23:http-request-parser-adversarial-tests

Conversation

@HarshPopat23

@HarshPopat23 HarshPopat23 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Builds on #3112 with 18 additional tests for http_parse_request_line_and_headers.

  • Adds seven pinned llhttp examples, documenting intentional differences.
  • Tests every split position of representative requests.
  • Exercises all 256 byte values in methods, targets, header names, and values.
  • Covers repeated headers, binary bodies, pipelining boundaries, and borrowed input views.
  • Checks every result member, including empty results after incomplete or malformed input.

Only the existing test file changes. Parser behavior remains unchanged.

Verification

  • All 33 parser tests and the full HTTP suite passed on Linux/GCC.
  • Parser tests passed with ASan/UBSan and unsigned-char builds.
  • All six deliberate parser mutations were caught by the new tests.
  • Formatting and Clang-Tidy passed.
  • LeakSanitizer was blocked by environment tracing.
  • macOS, Windows, and the full Core suite were not run locally.

View guided diff

Exercise pinned llhttp examples, every split of representative requests,
all octets in grammar positions, repeated headers, borrowed views, and
binary body/pipelining boundaries. Assert every parser result member.

Signed-off-by: HarshPopat23 <musichk61@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Re-trigger cubic

@augmentcode

augmentcode Bot commented Nov 27, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Expands adversarial HTTP request-parser coverage to catch syntax and boundary regressions.
Scope: Only the existing test file changes; parser behavior remains unchanged.
Changes:

  • Adds 18 tests, bringing the parser suite to 33 cases.
  • Introduces helpers that validate every parse-result member.
  • Adds seven pinned llhttp fixtures, documenting intentional differences.
  • Retries representative requests at every possible input split.
  • Exercises all 256 octets in methods, targets, field names, and values.
  • Checks binary-body and pipelined-request boundaries.
  • Verifies strict syntax, failure cleanup, repeated headers, whitespace trimming, and borrowed input views.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@HarshPopat23

Copy link
Copy Markdown
Contributor Author

PTAL : @jviotti

Replace grouped loops and assertion helpers with directly asserted cases.
Separate borrowed-view parsing from the truncated-view rejection check.

Signed-off-by: HarshPopat23 <musichk61@gmail.com>
Default-initialize the empty view and use lowercase names for runtime input variables.

Signed-off-by: HarshPopat23 <musichk61@gmail.com>
@HarshPopat23
HarshPopat23 requested a review from jviotti November 29, 2026 15:31

This branch has not been deployed

No deployments
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