Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update bundled pip to address CVE-2023-5752 in cpython 3.9 & 3.10 #131860

Closed
briensea opened this issue Mar 29, 2025 · 7 comments
Closed

Update bundled pip to address CVE-2023-5752 in cpython 3.9 & 3.10 #131860

briensea opened this issue Mar 29, 2025 · 7 comments
Labels
3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir topic-ensurepip type-security A security issue

Comments

@briensea
Copy link

briensea commented Mar 29, 2025

Update bundled pip to address CVE-2023-5752 in cpython 3.9 & 3.10

Description:

A security vulnerability, CVE-2023-5752, has been identified in older versions of pip. The versions of pip bundled with CPython 3.9 and 3.10 are affected.

This results in users being required to manually update pip to mitigate the security vulnerability.

CPython versions affected:

  • 3.9 (bundled pip version outdated)
  • 3.10 (bundled pip version outdated)

Operating systems tested on:

  • Linux

Linked PRs

@picnixz picnixz added type-security A security issue stdlib Python modules in the Lib dir topic-ensurepip 3.10 only security fixes 3.9 only security fixes labels Mar 29, 2025
@picnixz
Copy link
Member

picnixz commented Mar 29, 2025

@sethmlarson @gpshead The CVE has a moderate severity and only affects users using pip install hg+ urls. Is this something we want to update?

Note that we can still update pip just after downloading it

@AA-Turner
Copy link
Member

@briensea thank you for opening the issue. As these are binaries distributed with Python, we generally have a trusted individual (e.g. a pip maintainer) make the pull request.

A

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label Mar 29, 2025
@briensea
Copy link
Author

Thanks, @AA-Turner. Is there a timeline for when this might be addressed? I understand that users can update pip after downloading, but for environments where the binaries are redistributed, relying on manual updates isn’t always ideal. Avoiding custom patches would be preferable, so I’m curious if there are plans to update the bundled version directly.

@picnixz
Copy link
Member

picnixz commented Mar 29, 2025

3.9 and 3.10 are sources only and thus are usually expected to be used either by downstream distributions, and they could apply their own patches, or by more experienced users that would compile Python from sources.

When I said that we can update pip, this is what pip suggests namely "a new pip version is available, install it using pip install -U pip", so it's also the usual way of upgrading that package.

Now, the CVE has a moderate severity, and it's only affecting mercurial installations. I don't know hwo much it's used but I don't think we necessarily need to publish a new source-only release for 3.9 and 3.10, hence why I asked Seth whether this should be treated as a security issue to patch.

@zware
Copy link
Member

zware commented Apr 1, 2025

See also gh-112516, gh-119778, gh-102202, etc. I would not expect updates to the bundled wheels in security branches unless there is a vulnerability identified that prevents safely using the bundled pip to update itself, and maybe not even then. In general, we assume that if a user is security-conscious enough to build and use a Python security-only release, they're also security-conscious enough to handle updating (or otherwise avoiding security issues from) ensurepip wheels.

I wonder if we should avoid this class of issues by removing ensurepip wheels from security releases entirely, and requiring that WHEEL_PKG_DIR be specified in order to use ensurepip from such a release.

@pradyunsg
Copy link
Member

As these are binaries distributed with Python, we generally have a trusted individual (e.g. a pip maintainer) make the pull request.

FWIW, this is no longer necessary.

https://github.com/python/cpython/blob/main/.github/workflows/verify-ensurepip-wheels.yml ensures that the binaries provided have the appropriate checksums.

@zware
Copy link
Member

zware commented Apr 4, 2025

Closing, for reasons mentioned above. If anyone wants to pursue the removal of wheels from security releases, a new issue for that can be opened.

@zware zware closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2025
@zware zware removed the pending The issue will be closed if no feedback is provided label Apr 4, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir topic-ensurepip type-security A security issue
Projects
None yet
Development

No branches or pull requests

5 participants