Skip to content

Commit db60ed1

Browse files
[3.10] bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411) (GH-30447)
1 parent 3cb64ed commit db60ed1

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
@@ -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)