rubygems-update 3.2.19 → 3.2.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba52b4a462e0da9cf903bc69e61096bd08a3281bd6d174cc35abf975099eb737
4
- data.tar.gz: 791cfa5488c4d56d48b60bc372c16be5d426d53bbb603c8b95fbaf20bbc4b0c8
3
+ metadata.gz: beb9904852db18bc2cb58e157631c112d2951ea7df0bac7f63a1838ffba5ddbc
4
+ data.tar.gz: a987e2d21ffd319e2dc0c0ae4d913b5f1d3ad6480783addbc4faaee5ad540b86
5
5
  SHA512:
6
- metadata.gz: 89c0efcd3e1f639edfac4af460a7bbb891f13cae5b1dc5c58829e10f0a64d9fe04c0d0e58c108b6dbff8b7f7e7f77d96edbe993dfbb6086ae998fb68b9b05793
7
- data.tar.gz: a01059a530f414a334a8d16af04d8507ca6ca10891e869b395795bacb5748822b44e98eb4491f3f98dc781d72b9c4a228700eb1ee8ff18fdeb1a50aa14482114
6
+ metadata.gz: cc88c86f3691d8b07ce12056d0f1e762de188fe3775d3f80a83c2912020ed039b34ce50e95e118bfe8f6077cdb6ced949cb9c6147699292c6f45e3703b5e0087
7
+ data.tar.gz: a91aa086be326926df974bbf2734c94e9ee1dfebc1e1b0a23474d64156c46249448e398baaf38fa4fedbdb2e006fd40ef94949112271842a89a1adc2a1b952a9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 3.2.20 / 2021-06-11
2
+
3
+ ## Security fixes:
4
+
5
+ * Verify plaform before installing to avoid potential remote code
6
+ execution. Pull request #4667 by sonalkr132
7
+
8
+ ## Enhancements:
9
+
10
+ * Add better specification policy error description. Pull request #4658 by
11
+ ceritium
12
+
1
13
  # 3.2.19 / 2021-05-31
2
14
 
3
15
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -538,6 +538,7 @@ test/rubygems/invalidchild_cert.pem
538
538
  test/rubygems/invalidchild_cert_32.pem
539
539
  test/rubygems/invalidchild_key.pem
540
540
  test/rubygems/packages/ascii_binder-0.1.10.1.gem
541
+ test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem
541
542
  test/rubygems/plugin/exception/rubygems_plugin.rb
542
543
  test/rubygems/plugin/load/rubygems_plugin.rb
