Skip to content

Commit f219191

Browse files
(PA-6507) Update gem rexml from default to 3.2.9 for CVE-2024-35176
- The CVE was fixed from rexml version 3.2.7. - Patching for the CVE wasn't getting applied cleanly and had a lot of conflicts. So updated the gem version to 3.2.9 in the rexml component file. - rexml 3.2.7 requires strscan >= 3.0.9 which contains native extensions. We would need a compiler to build the extensions and there are jruby incompatibilities. This requirement has been relaxed starting from rexml 3.2.9. Therefore we update to rexml 3.2.9 here. - Added the change to _shared-agent-components since the CVE impacts both agent-runtime-main (ruby 3.2.4 using rexml 3.2.6) and agent-runtime-7.x (ruby 2.7.8 using rexml 3.2.3) - For solaris-10-sparc and solaris-11-sparc, we ignore the dependencies when installing rexml since the ruby in these platforms tries to install strscan (rexml's dependency) but fails while building native extensions. We can ignore installing strscan since it is shipped with ruby 2.7.8 as its default gem.
1 parent 9f3c265 commit f219191

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

configs/components/rubygem-rexml.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
component 'rubygem-rexml' do |pkg, settings, platform|
2-
pkg.version '3.2.6'
3-
pkg.md5sum 'a57288ae5afed07dd08c9f1302da7b25'
2+
pkg.version '3.2.9'
3+
pkg.md5sum '73fcf4d686d68dafbca57f941097ebf0'
44

5+
# If the platform is solaris with sparc architecture in agent-runtime-7.x project, we want to gem install rexml
6+
# ignoring the dependencies, this is because the pl-ruby version used in these platforms is ancient so it gets
7+
# confused when installing rexml. It tries to install rexml's dependency 'strscan' by building native extensions
8+
# but fails. We can ignore insalling that since strscan is already shipped with ruby 2.7.8 as its default gem.
9+
if platform.name =~ /solaris-(10|11)-sparc/ && settings[:ruby_version].to_i < 3
10+
settings["#{pkg.get_name}_gem_install_options".to_sym] = "--ignore-dependencies"
11+
end
12+
513
instance_eval File.read('configs/components/_base-rubygem.rb')
614
end

configs/projects/_shared-agent-components.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
proj.component 'rubygem-gettext'
6262
proj.component 'rubygem-fast_gettext'
6363
proj.component 'rubygem-ffi'
64+
proj.component 'rubygem-rexml'
6465

6566
if platform.is_windows? || platform.is_solaris? || platform.is_aix?
6667
proj.component 'rubygem-minitar'

0 commit comments

Comments
 (0)