@@ -287,6 +287,8 @@ instantiation, of which this module provides three different variants:
287287 specifying its value. Note that, after the send_header calls are done,
288288 :meth: `end_headers ` MUST BE called in order to complete the operation.
289289
290+ This method does not reject input containing CRLF sequences.
291+
290292 .. versionchanged :: 3.2
291293 Headers are stored in an internal buffer.
292294
@@ -297,6 +299,8 @@ instantiation, of which this module provides three different variants:
297299 buffered and sent directly the output stream.If the *message * is not
298300 specified, the HTTP message corresponding the response *code * is sent.
299301
302+ This method does not reject *message * containing CRLF sequences.
303+
300304 .. versionadded :: 3.2
301305
302306 .. method :: end_headers()
@@ -555,6 +559,11 @@ Security considerations
555559requests, this makes it possible for files outside of the specified directory
556560to be served.
557561
562+ Methods :meth: `BaseHTTPRequestHandler.send_header ` and
563+ :meth: `BaseHTTPRequestHandler.send_response_only ` assume sanitized input
564+ and does not perform input validation such as checking for the presence of CRLF
565+ sequences. Untrusted input may result in HTTP Header injection attacks.
566+
558567Earlier versions of Python did not scrub control characters from the
559568log messages emitted to stderr from ``python -m http.server `` or the
560569default :class: `BaseHTTPRequestHandler ` ``.log_message ``
0 commit comments