[Python-checkins] [3.9] bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411) (GH-30448)

vsajip webhook-mailer at python.org
Thu Jan 6 18:18:47 EST 2022


https://github.com/python/cpython/commit/188fbdee0d6721a948eabb81cdcacac371614793
commit: 188fbdee0d6721a948eabb81cdcacac371614793
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: vsajip <vinay_sajip at yahoo.co.uk>
date: 2022-01-06T23:18:18Z
summary:

[3.9] bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411) (GH-30448)

files:
M Doc/library/logging.config.rst

diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst
index d4dc585351bab..afc32e64bc798 100644
--- a/Doc/library/logging.config.rst
+++ b/Doc/library/logging.config.rst
@@ -186,6 +186,20 @@ in :mod:`logging` itself) and defining handlers which are declared either in
    :func:`listen`.
 
 
+Security considerations
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The logging configuration functionality tries to offer convenience, and in part this
+is done by offering the ability to convert text in configuration files into Python
+objects used in logging configuration - for example, as described in
+:ref:`logging-config-dict-userdef`. However, these same mechanisms (importing
+callables from user-defined modules and calling them with parameters from the
+configuration) could be used to invoke any code you like, and for this reason you
+should treat configuration files from untrusted sources with *extreme caution* and
+satisfy yourself that nothing bad can happen if you load them, before actually loading
+them.
+
+
 .. _logging-config-dictschema:
 
 Configuration dictionary schema



More information about the Python-checkins mailing list