[io] http: improper handling of invalid Transfer-Encoding
s
#60481
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-io
triaged
Issue has been triaged by sub team
Bug 1: Dart does not recognize the "
,chunked
"transfer-coding
.RFC 9112 defines the acceptable values of a
Transfer-Encoding
header as follows:The meaning of the "
#
" symbol is given in RFC 9110, section 5.6.1:Thus, a
Transfer-Encoding
header value consists of 0 or more comma-separatedtransfer-coding
s. (Atransfer-coding
is just a token with an optional trailing parameter. By far the most widely-usedtransfer-coding
is "chunked
".)RFC 9110, section 5.6.1.2 goes on to state the following:
Therefore, a recipient of a message with a "
Transfer-Encoding: ,chunked
" header must ignore the leading ",
" and treat the header equivalently to "Transfer-Encoding: chunked
".The HTTP parser in the Dart standard library does not do this. Instead, it treats "
,chunked
" as a distinct transfer-coding from "chunked
".Bug 2: Dart ignores unrecognized
transfer-coding
s.From RFC 9112:
The HTTP parser in the Dart standard library does not do this. Instead, it treats messages with unrecognized
transfer-coding
s as though they have no message bodies.These bugs can be used for request smuggling when the Dart stdlib HTTP implementation is used as a server behind certain load balancers.
The text was updated successfully, but these errors were encountered: