]> git.ipfire.org Git - thirdparty/tornado.git/commit
curl_httpclient,http1connection: Prohibit CR and LF in headers 3386/head
authorBen Darnell <ben@bendarnell.com>
Wed, 5 Jun 2024 19:43:45 +0000 (15:43 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 5 Jun 2024 19:43:45 +0000 (15:43 -0400)
commitb0ffc58e02f33f6aa480f008b74495601d988ce1
tree11d06d35c490f87f9193de529523173481c2776d
parent0efa9a42b4c94ee98549d86992c68227f83efd4e
curl_httpclient,http1connection: Prohibit CR and LF in headers

libcurl does not check for CR and LF in headers, making this the
application's responsibility. However, Tornado's other HTTP interfaces
check for linefeeds so we should do the same here so that switching
between the simple and curl http clients does not introduce header
injection vulnerabilties.

http1connection previously checked only for LF in headers (alone or in a
CRLF pair). It now prohibits bare CR as well, following the requirement
in RFC 9112.
tornado/curl_httpclient.py
tornado/http1connection.py
tornado/test/httpclient_test.py