VYPR
High severity7.5NVD Advisory· Published Aug 31, 2017· Updated May 13, 2026

CVE-2017-0900

CVE-2017-0900

Description

RubyGems version 2.6.12 and earlier is vulnerable to maliciously crafted gem specifications to cause a denial of service attack against RubyGems clients who have issued a query command.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
rubygems-updateRubyGems
< 2.6.132.6.13

Patches

1
8a38a4fc24c6

Truncate summaries to 100,000 characters in the query command

https://github.com/rubygems/rubygemsSamuel GiddinsAug 25, 2017via ghsa
4 files changed · +55 1
  • lib/rubygems/commands/query_command.rb+2 1 modified
    @@ -353,7 +353,8 @@ def spec_platforms entry, platforms
       end
     
       def spec_summary entry, spec
    -    entry << "\n\n" << format_text(spec.summary, 68, 4)
    +    summary = truncate_text(spec.summary, "the summary for #{spec.full_name}")
    +    entry << "\n\n" << format_text(summary, 68, 4)
       end
     
     end
    
  • lib/rubygems/text.rb+6 0 modified
    @@ -13,6 +13,12 @@ def clean_text(text)
         text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".".freeze)
       end
     
    +  def truncate_text(text, description, max_length = 100_000)
    +    raise ArgumentError, "max_length must be positive" unless max_length > 0
    +    return text if text.size <= max_length
    +    "Truncating #{description} to #{max_length.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse} characters:\n" + text[0, max_length]
    +  end
    +
       ##
       # Wraps +text+ to +wrap+ characters and optionally indents by +indent+
       # characters
    
  • test/rubygems/test_gem_commands_query_command.rb+40 0 modified
    @@ -156,6 +156,46 @@ def test_execute_details_cleans_text
         This is a lot of text. This is a lot of text. This is a lot of text.
         This is a lot of text.
     
    +pl (1)
    +    Platform: i386-linux
    +    Author: A User
    +    Homepage: http://example.com
    +
    +    this is a summary
    +    EOF
    +
    +    assert_equal expected, @ui.output
    +    assert_equal '', @ui.error
    +  end
    +
    +  def test_execute_details_truncates_summary
    +    spec_fetcher do |fetcher|
    +      fetcher.spec 'a', 2 do |s|
    +        s.summary = 'This is a lot of text. ' * 10_000
    +        s.authors = ["Abraham Lincoln \x01", "\x02 Hirohito"]
    +        s.homepage = "http://a.example.com/\x03"
    +      end
    +
    +      fetcher.legacy_platform
    +    end
    +
    +    @cmd.handle_options %w[-r -d]
    +
    +    use_ui @ui do
    +      @cmd.execute
    +    end
    +
    +    expected = <<-EOF
    +
    +*** REMOTE GEMS ***
    +
    +a (2)
    +    Authors: Abraham Lincoln ., . Hirohito
    +    Homepage: http://a.example.com/.
    +
    +    Truncating the summary for a-2 to 100,000 characters:
    +#{"    This is a lot of text. This is a lot of text. This is a lot of text.\n" * 1449}    This is a lot of te
    +
     pl (1)
         Platform: i386-linux
         Author: A User
    
  • test/rubygems/test_gem_text.rb+7 0 modified
    @@ -78,4 +78,11 @@ def test_levenshtein_distance_replace
         assert_equal 7, levenshtein_distance("xxxxxxx", "ZenTest")
         assert_equal 7, levenshtein_distance("zentest", "xxxxxxx")
       end
    +
    +  def test_truncate_text
    +    assert_equal "abc", truncate_text("abc", "desc")
    +    assert_equal "Truncating desc to 2 characters:\nab", truncate_text("abc", "desc", 2)
    +    s = "ab" * 500_001
    +    assert_equal "Truncating desc to 1,000,000 characters:\n#{s[0, 1_000_000]}", truncate_text(s, "desc", 1_000_000)
    +  end
     end
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

16

News mentions

0

No linked articles in our index yet.