Virtual Event Now Live: Zero Trust Strategies Summit! - Login for Access
Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Cybercrime

Malicious Code Planted in ‘strong_password’ Ruby Gem

A developer discovered that an update released for the ‘strong_password’ Ruby gem contained malicious code that allowed an attacker to remotely execute arbitrary code.

A developer discovered that an update released for the ‘strong_password’ Ruby gem contained malicious code that allowed an attacker to remotely execute arbitrary code.

Developer Tute Costa was updating gems used by a Rails application when he noticed that version 0.0.7 of strong_password was pushed out on RubyGems.org, the Ruby community’s gem hosting service, but not on GitHub.

Strong_password is a Ruby gem that developers can integrate into their applications to ensure that the passwords being set are strong. The gem has been downloaded nearly 250,000 times, including over 38,000 times in the case of version 0.0.6.

An analysis of strong_password 0.0.7, released on June 25, revealed that a few lines of code had been appended to the end of a file. The code was designed to wait for a random number of seconds (up to one hour), check if the application using the gem was running in production and, if so, fetch and run code from a Pastebin post.

The Pastebin post was editable so the payload could have been changed by the attacker at any time.

After discovering the malicious code, Costa reached out to the developer of strong_password, Brian McManus, who said someone had hijacked the gem and he had lost ownership. After being alerted by Costa, RubyGems representatives pulled the malicious version, locked the account used by the attacker, and assigned McManus as the owner of the gem.

The issue has been assigned the CVE identifier CVE-2019-13354. Rubysec, which provides security resources for the Ruby community, has advised users who installed version 0.0.7 to immediately downgrade to version 0.0.6.

Unfortunately, data from rubygems.com shows that the malicious version was downloaded 537 times before it was pulled.

Advertisement. Scroll to continue reading.

The incident has been discussed by many on Hacker News. Some expressed concern that the attack may have been the result of a vulnerability affecting the entire Ruby ecosystem, while others believe the attacker most likely compromised the gem developer’s account. Some believe a powerful vulnerability would have likely been exploited against a much more popular gem — the most popular have tens and even hundreds of millions of downloads — while others think this may have been part of a targeted attack.

This is not the first time a malicious Ruby gem has been discovered this year. In late March, someone pushed out a malicious version of bootstrap-sass, which has roughly 29 million downloads. The malicious version included a stealthy backdoor that allowed attackers to execute arbitrary commands on server-side Rails applications.

Related: Cryptocurrency-Stealing Code Distributed via Popular Library

Related: Several Vulnerabilities Patched in RubyGems

Related: Researchers Uncover Critical RubyGems Vulnerabilities

Related: Critical Vulnerability Addressed in Popular Code Libraries

Written By

Eduard Kovacs (@EduardKovacs) is a managing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join SecurityWeek and Hitachi Vantara for this this webinar to gain valuable insights and actionable steps to enhance your organization's data security and resilience.

Register

Event: ICS Cybersecurity Conference

The leading industrial cybersecurity conference for Operations, Control Systems and IT/OT Security professionals to connect on SCADA, DCS PLC and field controller cybersecurity.

Register

People on the Move

Threat intelligence firm Intel 471 has appointed Mark Huebeler as its COO and CFO.

Omkhar Arasaratnam, former GM at OpenSSF, is LinkedIn's first Distinguised Security Engineer

Defense contractor Nightwing has appointed Tricia Fitzmaurice as Chief Growth Officer.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.