Close Menu
  • Home
  • Articles
    • Attacks
      • BEC
      • Data Breach
      • DDoS
      • Evasion Attacks
      • Injection
      • Malware
      • MITM
      • Phishing
      • Ransomware
      • RCE
      • Social Engineering
      • Spoofing
      • Spyware
    • Business and Policy
      • BCP and DRP
      • GRC
      • Regulations
    • Data Protection
      • DLP
      • DRM
      • Encryption
      • IAM
    • Future, Trends and Insight
      • AI
      • Events & Community
      • Emerging Tech
      • Expert Panel
      • Interviews With Experts
      • Insights
      • Study & Research
    • Resources
      • Guides
      • Tools
      • Training & Education
    • Security
      • API
      • Apps
      • Cloud
      • Critical Infrastructure
      • Endpoint
      • Hardware
      • IoT
      • Mobile
      • Network
      • OT
      • Port Security
      • Security Architecture
      • Software Development
      • Supply Chain
      • Zero Trust
    • Threats and Vulnerabilities
      • Emerging Threats
      • Insider Threats
      • Risk Management
      • Threat Intelligence
      • Zero Day
  • News and Exclusives
    • Latest News
    • ISB Exclusive
    • Positive News
  • Who We Are
    • About Us
    • Information Security Buzz Expert Panel​
    • Write for Us
    • Media Pack
  • Contact Us
  • Newsletter
Facebook X (Twitter) LinkedIn
Facebook X (Twitter) LinkedIn
Information Security BuzzInformation Security Buzz
  • Home
  • Articles
    • Attacks
      • BEC
      • Data Breach
      • DDoS
      • Evasion Attacks
      • Injection
      • Malware
      • MITM
      • Phishing
      • Ransomware
      • RCE
      • Social Engineering
      • Spoofing
      • Spyware
    • Business and Policy
      • BCP and DRP
      • GRC
      • Regulations
    • Data Protection
      • DLP
      • DRM
      • Encryption
      • IAM
    • Future, Trends and Insight
      • AI
      • Events & Community
      • Emerging Tech
      • Expert Panel
      • Interviews With Experts
      • Insights
      • Study & Research
    • Resources
      • Guides
      • Tools
      • Training & Education
    • Security
      • API
      • Apps
      • Cloud
      • Critical Infrastructure
      • Endpoint
      • Hardware
      • IoT
      • Mobile
      • Network
      • OT
      • Port Security
      • Security Architecture
      • Software Development
      • Supply Chain
      • Zero Trust
    • Threats and Vulnerabilities
      • Emerging Threats
      • Insider Threats
      • Risk Management
      • Threat Intelligence
      • Zero Day
  • News and Exclusives
    • Latest News
    • ISB Exclusive
    • Positive News
  • Who We Are
    • About Us
    • Information Security Buzz Expert Panel​
    • Write for Us
    • Media Pack
  • Contact Us
  • Newsletter
Subscribe
Information Security BuzzInformation Security Buzz
Home - Articles - Attacking Ruby Gem Security with CVE-2015-3900
Articles

Attacking Ruby Gem Security with CVE-2015-3900

ISBuzz TeamBy ISBuzz TeamJune 26, 2015Updated:July 4, 20245 Mins Read
Share LinkedIn Twitter Facebook Copy Link Email
Attacking Ruby Gem Security
Share
Facebook Twitter LinkedIn Email Copy Link
Quick AI Summary
ChatGPTClaudeGeminiGrokPerplexityDeepSeekCopilot

A Ruby gem is a standard packaging format used for Ruby libraries and applications.  This packaging format allows Ruby software developers a clearly defined format in which they can reliably build and distribute software.  Developer’s push Ruby gems to a distribution server (aka: a gem server) where by users can then install the Ruby application using “gem install gem_name”.

In a recent presentation, “Trojaned Gems: You can’t tell you’re using one” at THOTCON 0x6, we (Brandon Myers and Jonathan Claudius) shared some of our research looking at the security of the Ruby gem eco system.   The original goal of the research was merely to act as a driving means to improve our own Ruby gem security, but we felt what we discovered was worth sharing to help better protect others.

Summary of our Ruby Gem research

  • The RubyGems client has a “Gem Server Discovery” functionality, which uses a DNS SRV request for finding a gem server.  This functionality does not require that DNS replies come from the same security domain as the original gem source, allowing arbitrary redirection to attacker controlled gem servers (aka: CVE-2015-3900).
  • CVE-2015-3900 allows an attacker to redirect a RubyGem client that is using HTTPS to an attacker controlled gem server; this effectively bypasses HTTPS verification on the original HTTPS gem source.  This means that the attacker can force the user to install malicious/trojaned gems.
  • We wrote a fully functional Gem Trojaning service that demonstrates how an attacker could simply Trojan Ruby gems transparently over the wire while the user was installing them.
  • Ruby gem signing is an obvious mitigation strategy for the above mentioned transport security issues.  However, gem signing is barely used in the Ruby gem eco-system (0 of the top 10 gems are signed).  See our blog post on how to sign gems here.
  • We demonstrated that even if you are using signed gems, by using CVE-2015-3900, you must be using the HighSecurity trust policy or gems can still be trojaned in transit due to a signing downgrade attack.
  • After getting CVE-2015-3900 fixed, we identified a bypass allowing attackers to redirect users to domains that end with the original security domain (aka: CVE-2015-4020).  For example: attackercontrolled rubygems.org.
  • These issues affect the RubyGems client and any environment that embeds the RubyGems client.  Ruby, JRuby, and Rubinuius have all been confirmed to embed the RubyGems client and are affected by CVE-2015-3900.
  • The mechanism for updating to a fixed version of RubyGems also uses the same vulnerable functionality we’re trying to protect.

How many are affected by this vulnerability?

We recently collaborated with Anthony Kasza, a security researcher at OpenDNS, to help understand the number of Ruby gem installations that are potentially affected by this vulnerability.  Anthony was able to confirm that OpenDNS sees roughly 24,000 requests for the DNS SRV record in question per day, inferring 24,000 gem installations per day if we discount local system caches, gem dependencies, and gem installation typos.   Given that OpenDNS sees about two percent of the world’s Internet traffic—assuming each region of the world has the same likelihood of installing gem packages—that’s a possible 1.2 Million gem installations per day across the entire Internet (or 438 Million gem installs per year) that could be affected.

Trustwave has also deployed signatures to detect this vulnerability with our managed IDS/IPS service and have been monitoring for exploitation attempts on this vulnerability for some time.  Thankfully, at the time of this writing, we’ve yet to see any “in-the-wild” exploitation attempts outside of our research lab, which is great news.  However, we believe it to be only a matter of time before criminals get wise to this attack vector and make use of it, so we advise everyone to deploy detections now for when or if it sees exploitation in the wild.  For more information on Trustwave IDS/IPS solutions, see here.  For existing Trustwave IDS/IPS customers, the signature name is “RubyGems DNS hijack attempt detected (CVE-2015-3900)”.

What should you do?

  • Upgrade your RubyGem client in all of your Ruby environments to 2.4.8 or greater.  The most common way to do so is by running the “gem update –system” command.  You can verify after with “gem –-version”.  You can have more than one RubyGem client installed per system.
  • Verify that all your Ruby gem sources are using HTTPS.  This can be verified using the “gem sources” command, which will list all your gem sources.  Using the ‘—add’ or ‘—remove” switches will help you manage the list.
  • As a gem producer, start considering signing your gems.  This means that you can provide options to your users as to whether they want to verify the integrity of your gem.
  • As a gem consumer, start using gem installation trust policies and use the strongest policy supported by your gem provider.  Trust policies can be used with the “gem install” command by using the –P switch and will look something like this “gem install –P HighSecurity gem_name”.
  • Consider reading up on or contributing to TUF (The Update Framework) to better protect your update mechanisms to help protect against the attacks mentioned above.

[su_box title=”About Trustwave” style=”noise” box_color=”#336588″]

Trustwave helps businesses fight cybercrime, protect data and reduce security risk. With cloud and managed security services, integrated technologies and a team of security experts, ethical hackers and researchers, Trustwave enables businesses to transform the way they manage their information security and compliance programs. More than 2.7 million businesses are enrolled in the Trustwave TrustKeeper® cloud platform, through which Trustwave delivers automated, efficient and cost-effective data protection, risk management and threat intelligence. Trustwave is a privately held company, headquartered in Chicago, with customers in 96 countries.[/su_box]

ISBuzz Team
  • ISBuzz Team
    Air Canada Data Breach: BianLian Extortion Group Claims A Massive Heist Contrary To Airline’s Earlier Statement
  • ISBuzz Team
    Unprecedented DDoS Attack Rocks The Web: Tech Giants Reveal A Digital Tsunami
  • ISBuzz Team
    CISA Flags High-Severity Adobe Acrobat Reader Flaw Amid Active Exploits
  • ISBuzz Team
    Curl Security Alert: Patching A Critical Bug Averting Potential Cyber Catastrophe

The opinions expressed in this post belong to the individual contributors and do not necessarily reflect the views of Information Security Buzz.

Share. Facebook Twitter LinkedIn Email Copy Link

Related Posts

Exploited Faster, Patched Slower: Verizon DBIR 2026 Shows Security Teams Losing Ground

May 20, 20265 Mins Read

Security’s Blind Spot: The Threats Hiding in “Low-Severity” Alerts

May 6, 20265 Mins Read

Visual data is the blind spot in enterprise security: that’s about to change

May 4, 20267 Mins Read
ISB-Bora-Side-Bar

 
ISB-Bora-Side-Bar
Black ISB Logo

Information Security Buzz is an independent resource that provides the experts’ comments, analysis, and opinion on the latest Cybersecurity news and topics

X (Twitter) LinkedIn Facebook RSS

Working With Us

  • About Us
  • Advertise With Us
  • Contact Us

Write For Us

  • How To Contribute

The Pages

  • Privacy Policy
  • Cookie Policy
  • AI Policy
  • Terms & Conditions
  • Copyright Notice

Information Security Buzz and all its contents are copyright © 2014-2025. All rights reserved. All third-party trademarks are recognized.

Type above and press Enter to search. Press Esc to cancel.

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}