Skip to content

Commit adb0de6

Browse files
committed
Doc/library/pyexpat.rst: Document risk of ExternalEntityRefHandler
1 parent 7c336ac commit adb0de6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/pyexpat.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,13 @@ otherwise stated.
614614

615615
.. method:: xmlparser.ExternalEntityRefHandler(context, base, systemId, publicId)
616616

617+
.. warning::
618+
619+
Registering a handler for external entity references may allow
620+
attacker-controller XML to access local files and/or the network,
621+
and thus create new security risks.
622+
By default, :class:`xmlparser` is safe from these threats.
623+
617624
Called for references to external entities. *base* is the current base, as set
618625
by a previous call to :meth:`SetBase`. The public and system identifiers,
619626
*systemId* and *publicId*, are strings if given; if the public identifier is not

0 commit comments

Comments
 (0)