Skip to content

Commit 188fbde

Browse files
[3.9] bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411) (GH-30448)
1 parent b98730c commit 188fbde

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Doc/library/logging.config.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,20 @@ in :mod:`logging` itself) and defining handlers which are declared either in
186186
:func:`listen`.
187187

188188

189+
Security considerations
190+
^^^^^^^^^^^^^^^^^^^^^^^
191+
192+
The logging configuration functionality tries to offer convenience, and in part this
193+
is done by offering the ability to convert text in configuration files into Python
194+
objects used in logging configuration - for example, as described in
195+
:ref:`logging-config-dict-userdef`. However, these same mechanisms (importing
196+
callables from user-defined modules and calling them with parameters from the
197+
configuration) could be used to invoke any code you like, and for this reason you
198+
should treat configuration files from untrusted sources with *extreme caution* and
199+
satisfy yourself that nothing bad can happen if you load them, before actually loading
200+
them.
201+
202+
189203
.. _logging-config-dictschema:
190204

191205
Configuration dictionary schema

0 commit comments

Comments
 (0)