Skip to content

[Medium] Upgrade ruby to 3.1.7 to fix CVE-2024-39908 #13764

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

Merged
merged 2 commits into from
Jun 17, 2025

Conversation

kevin-b-lockwood
Copy link
Contributor

@kevin-b-lockwood kevin-b-lockwood commented May 13, 2025

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./SPECS/LICENSES-AND-NOTICES/data/licenses.json, ./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md, ./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • If you are adding/removing a .spec file that has multiple-versions supported, please add @microsoft/cbl-mariner-multi-package-reviewers team as reviewer (Eg. golang has 2 versions 1.18, 1.21+)
  • Ready to merge

Summary

Upgrade ruby to 3.3.2 to fix CVE-2024-39908

Also delete obsolete or irrelevant patches

This is my first time upgrading ruby, please let me know if there's something
I messed up or missed.

Change Log
Does this affect the toolchain?

NO

Links to CVEs
Test Methodology
  • Local build

@kevin-b-lockwood kevin-b-lockwood requested a review from a team as a code owner May 13, 2025 00:04
Copy link
Contributor

@kgodara912 kgodara912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this stage of project, major version upgrade may cause stability issues. It is better to check once the minor version release notes corresponding to ruby-3.1.7 and see if that is good enough to fix the CVE.

@kevin-b-lockwood
Copy link
Contributor Author

At this stage of project, major version upgrade may cause stability issues. It is better to check once the minor version release notes corresponding to ruby-3.1.7 and see if that is good enough to fix the CVE.

I was going off of the triage notes:
image
which told me to upgrade to 3.3.2. I can look at 3.1.7 if that is preferred.

@Kanishk-Bansal
Copy link
Contributor

This CVE affects REXML gem 3.3.1 or prior
v3.1.7 has REXML-3.3.4 which solves our purpose!

Nice finding @kgodara912

@kevin-b-lockwood
Copy link
Contributor Author

Ok, I'll pivot and update to 3.1.7 instead.

@kevin-b-lockwood kevin-b-lockwood marked this pull request as draft May 14, 2025 21:18
Also remove obsolete patches, edit one patch to remove changes made
redundant by the upgrade
@kevin-b-lockwood kevin-b-lockwood force-pushed the kevin-b-lockwood/ruby-2.0-CVE branch from 7724e46 to 724902d Compare May 15, 2025 21:58
@kevin-b-lockwood kevin-b-lockwood marked this pull request as ready for review May 15, 2025 21:58
@Kanishk-Bansal Kanishk-Bansal changed the title [Medium] Upgrade ruby to 3.3.2 to fix CVE-2024-39908 [Medium] Upgrade ruby to 3.1.7 to fix CVE-2024-39908 May 16, 2025
Copy link
Contributor

@Kanishk-Bansal Kanishk-Bansal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all #Patch in SPECS

Copy link
Contributor

@kgodara912 kgodara912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buddy build. Minor version upgrade for ruby. Please correct above PR description with proper CVE numbers and what patches removed correctly.

Copy link
Contributor

@kgodara912 kgodara912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor version upgrade. The one, non-removed patch, is upgraded with following upstream references,

https://github.com/ruby/uri/commit/9010ee2536adda10a0555ae1ed6fe2f5808e6bf1
https://github.com/ruby/uri/commit/9d7bcef1e6ad23c9c6e4932f297fb737888144c8

Buddy build is fine. LGTM.

@kgodara912 kgodara912 self-requested a review May 26, 2025 09:44
@@ -82,8 +82,8 @@ Name: ruby
# TODO: When changing ruby version, these gemified stdlib
# provides should be versioned according to the ruby version.
# More info: https://stdgems.org/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the above versions specified, do they also need new numbers based on the new ruby version? For e.g. is zlib_version 2.1.1 still valid or it needs upgraded number, similarly for others as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these are correct, I ran the get_gem_versions.sh script and didn't see a change, but I can run it again and double check if you wish.

Copy link
Contributor

@kgodara912 kgodara912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as developer verified that bundled versions are correct.

@0xba1a 0xba1a merged commit e4abd05 into microsoft:main Jun 17, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
main PR Destined for main Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants