Skip to content

Prevent chunk extension request smuggling#2134

Open
erikdubbelboer wants to merge 14 commits intomasterfrom
chunk-extensions-smuggling
Open

Prevent chunk extension request smuggling#2134
erikdubbelboer wants to merge 14 commits intomasterfrom
chunk-extensions-smuggling

Conversation

@erikdubbelboer
Copy link
Copy Markdown
Collaborator

@erikdubbelboer erikdubbelboer commented Jan 31, 2026

Improve fuzzers to make sure our handling of http requests and responses is the same as net/http.

Thanks to https://github.com/xclow3n for reporting this!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves HTTP request/response parsing and fuzzing to better match Go’s net/http behavior and harden against chunk-extension based request smuggling.

Changes:

  • Tightens chunk-size parsing to properly validate separators and safely skip chunk extensions.
  • Enforces HTTP/1.1 Host requirement during request parsing and treats missing trailer terminators as broken chunks.
  • Updates unit tests and fuzzers to include mandatory Host / valid status lines and to compare against net/http.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
http.go Enforces Host for HTTP/1.1 requests, maps EOF-in-trailer to broken chunk, and hardens chunk-size parsing.
header.go Tightens response/request first-line parsing (HTTP version and status code validation).
http_test.go Adjusts request/response parsing tests for stricter parsing (valid status line, Host header) and multipart chunked formatting.
header_test.go Updates response header tests (discard body between sequential responses; removes now-invalid “foobar” protocol test).
fuzz_test.go Expands fuzzing to compare fasthttp body parsing against net/http under size limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@erikdubbelboer erikdubbelboer force-pushed the chunk-extensions-smuggling branch from 0db2f6a to d1eba1d Compare January 31, 2026 10:58
@erikdubbelboer erikdubbelboer force-pushed the chunk-extensions-smuggling branch from 887ef70 to 09d0cdb Compare February 22, 2026 17:16
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