@@ -591,17 +591,18 @@ are always available. They are listed here in alphabetical order.
591591 .. warning ::
592592
593593 This function executes arbitrary code. Calling it with
594- user-supplied input may lead to security vulnerabilities.
594+ untrusted user-supplied input will lead to security vulnerabilities.
595595
596596 The *source * argument is parsed and evaluated as a Python expression
597597 (technically speaking, a condition list) using the *globals * and *locals *
598598 mappings as global and local namespace. If the *globals * dictionary is
599599 present and does not contain a value for the key ``__builtins__ ``, a
600600 reference to the dictionary of the built-in module :mod: `builtins ` is
601- inserted under that key before *source * is parsed. That way you can
602- control what builtins are available to the executed code by inserting your
603- own ``__builtins__ `` dictionary into *globals * before passing it to
604- :func: `eval `. If the *locals * mapping is omitted it defaults to the
601+ inserted under that key before *source * is parsed.
602+ Overriding ``__builtins__ `` can be used to restrict or change the available
603+ names, but this is **not ** a security mechanism: the executed code can
604+ still access all builtins.
605+ If the *locals * mapping is omitted it defaults to the
605606 *globals * dictionary. If both mappings are omitted, the source is
606607 executed with the *globals * and *locals * in the environment where
607608 :func: `eval ` is called. Note, *eval() * will only have access to the
@@ -652,7 +653,7 @@ are always available. They are listed here in alphabetical order.
652653 .. warning ::
653654
654655 This function executes arbitrary code. Calling it with
655- user-supplied input may lead to security vulnerabilities.
656+ untrusted user-supplied input will lead to security vulnerabilities.
656657
657658 This function supports dynamic execution of Python code. *source * must be
658659 either a string or a code object. If it is a string, the string is parsed as
@@ -683,9 +684,10 @@ are always available. They are listed here in alphabetical order.
683684
684685 If the *globals * dictionary does not contain a value for the key
685686 ``__builtins__ ``, a reference to the dictionary of the built-in module
686- :mod: `builtins ` is inserted under that key. That way you can control what
687- builtins are available to the executed code by inserting your own
688- ``__builtins__ `` dictionary into *globals * before passing it to :func: `exec `.
687+ :mod: `builtins ` is inserted under that key.
688+ Overriding ``__builtins__ `` can be used to restrict or change the available
689+ names, but this is **not ** a security mechanism: the executed code can
690+ still access all builtins.
689691
690692 The *closure * argument specifies a closure--a tuple of cellvars.
691693 It's only valid when the *object * is a code object containing
0 commit comments