Linux specific local privilege escalation via the multiprocessing forkserver start method¶
Python 3.9, 3.10, and 3.11.0rc2 on Linux may allow for a local privilege escalation attack in a non-default configuration when code uses the multiprocessing module and configures multiprocessing to use the forkserver start method.
This issue was discovered by Devin Jeanpierre (@ssbr) of Google.
- Disclosure date: 2022-09-23 (Python issue gh-97514 reported)
- Reported at: 2022-09-07 (email to PSRT)
- Reported by: Devin Jeanpierre (Google)
Linux specific local privilege escalation via the multiprocessing forkserver start method - CVE-2022-42919.
- Python issue: gh-97514
- Creation date: 2022-09-23
- Reporter: gpshead
Python 3.9.x and 3.10.x through 3.10.8 on Linux allows local privilege escalation in a non-default configuration. The Python multiprocessing library, when used with the forkserver start method on Linux, allows pickles to be deserialized from any user in the same machine local network namespace, which in many system configurations means any user on the same machine. Pickles can execute arbitrary code. Thus, this allows for local user privilege escalation to the user that any forkserver process is running as. Setting multiprocessing.util.abstract_sockets_supported to False is a workaround. The forkserver start method for multiprocessing is not the default start method. This issue is Linux specific because only Linux supports abstract namespace sockets. CPython before 3.9 does not make use of Linux abstract namespace sockets by default. Support for users manually specifying an abstract namespace socket was added as a bugfix in 3.7.8 and 3.8.4, but users would need to make specific uncommon API calls in order to do that in CPython before 3.9.
- CVE ID: CVE-2022-42919
- Published: 2022-11-07
Timeline using the disclosure date 2022-09-23 as reference:
- 2022-09-07 (-16 days): Reported (email to PSRT)
- 2022-09-23: Python issue gh-97514 reported by gpshead
- 2022-10-20 (+27 days): commit 49f6106 (branch 3.12)
- 2022-10-20 (+27 days): commit 4c0c1e2 (branch 3.11)
- 2022-10-20 (+27 days): commit eae692e (branch 3.10)
- 2022-10-24: Python 3.11.0 released
- 2022-10-28 (+35 days): commit b43496c (branch 3.9)
- 2022-11-07 (+45 days): CVE-2022-42919 published
- 2022-12-06 (+74 days): Python 3.10.9 released
- 2022-12-06 (+74 days): Python 3.9.16 released