https://github.com/python/cpython/commit/343a7a62595fa50e3e53eaca9c4b0a8de97ef714
commit: 343a7a62595fa50e3e53eaca9c4b0a8de97ef714
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: willingc <[email protected]>
date: 2024-10-30T00:49:18Z
summary:

[3.13] gh-118633: Add warning regarding the unsafe usage of eval and exec 
(GH-118437) (#126161)

gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)

* Add warning regarding the unsafe usage of eval

* Add warning regarding the unsafe usage of exec

* Move warning under parameters table

* Use suggested shorter text



* Use suggested shorter text



* Improve wording as suggested

---------

(cherry picked from commit 00e5ec0d35193c1665e5c0cfe5ef82eed270d0f4)

Co-authored-by: Daniel Ruf <[email protected]>
Co-authored-by: Kirill Podoprigora <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>

files:
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index e388cbb5b6fce3..5f1429a458eb24 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -588,6 +588,11 @@ are always available.  They are listed here in 
alphabetical order.
    :returns: The result of the evaluated expression.
    :raises: Syntax errors are reported as exceptions.
 
+   .. warning::
+
+      This function executes arbitrary code. Calling it with
+      user-supplied input may lead to security vulnerabilities.
+
    The *expression* argument is parsed and evaluated as a Python expression
    (technically speaking, a condition list) using the *globals* and *locals*
    mappings as global and local namespace.  If the *globals* dictionary is
@@ -644,6 +649,11 @@ are always available.  They are listed here in 
alphabetical order.
 
 .. function:: exec(source, /, globals=None, locals=None, *, closure=None)
 
+   .. warning::
+
+      This function executes arbitrary code. Calling it with
+      user-supplied input may lead to security vulnerabilities.
+
    This function supports dynamic execution of Python code. *source* must be
    either a string or a code object.  If it is a string, the string is parsed 
as
    a suite of Python statements which is then executed (unless a syntax error

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to