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.
| Package | Affected versions | Patched versions |
|---|---|---|
rubygems-updateRubyGems | < 2.6.13 | 2.6.13 |
Patches
18a38a4fc24c6Truncate summaries to 100,000 characters in the query command
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- blog.rubygems.org/2017/08/27/2.6.13-released.htmlnvdPatchVendor AdvisoryWEB
- github.com/rubygems/rubygems/commit/8a38a4fc24c6591e6c8f43d1fadab6efeb4d6251nvdPatchThird Party AdvisoryWEB
- hackerone.com/reports/243003nvdExploitThird Party AdvisoryWEB
- www.securityfocus.com/bid/100579nvdThird Party AdvisoryVDB Entry
- www.securitytracker.com/id/1039249nvdThird Party AdvisoryVDB Entry
- access.redhat.com/errata/RHSA-2017:3485nvdThird Party AdvisoryWEB
- access.redhat.com/errata/RHSA-2018:0378nvdThird Party AdvisoryWEB
- access.redhat.com/errata/RHSA-2018:0583nvdThird Party AdvisoryWEB
- access.redhat.com/errata/RHSA-2018:0585nvdThird Party AdvisoryWEB
- github.com/advisories/GHSA-p7f2-rr42-m9xmghsaADVISORY
- lists.debian.org/debian-lts-announce/2018/07/msg00012.htmlnvdMailing ListThird Party AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2017-0900ghsaADVISORY
- security.gentoo.org/glsa/201710-01nvdThird Party AdvisoryWEB
- www.debian.org/security/2017/dsa-3966nvdThird Party AdvisoryWEB
- web.archive.org/web/20190212090616/http://www.securitytracker.com/id/1039249ghsaWEB
- web.archive.org/web/20200227143907/http://www.securityfocus.com/bid/100579ghsaWEB
News mentions
0No linked articles in our index yet.