Skip to content

Commit abf5f5c

Browse files
gh-81054: Document that SimpleHTTPRequestHandler follows symbolic links (GH-94416) (GH-94492)
(cherry picked from commit 80aaeab) Co-authored-by: Sam Ezeh <[email protected]>
1 parent 227e0d6 commit abf5f5c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Doc/library/http.server.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This module defines classes for implementing HTTP servers.
2020
.. warning::
2121

2222
:mod:`http.server` is not recommended for production. It only implements
23-
basic security checks.
23+
:ref:`basic security checks <http.server-security>`.
2424

2525
One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass.
2626
It creates and listens at the HTTP socket, dispatching the requests to a
@@ -499,3 +499,14 @@ following command runs an HTTP/1.1 conformant server::
499499
the ``--cgi`` option::
500500

501501
python -m http.server --cgi
502+
503+
.. _http.server-security:
504+
505+
Security Considerations
506+
-----------------------
507+
508+
.. index:: pair: http.server; security
509+
510+
:class:`SimpleHTTPRequestHandler` will follow symbolic links when handling
511+
requests, this makes it possible for files outside of the specified directory
512+
to be served.

Doc/library/security_warnings.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The following modules have specific security considerations:
1414
argument disabling known insecure and blocked algorithms
1515
<hashlib-usedforsecurity>`
1616
* :mod:`http.server` is not suitable for production use, only implementing
17-
basic security checks
17+
basic security checks. See the :ref:`security considerations <http.server-security>`.
1818
* :mod:`logging`: :ref:`Logging configuration uses eval()
1919
<logging-eval-security>`
2020
* :mod:`multiprocessing`: :ref:`Connection.recv() uses pickle

0 commit comments

Comments
 (0)