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 the session as we discuss the challenges and best practices for cybersecurity leaders managing cloud identities.

Register

SecurityWeek’s Ransomware Resilience and Recovery Summit helps businesses to plan, prepare, and recover from a ransomware incident.

Register

People on the Move

Mike Dube has joined cloud security company Aqua Security as CRO.

Cody Barrow has been appointed as CEO of threat intelligence company EclecticIQ.

Shay Mowlem has been named CMO of runtime and application security company Contrast Security.

More People On The Move

Expert Insights

Related Content

Vulnerabilities

Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Cybercrime

A recently disclosed vBulletin vulnerability, which had a zero-day status for roughly two days last week, was exploited in a hacker attack targeting the...

Cybercrime

The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.

Cybercrime

As it evolves, web3 will contain and increase all the security issues of web2 – and perhaps add a few more.

Cybercrime

Luxury retailer Neiman Marcus Group informed some customers last week that their online accounts had been breached by hackers.

Data Breaches

OpenAI has confirmed a ChatGPT data breach on the same day a security firm reported seeing the use of a component affected by an...

IoT Security

A group of seven security researchers have discovered numerous vulnerabilities in vehicles from 16 car makers, including bugs that allowed them to control car...

Vulnerabilities

A researcher at IOActive discovered that home security systems from SimpliSafe are plagued by a vulnerability that allows tech savvy burglars to remotely disable...