543
544
  test/rubygems/plugin/standarderror/rubygems_plugin.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 2.2.20 (June 11, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Don't print bug report template on server side errors [#4663](https://github.com/rubygems/rubygems/pull/4663)
6
+ - Don't load `resolv` unnecessarily [#4640](https://github.com/rubygems/rubygems/pull/4640)
7
+
8
+ ## Bug fixes:
9
+
10
+ - Fix `bundle outdated` edge case [#4648](https://github.com/rubygems/rubygems/pull/4648)
11
+ - Fix `bundle check` with scoped rubygems sources [#4639](https://github.com/rubygems/rubygems/pull/4639)
12
+
13
+ ## Performance:
14
+
15
+ - Don't use `extra_rdoc_files` with md files in gemspec to make installing bundler with docs faster [#4628](https://github.com/rubygems/rubygems/pull/4628)
16
+
1
17
  # 2.2.19 (May 31, 2021)
2
18
 
3
19
  ## Bug fixes:
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
39
39
  # include the gemspec itself because warbler breaks w/o it
40
40
  s.files += %w[bundler.gemspec]
41
41
 
42
- s.extra_rdoc_files = %w[CHANGELOG.md LICENSE.md README.md]
42
+ s.files += %w[CHANGELOG.md LICENSE.md README.md]
43
43
  s.bindir = "exe"
44
44
  s.executables = %w[bundle bundler]
45
45
  s.require_paths = ["lib"]
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2021-05-31".freeze
8
- @git_commit_sha = "43f80b12c0".freeze
7
+ @built_at = "2021-06-11".freeze
8
+ @git_commit_sha = "4c510a34a4".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -11,9 +11,11 @@ module Bundler
11
11
  def run
12
12
  Bundler.settings.set_command_option_if_given :path, options[:path]
13
13
 
14
+ definition = Bundler.definition
15
+ definition.validate_runtime!
16
+
14
17
  begin
15
- definition = Bundler.definition
16
- definition.validate_runtime!
18
+ definition.resolve_only_locally!
17
19
  not_installed = definition.missing_specs
18
20
  rescue GemNotFound, VersionConflict
19
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -147,6 +147,8 @@ module Bundler
147
147
 
148
148
  def retrieve_active_spec(definition, current_spec)
149
149
  active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
150
+ return unless active_spec
151
+
150
152
  return active_spec if strict
151
153
 
152
154
  active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
@@ -160,6 +160,12 @@ module Bundler
160
160
  @disable_multisource
161
161
  end
162
162
 
163
+ def resolve_only_locally!
164
+ @remote = false
165
+ sources.local_only!
166
+ resolve
167
+ end
168
+
163
169
  def resolve_with_cache!
164
170
  sources.cached!
165
171
  resolve
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "base"
4
- require "rubygems/remote_fetcher"
5
4
 
6
5
  module Bundler
7
6
  class Fetcher
@@ -49,8 +49,6 @@ module Bundler
49
49
  "Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
50
50
  else request_issue_report_for(error)
51
51
  end
52
- rescue StandardError
53
- raise error
54
52
  end
55
53
 
56
54
  def exit_status(error)
@@ -111,7 +109,7 @@ module Bundler
111
109
  First, try this link to see if there are any existing issue reports for this error:
112
110
  #{issues_url(e)}
113
111
 
114
- If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
112
+ If there aren't any reports for this error yet, please copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
115
113
  https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md
116
114
  EOS
117
115
  end
@@ -526,13 +526,14 @@ module Bundler
526
526
  Bundler::Retry.new("download gem from #{uri}").attempts do
527
527
  fetcher.download(spec, uri, path)
528
528
  end
529
+ rescue Gem::RemoteFetcher::FetchError => e
530
+ raise Bundler::HTTPError, "Could not download gem from #{uri} due to underlying error <#{e.message}>"
529
531
  end
530
532
 
531
533
  def gem_remote_fetcher
532
- require "resolv"
534
+ require "rubygems/remote_fetcher"
533
535
  proxy = configuration[:http_proxy]
534
- dns = Resolv::DNS.new
535
- Gem::RemoteFetcher.new(proxy, dns)
536
+ Gem::RemoteFetcher.new(proxy)
536
537
  end
537
538
 
538
539
  def gem_from_path(path, policy = nil)
@@ -36,6 +36,8 @@ module Bundler
36
36
 
37
37
  def local!; end
38
38
 
39
+ def local_only!; end
40
+
39
41
  def cached!; end
40
42
 
41
43
  def remote!; end
@@ -26,6 +26,12 @@ module Bundler
26
26
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
27
27
  end
28
28
 
29
+ def local_only!
30
+ @specs = nil
31
+ @allow_local = true
32
+ @allow_remote = false
33
+ end
34
+
29
35
  def local!
30
36
  return if @allow_local
31
37
 
@@ -132,6 +132,10 @@ module Bundler
132
132
  false
133
133
  end
134
134
 
135
+ def local_only!
136
+ all_sources.each(&:local_only!)
137
+ end
138
+
135
139
  def cached!
136
140
  all_sources.each(&:cached!)
137
141
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.19".freeze
4
+ VERSION = "2.2.20".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.19".freeze
11
+ VERSION = "3.2.20".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -728,6 +728,10 @@ class Gem::Installer
728
728
  raise Gem::InstallError, "#{spec} has an invalid extensions"
729
729
  end
730
730
 
731
+ if spec.platform.to_s =~ /\R/
732
+ raise Gem::InstallError, "#{spec.platform} is an invalid platform"
733
+ end
734
+
731
735
  unless spec.specification_version.to_s =~ /\A\d+\z/
732
736
  raise Gem::InstallError, "#{spec} has an invalid specification_version"
733
737
  end
@@ -124,25 +124,26 @@ class Gem::SpecificationPolicy
124
124
  end
125
125
 
126
126
  metadata.each do |key, value|
127
+ entry = "metadata['#{key}']"
127
128
  if !key.kind_of?(String)
128
129
  error "metadata keys must be a String"
129
130
  end
130
131
 
131
132
  if key.size > 128
132
- error "metadata key too large (#{key.size} > 128)"
133
+ error "metadata key is too large (#{key.size} > 128)"
133
134
  end
134
135
 
135
136
  if !value.kind_of?(String)
136
- error "metadata values must be a String"
137
+ error "#{entry} value must be a String"
137
138
  end
138
139
 
139
140
  if value.size > 1024
140
- error "metadata value too large (#{value.size} > 1024)"
141
+ error "#{entry} value is too large (#{value.size} > 1024)"
141
142
  end
142
143
 
143
144
  if METADATA_LINK_KEYS.include? key
144
145
  if value !~ VALID_URI_PATTERN
145
- error "metadata['#{key}'] has invalid link: #{value.inspect}"
146
+ error "#{entry} has invalid link: #{value.inspect}"
146
147
  end
147
148
  end
148
149
  end
@@ -553,6 +553,10 @@ class Gem::TestCase < Test::Unit::TestCase
553
553
  Gem.pre_uninstall_hooks.clear
554
554
  end
555
555
 
556
+ def without_any_upwards_gemfiles
557
+ ENV["BUNDLE_GEMFILE"] = File.join(@tempdir, "Gemfile")
558
+ end
559
+
556
560
  ##
557
561
  # A git_gem is used with a gem dependencies file. The gem created here
558
562
  # has no files, just a gem specification for the given +name+ and +version+.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.19"
5
+ s.version = "3.2.20"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -6,14 +6,12 @@ class TestGemBundlerVersionFinder < Gem::TestCase
6
6
  super
7
7
 
8
8
  @argv = ARGV.dup
9
- @env = ENV.to_hash.clone
10
- ENV.delete("BUNDLER_VERSION")
11
9
  @dollar_0 = $0
10
+ without_any_upwards_gemfiles
12
11
  end
13
12
 
14
13
  def teardown
15
14
  ARGV.replace @argv
16
- ENV.replace @env
17
15
  $0 = @dollar_0
18
16
 
19
17
  super
@@ -3,6 +3,12 @@ require 'rubygems/test_case'
3
3
  require 'rubygems/dependency'
4
4
 
5
5
  class TestGemDependency < Gem::TestCase
6
+ def setup
7
+ super
8
+
9
+ without_any_upwards_gemfiles
10
+ end
11
+
6
12
  def test_initialize
7
13
  d = dep "pkg", "> 1.0"
8
14
 
@@ -1776,6 +1776,26 @@ gem 'other', version
1776
1776
  end
1777
1777
  end
1778
1778
 
1779
+ def test_pre_install_checks_malicious_platform_before_eval
1780
+ gem_with_ill_formated_platform = File.expand_path("packages/ill-formatted-platform-1.0.0.10.gem", __dir__)
1781
+
1782
+ installer = Gem::Installer.at(
1783
+ gem_with_ill_formated_platform,
1784
+ :install_dir => @gem_home,
1785
+ :user_install => false,
1786
+ :force => true
1787
+ )
1788
+
1789
+ use_ui @ui do
1790
+ e = assert_raise Gem::InstallError do
1791
+ installer.pre_install_checks
1792
+ end
1793
+
1794
+ assert_equal "x86-mswin32\n system('id > /tmp/nyangawa')# is an invalid platform", e.message
1795
+ assert_empty @ui.output
1796
+ end
1797
+ end
1798
+
1779
1799
  def test_shebang
1780
1800
  installer = setup_base_installer
1781
1801
 
@@ -3612,7 +3612,7 @@ Did you mean 'Ruby'?
3612
3612
  @m2.validate
3613
3613
  end
3614
3614
 
3615
- assert_equal "metadata key too large (129 > 128)", e.message
3615
+ assert_equal "metadata key is too large (129 > 128)", e.message
3616
3616
  end
3617
3617
  end
3618
3618
 
@@ -3629,7 +3629,7 @@ Did you mean 'Ruby'?
3629
3629
  @m2.validate
3630
3630
  end
3631
3631
 
3632
- assert_equal "metadata values must be a String", e.message
3632
+ assert_equal "metadata['fail'] value must be a String", e.message
3633
3633
  end
3634
3634
  end
3635
3635
 
@@ -3646,7 +3646,7 @@ Did you mean 'Ruby'?
3646
3646
  @m2.validate
3647
3647
  end
3648
3648
 
3649
- assert_equal "metadata value too large (1025 > 1024)", e.message
3649
+ assert_equal "metadata['fail'] value is too large (1025 > 1024)", e.message
3650
3650
  end
3651
3651
  end
3652
3652
 
@@ -8,6 +8,8 @@ class TestKernel < Gem::TestCase
8
8
  @old_path = $:.dup
9
9
 
10
10
  util_make_gems
11
+
12
+ without_any_upwards_gemfiles
11
13
  end
12
14
 
13
15
  def teardown
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.19
4
+ version: 3.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2021-05-31 00:00:00.000000000 Z
19
+ date: 2021-06-11 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -594,6 +594,7 @@ files:
594
594
  - test/rubygems/invalidchild_cert_32.pem
595
595
  - test/rubygems/invalidchild_key.pem
596
596
  - test/rubygems/packages/ascii_binder-0.1.10.1.gem
597
+ - test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem
597
598
  - test/rubygems/plugin/exception/rubygems_plugin.rb
598
599
  - test/rubygems/plugin/load/rubygems_plugin.rb
599
600
  - test/rubygems/plugin/standarderror/rubygems_plugin.rb
@@ -771,7 +772,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
771
772
  - !ruby/object:Gem::Version
772
773
  version: '0'
773
774
  requirements: []
774
- rubygems_version: 3.2.19
775
+ rubygems_version: 3.2.20
775
776
  signing_key:
776
777
  specification_version: 4
777
778
  summary: RubyGems is a package management framework for Ruby.