]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document that multiprocessing treats local same-user processes as trusted (GH-149001)
authorGregory P. Smith <68491+gpshead@users.noreply.github.com>
Mon, 27 Apr 2026 01:42:13 +0000 (18:42 -0700)
committerGitHub <noreply@github.com>
Mon, 27 Apr 2026 01:42:13 +0000 (18:42 -0700)
Clarify in the Authentication keys section that the authkey handshake
covers Listener/Client (addressable endpoints) only, not the anonymous
pipes behind Pipe() and Queue, and that isolation between same-user
processes must be arranged at the OS level.

Doc/library/multiprocessing.rst

index 3ceb5e717c482582303535fcb1ffd2ca7dd4317c..187143d02cd7bfbb13a9b9c2d832759e746655e6 100644 (file)
@@ -2917,6 +2917,16 @@ between themselves.
 
 Suitable authentication keys can also be generated by using :func:`os.urandom`.
 
+This authentication protects :class:`Listener` and :func:`Client` connections,
+which are reachable by address.  It is not applied to the anonymous pipes
+created by :func:`~multiprocessing.Pipe` or used internally by
+:class:`~multiprocessing.Queue`.
+:mod:`multiprocessing` treats all local processes running as the same user as
+trusted; on most operating systems such processes can access each other's pipe
+file descriptors regardless.  Applications that require isolation between
+processes of the same user must arrange it at the operating-system level --
+for example, by running workers under a different user account or in a sandbox.
+
 
 Logging
 ^^^^^^^