Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46c7a65

Browse files
authored
bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411)
1 parent c9137d4 commit 46c7a65

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Doc/library/logging.config.rst

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

193193

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

196210
Configuration dictionary schema

0 commit comments

Comments
 (0)