Local Privilege Escalation Vulnerability in Python3 on Alpine Linux
Summary
ALPINE-CVE-2022-42919: Python 3.9.x before 3.9.16 and 3.10.x before 3.10.9 on Linux allows local privilege escalation in a non-default configuration. Affects python3 versions < 3.10.9-r0. Fixed in 3.10.9-r0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Python3 is a widely-used programming language known for its simplicity and versatility. It supports multiple programming paradigms and is commonly used for web development, data analysis, artificial intelligence, and more. However, certain versions of Python3 on Alpine Linux are susceptible to a local privilege escalation vulnerability due to improper handling of the multiprocessing library when using the forkserver start method.
Vulnerability Detail
The vulnerability arises in Python versions 3.9.x before 3.9.16 and 3.10.x before 3.10.9 on Linux systems. It allows local privilege escalation in non-default configurations. Specifically, when the multiprocessing library is utilized with the forkserver start method, it permits pickles to be deserialized from any user within the same local network namespace. This can lead to arbitrary code execution, allowing a local user to escalate their privileges to that of the user running the forkserver process. This issue is specific to Linux due to its support for abstract namespace sockets, which are not utilized by default in earlier versions of CPython.
How To Fix
Minimum fixed version
3.10.9-r0
This is the first release that contains the fix.
sudo apk add --upgrade python3
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can set the following configuration in your Python code to mitigate the risk: 'multiprocessing.util.abstract_sockets_supported = False'. This setting disables the use of abstract namespace sockets, reducing the vulnerability surface.
Conclusion
In summary, the local privilege escalation vulnerability in Python3 on Alpine Linux poses a significant risk to users running affected versions. It is crucial to update to the patched version or implement the recommended workaround to mitigate potential exploitation. Regular monitoring with tools like Vulert can help maintain security against such vulnerabilities.
See every vulnerability recorded for python3 →
FAQ
The CVSS score of this vulnerability is 7.8, indicating a high severity level.
Python 3.9.x before 3.9.16 and 3.10.x before 3.10.9 on Linux are affected by this vulnerability.
Local privilege escalation refers to a situation where a user gains elevated access to resources that are normally protected from the user, potentially allowing them to execute arbitrary code.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Vulert is a tool that monitors and alerts for open-source vulnerabilities in software using just a manifest file like package-lock.json, providing real-time insights.
References
Related vulnerabilities
Recent vulnerabilities recorded for python3.