@@ -597,17 +597,18 @@ are always available. They are listed here in alphabetical order.
597597 .. warning ::
598598
599599 This function executes arbitrary code. Calling it with
600- user-supplied input may lead to security vulnerabilities.
600+ untrusted user-supplied input will lead to security vulnerabilities.
601601
602602 The *source * argument is parsed and evaluated as a Python expression
603603 (technically speaking, a condition list) using the *globals * and *locals *
604604 mappings as global and local namespace. If the *globals * dictionary is
605605 present and does not contain a value for the key ``__builtins__ ``, a
606606 reference to the dictionary of the built-in module :mod: `builtins ` is
607- inserted under that key before *source * is parsed. That way you can
608- control what builtins are available to the executed code by inserting your
609- own ``__builtins__ `` dictionary into *globals * before passing it to
610- :func: `eval `. If the *locals * mapping is omitted it defaults to the
607+ inserted under that key before *source * is parsed.
608+ Overriding ``__builtins__ `` can be used to restrict or change the available
609+ names, but this is **not ** a security mechanism: the executed code can
610+ still access all builtins.
611+ If the *locals * mapping is omitted it defaults to the
611612 *globals * dictionary. If both mappings are omitted, the source is
612613 executed with the *globals * and *locals * in the environment where
613614 :func: `eval ` is called. Note, *eval() * will only have access to the
@@ -658,7 +659,7 @@ are always available. They are listed here in alphabetical order.
658659 .. warning ::
659660
660661 This function executes arbitrary code. Calling it with
661- user-supplied input may lead to security vulnerabilities.
662+ untrusted user-supplied input will lead to security vulnerabilities.
662663
663664 This function supports dynamic execution of Python code. *source * must be
664665 either a string or a code object. If it is a string, the string is parsed as
@@ -689,9 +690,10 @@ are always available. They are listed here in alphabetical order.
689690
690691 If the *globals * dictionary does not contain a value for the key
691692 ``__builtins__ ``, a reference to the dictionary of the built-in module
692- :mod: `builtins ` is inserted under that key. That way you can control what
693- builtins are available to the executed code by inserting your own
694- ``__builtins__ `` dictionary into *globals * before passing it to :func: `exec `.
693+ :mod: `builtins ` is inserted under that key.
694+ Overriding ``__builtins__ `` can be used to restrict or change the available
695+ names, but this is **not ** a security mechanism: the executed code can
696+ still access all builtins.
695697
696698 The *closure * argument specifies a closure--a tuple of cellvars.
697699 It's only valid when the *object * is a code object containing
0 commit comments