Skip to content

Commit

Permalink
Merge pull request #3030 from haus/jruby-1_7
Browse files Browse the repository at this point in the history
Update rubygems to 2.4.8 to mitigate CVE-2015-4020
  • Loading branch information
enebo committed Jun 10, 2015
2 parents 311f12f + b1cf616 commit dc15103
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ruby/shared/rubygems.rb
Expand Up @@ -9,7 +9,7 @@
require 'thread'

module Gem
VERSION = '2.4.6'
VERSION = '2.4.8'
end

# Must be first since it unloads the prelude from 1.9.2
Expand Down
8 changes: 7 additions & 1 deletion lib/ruby/shared/rubygems/remote_fetcher.rb
Expand Up @@ -94,7 +94,13 @@ def api_endpoint(uri)
rescue Resolv::ResolvError
uri
else
URI.parse "#{uri.scheme}://#{res.target}#{uri.path}"
target = res.target.to_s.strip

if /\.#{Regexp.quote(host)}\z/ =~ target
return URI.parse "#{uri.scheme}://#{target}#{uri.path}"
end

uri
end
end

Expand Down

0 comments on commit dc15103

Please sign in to comment.