@@ -45,7 +45,7 @@ and :func:`call_annotate_function`, as well as the
4545:func: `call_evaluate_function ` function for working with
4646:term: `evaluate functions <evaluate function> `.
4747
48- .. warning ::
48+ .. caution ::
4949
5050 Most functionality in this module can execute arbitrary code; see
5151 :ref: `the security section <annotationlib-security >` for more information.
@@ -610,18 +610,19 @@ Below are a few examples of the behavior with unsupported expressions:
610610
611611 .. _annotationlib-security :
612612
613- Security
614- --------
613+ Security implications of introspecting annotations
614+ --------------------------------------------------
615615
616- Much of the functionality in this module involves executing arbitrary code. For example,
616+ Much of the functionality in this module involves executing code related to annotations,
617+ which can then do arbitrary things. For example,
617618:func: `get_annotations ` may call an arbitrary :term: `annotate function `, and
618619:meth: `ForwardRef.evaluate ` may call :func: `eval ` on an arbitrary string. Code contained
619620in an annotation might make arbitrary system calls, enter an infinite loop, or perform any
620- other operation. This is also true for access to the :attr: `~object.__annotations__ ` attribute,
621+ other operation. This is also true for any access of the :attr: `~object.__annotations__ ` attribute,
621622and for various functions in the :mod: `typing ` module that work with annotations, such as
622623:func: `typing.get_type_hints `.
623624
624- Any security issues arising from these facts also apply immediately after importing
625+ Any security issue arising from this also applies immediately after importing
625626code that may contain untrusted annotations: importing code can always cause arbitrary operations
626627to be performed. However, it is unsafe to accept strings or other input from an untrusted source and
627628pass them to any of the APIs for introspecting annotations, for example by editing an
0 commit comments