mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
gh-100001: Omit control characters in http.server stderr logs. (GH-100002)
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.
(cherry picked from commit d8ab0a4dfa
)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
f3a58cece6
commit
a726f747e6
4 changed files with 43 additions and 2 deletions
|
@ -512,3 +512,10 @@ Security Considerations
|
|||
:class:`SimpleHTTPRequestHandler` will follow symbolic links when handling
|
||||
requests, this makes it possible for files outside of the specified directory
|
||||
to be served.
|
||||
|
||||
Earlier versions of Python did not scrub control characters from the
|
||||
log messages emitted to stderr from ``python -m http.server`` or the
|
||||
default :class:`BaseHTTPRequestHandler` ``.log_message``
|
||||
implementation. This could allow to remote clients connecting to your
|
||||
server to send nefarious control codes to your terminal.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue