-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update bundled setuptools provided by ensurepip in current 3.8.x through 3.11.x to include fix for CVE-2022-40897? #102202
Comments
CVE-2022-40897 is a ReDoS in setuptools, fixed in setuptools 65.5.1 (released Nov 4, 2022): The The Before updating, Python 3.7-3.9 are security-fix only (https://devguide.python.org/versions/), let's first check with release managers @ambv and @ned-deily. A quick check shows the CI passes for 3.9: https://github.com/hugovk/cpython/actions/runs/4260373632 |
Regarding backporting to 3.7, see my comment on the PR. In short, I don't want to backport this to 3.7 as the benefits are minimal and the risks are high. |
@hugovk @ned-deily So, the security should be fixed in 3.10-3.12. Correct? |
Ultimately, it's up to the release managers for those releases but I expect they will be updated soon. However, your original question seems to be about an Alpine docker image with python3.9. If so, you should check with the maintainer of that image. It should be a trivial matter to update the image with the new version of setuptools. Or you can just update it yourself when running the image by using some variant of:
A CPython update to |
Also not needed for 3.12, setuptools was removed in #101039. |
To follow up on this, the current status is that we are still shipping various older versions of |
@ned-deily Beyond CVE-2022-40897 there aren't any additional vulnerabilities in setuptools. I don't think it's particularly bundersome to ask users to upgrade pip when using In fact, could we make |
We could but that approach was rejected in the original PEP proposing |
Mark as release blocker for 3.8, 3.9, and 3.10 decisions. |
@ned-deily Is there any tentative release date for the vulnerability fix? This issue came to us from our customer as high-priority issue. |
Looking for some updates on this vulnerability patching, thanks! |
So, a DoS can be caused by a package that's considered for download and installation (which can run arbitrary code), or by the site that serves such packages? @sethmlarson, you have more info; let me know (possibly privately) if we need to fix this somehow. Unfortunately, setuptools had breaking changes since 58.1 (and 65.5). |
@encukou I agree that there isn't much benefit to patching that CVE and it's only likely to cause breakages. @samruddhikhandale @bhupendra-vaishnav As far as finding a solution to your issue, it seems that scanners are alerting regardless of whether that file is completely inert and useless in the image. Maybe a way forward is to ensure pip and setuptools are bootstrapped to versions that you're happy with (ie |
We tried deleting the directory, but then
Yep, we already have that logic added, thanks! |
IIUC, this will break ensurepip, which breaks venv since venv relies on ensurepip to install a copy of pip (and setuptools) in the environment. |
Note that you can run
With that, let's close. It's not a notable security vulnerability in Python. Telling that to your security scanner is, in this case, up to you. @ambv @pablogsal, please tell me if I'm out of line and I should have left this decision to you. |
Just found the image are impacted. Any fix plan?
GHSA-r9hx-vwmv-q579
Linked PRs
The text was updated successfully, but these errors were encountered: