RubyGems DNS flaw now patched after second try

Those using the distribution client are advised to patch immediately to version 2.4.8 or higher

RubyGem has released a second fix for a flaw that could be used to substitute a legitimate Ruby program with malware during downloading.

RubyGem has released a second fix for a flaw that could be used to substitute a legitimate Ruby program with malware during downloading.

A revised patch has been released for a flaw in the distribution platform for Ruby applications, RubyGems, which could be used to deliver malware to someone trying to download a program.

RubyGems lets people search for a "gem," which is a packaging format for Ruby applications and code libraries. Ruby developers publish a gem when an application is ready.

Security researchers from Trustwave found a problem with the platform. When people search for a gem, RubyGems uses a DNS (Domain Name System) SRV record request to find a server hosting a particular gem.

The request, however, "does not require that DNS replies come from the same security domain as the original gem source," according to a writeup, which Trustwave plans to release on its blog on Tuesday.

An attacker using the flaw could redirect a RubyGems client to download a gem from a different server and instead supply a malicious program, Trustwave wrote. It then bypasses any SSL/TLS check.

"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," Trustwave wrote.

Most gems aren't digitally signed, either, so there's no second check to ensure a program is what it purports to be. Some 1.2 million gems are installed a day, so there's a large potential group of victims, according to Trustwave, which also collaborated with OpenDNS to get insight on the number of DNS SRV requests for gems.

RubyGems issued a patch for the flaw in mid-May, but it was incomplete, wrote Jonathan Claudius, lead security researcher at Trustwave, in an email. The organization released a second patch on June 8. The fix validates the SRV record under the original domain, according to a RubyGems blog post.

Trustwave decided to hold off publishing information on the flaw until now to give people time to patch, Claudius said. "Users are slow to fix it," he wrote.

The flaw is CVE-2015-3900, and users should be running version 2.4.8 or greater of RubyGems. Versions between 2.0 and 2.4.6 are vulnerable.

Send news tips and comments to jeremy_kirk@idg.com. Follow me on Twitter: @jeremy_kirk

Join the CSO newsletter!

Error: Please check your email address.

Tags trustwavesecurityExploits / vulnerabilities

More about TrustwaveTwitter

Show Comments

Featured Whitepapers

Editor's Recommendations

Solution Centres

Stories by Jeremy Kirk

Latest Videos

  • 150x50

    CSO Webinar: The Human Factor - Your people are your biggest security weakness

    ​Speakers: David Lacey, Researcher and former CISO Royal Mail David Turner - Global Risk Management Expert Mark Guntrip - Group Manager, Email Protection, Proofpoint

    Play Video

  • 150x50

    CSO Webinar: Current ransomware defences are failing – but machine learning can drive a more proactive solution

    Speakers • Ty Miller, Director, Threat Intelligence • Mark Gregory, Leader, Network Engineering Research Group, RMIT • Jeff Lanza, Retired FBI Agent (USA) • Andy Solterbeck, VP Asia Pacific, Cylance • David Braue, CSO MC/Moderator What to expect: ​Hear from industry experts on the local and global ransomware threat landscape. Explore a new approach to dealing with ransomware using machine-learning techniques and by thinking about the problem in a fundamentally different way. Apply techniques for gathering insight into ransomware behaviour and find out what elements must go into a truly effective ransomware defence. Get a first-hand look at how ransomware actually works in practice, and how machine-learning techniques can pick up on its activities long before your employees do.

    Play Video

  • 150x50

    CSO Webinar: Get real about metadata to avoid a false sense of security

    Speakers: • Anthony Caruana – CSO MC and moderator • Ian Farquhar, Worldwide Virtual Security Team Lead, Gigamon • John Lindsay, Former CTO, iiNet • Skeeve Stevens, Futurist, Future Sumo • David Vaile - Vice chair of APF, Co-Convenor of the Cyberspace Law And Policy Community, UNSW Law Faculty This webinar covers: - A 101 on metadata - what it is and how to use it - Insight into a typical attack, what happens and what we would find when looking into the metadata - How to collect metadata, use this to detect attacks and get greater insight into how you can use this to protect your organisation - Learn how much raw data and metadata to retain and how long for - Get a reality check on how you're using your metadata and if this is enough to secure your organisation

    Play Video

  • 150x50

    CSO Webinar: How banking trojans work and how you can stop them

    CSO Webinar: How banking trojans work and how you can stop them Featuring: • John Baird, Director of Global Technology Production, Deutsche Bank • Samantha Macleod, GM Cyber Security, ME Bank • Sherrod DeGrippo, Director of Emerging Threats, Proofpoint (USA)

    Play Video

  • 150x50

    IDG Live Webinar:The right collaboration strategy will help your business take flight

    Speakers - Mike Harris, Engineering Services Manager, Jetstar - Christopher Johnson, IT Director APAC, 20th Century Fox - Brent Maxwell, Director of Information Systems, THE ICONIC - IDG MC/Moderator Anthony Caruana

    Play Video

More videos

Blog Posts

Market Place