Skip to content

reject chunked transfer-encoding in HTTP/1.0 requests#3096

Open
sahvx655-wq wants to merge 1 commit into
boostorg:developfrom
sahvx655-wq:http10-reject-chunked
Open

reject chunked transfer-encoding in HTTP/1.0 requests#3096
sahvx655-wq wants to merge 1 commit into
boostorg:developfrom
sahvx655-wq:http10-reject-chunked

Conversation

@sahvx655-wq

Copy link
Copy Markdown
Contributor

HTTP/1.0 has no chunked transfer coding, yet the parser honoured it on a request and framed the body as chunks. I was tracing how finish_header decides the body style and the version flag sits right next to the framing decision but is never read.

  1. do_field sets the chunked flag whenever Transfer-Encoding resolves to chunked as the final coding, with no regard for the request version.
  2. finish_header then switches into chunk parsing, so POST / HTTP/1.0 carrying Transfer-Encoding: chunked is consumed as a chunked message.

Reject at finish_header when the chunked flag is set on anything below HTTP/1.1. The risk if left alone is desync: a front-end that follows HTTP/1.0 and ignores Transfer-Encoding will disagree with Beast about where the body ends, which is a request smuggling primitive. Responses are left untouched since reading a 1.0 chunked response to EOF is the usual interop fudge. Closes #837.

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.

Handle HTTP/1.0 specifying chunked

1 participant