File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,8 @@ provides three different variants:
247247 specifying its value. Note that, after the send_header calls are done,
248248 :meth: `end_headers ` MUST BE called in order to complete the operation.
249249
250+ This method does not reject input containing CRLF sequences.
251+
250252 .. versionchanged :: 3.2
251253 Headers are stored in an internal buffer.
252254
@@ -257,6 +259,8 @@ provides three different variants:
257259 buffered and sent directly the output stream.If the *message * is not
258260 specified, the HTTP message corresponding the response *code * is sent.
259261
262+ This method does not reject *message * containing CRLF sequences.
263+
260264 .. versionadded :: 3.2
261265
262266 .. method :: end_headers()
@@ -553,6 +557,11 @@ Security considerations
553557requests, this makes it possible for files outside of the specified directory
554558to be served.
555559
560+ Methods :meth: `BaseHTTPRequestHandler.send_header ` and
561+ :meth: `BaseHTTPRequestHandler.send_response_only ` assume sanitized input
562+ and does not perform input validation such as checking for the presence of CRLF
563+ sequences. Untrusted input may result in HTTP Header injection attacks.
564+
556565Earlier versions of Python did not scrub control characters from the
557566log messages emitted to stderr from ``python -m http.server `` or the
558567default :class: `BaseHTTPRequestHandler ` ``.log_message ``
You can’t perform that action at this time.
0 commit comments