Skip to content

Updating setuptools to patch CVE-2025-47273 #22094

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

Closed

Conversation

aaronmaxlevy
Copy link
Contributor

@aaronmaxlevy aaronmaxlevy commented Jun 4, 2025

Updating setuptools to patch CVE-2025-47273

Also updated Bazel to 7.4.0 due to bazelbuild/bazel#4327

Fixes #22165

@aaronmaxlevy aaronmaxlevy requested a review from a team as a code owner June 4, 2025 17:52
@aaronmaxlevy aaronmaxlevy requested review from ericsalo and removed request for a team June 4, 2025 17:52
@mkruskal-google mkruskal-google added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 9, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 9, 2025
@mkruskal-google mkruskal-google added python 🅰️ safe for tests Mark a commit as safe to run presubmits over labels Jun 9, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 9, 2025
@aaronmaxlevy
Copy link
Contributor Author

@mkruskal-google Can you allow tests to run again? I believe that my latest commit updating Bazel to 7.4.0 should fix this, at least partially. The reason why it wasn't working properly appears to have been bazelbuild/bazel#4327 , which was fixed in Bazel 7.4.0 .

@aaronmaxlevy
Copy link
Contributor Author

@mkruskal-google Can you allow tests to run again? I believe that my latest commit updating Bazel to 7.4.0 should fix this, at least partially. The reason why it wasn't working properly appears to have been bazelbuild/bazel#4327 , which was fixed in Bazel 7.4.0 .

Actually — scratch that. The culprit seems to be a new bug that I seem to have found in Bazel bazelbuild/bazel#26255 :(

I'll move this PR to Draft status while that Bazel bug is outstanding

@aaronmaxlevy aaronmaxlevy marked this pull request as draft June 11, 2025 03:40
@mkruskal-google mkruskal-google added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 11, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 11, 2025
@aaronmaxlevy aaronmaxlevy marked this pull request as ready for review June 30, 2025 17:45
@aaronmaxlevy
Copy link
Contributor Author

@mkruskal-google can you allow tests to run for this again? Per a suggestion from the Bazel team at bazelbuild/bazel#26255 (comment) I added an sh_binary wrapper and the build now succeeds locally for me.

@acozzette acozzette added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 30, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jun 30, 2025
@aaronmaxlevy
Copy link
Contributor Author

aaronmaxlevy commented Jul 1, 2025

@acozzette Thanks — looks like there are still some test failures here for a few reasons.

  1. GitHub CI is running using Bazel 7.1.2 still, despite my having updated the .bazeliskrc to use Bazel 7.4.0 (which is required due to Runfiles: support paths with spaces bazelbuild/bazel#4327 ). I can reproduce the failures locally on 7.1.2 but moving to 7.4.0 does fix it for me locally.

I believe that this can be updated in the files within .github/workflows, however from what I can tell, PRs from external forks (such as mine) that update the GitHub workflow files are not allowed as per https://github.com/protocolbuffers/protobuf/blob/main/.github/workflows/forked_pr_workflow_check.yml . What would the preferred path forward be here? Should / could someone from Google file a separate PR to update to Bazel 7.4.0 (both .bazeliskrc and in the GitHub workflow files)?

  1. The setup_wrapper.sh script that I added for the Python build doesn't seem to correctly find the setuptools path on Windows. I will work on a fix for this, as I only tested with macOS and Linux on my end :)

  2. Unknown C++ / CMake build errors that don't seem related to anything I've changed (especially since the CI tests are still running with Bazel 7.2.1, which is the only non-Python change on my branch). I just updated my fork branch with the latest commits from upstream so I'm hoping these will pass next time and were caused by staleness of my fork.

@acozzette
Copy link
Member

@aaronmaxlevy Thank you for all your work on this!

Unfortunately upgrading our Bazel version is a non-trivial process, because there are a handful of Docker images that need to be rebuilt in addition to updating .bazeliskrc and the .yml files. I will try to find time to do that later this afternoon or tomorrow, though.

Let me rerun the tests now to see if the CMake issue build error goes away.

@acozzette acozzette added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 1, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 1, 2025
@aaronmaxlevy
Copy link
Contributor Author

No problem :) Happy to help. Looks like the CMake issue has resolved now, which is good.

…d to fail on Windows and fallback to the default python path
@aaronmaxlevy aaronmaxlevy force-pushed the aaron_update_setuptools branch from 8b55fb5 to 6ce6928 Compare July 3, 2025 18:08
@aaronmaxlevy
Copy link
Contributor Author

aaronmaxlevy commented Jul 3, 2025

@acozzette the Windows test should pass now if you re-run it. Turns out that the Pip package installation stuff doesn't actually work on Windows. The current build process ends up falling back to the system python's installed version of setuptools on Windows from what I can tell, which is what I changed the new wrapper script to also do.

See

if "win" in ctx.os.name:
— if you look at recent successful Windows test / build output, you will see WARNING: could not install pip dependencies in the output, e.g. https://github.com/protocolbuffers/protobuf/actions/runs/16047228021/job/45281342761?pr=22509#step:4:566

@acozzette acozzette added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 7, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 7, 2025
copybara-service bot pushed a commit that referenced this pull request Jul 7, 2025
This is necessary for upgrading setuptools, because older Bazel versions apparently can't handle whitespace in file names: #22094

PiperOrigin-RevId: 778242489
copybara-service bot pushed a commit that referenced this pull request Jul 7, 2025
This is necessary for upgrading setuptools, because older Bazel versions apparently can't handle whitespace in file names: #22094

PiperOrigin-RevId: 780210543
@acozzette acozzette added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 7, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 7, 2025
@copybara-service copybara-service bot closed this in 508aba1 Jul 8, 2025
@aaronmaxlevy
Copy link
Contributor Author

@acozzette thank you so much for your help in getting this merged / rolled out!

@acozzette
Copy link
Member

You're welcome and thank you for sending us the fix!

@aaronmaxlevy
Copy link
Contributor Author

No problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python setuptools needs to be updated to 78.1.1 or later to address CVE-2025-47273
3 participants