Headline
Critical Gems Takeover Bug Reported in RubyGems Package Manager
The maintainers of the RubyGems package manager have addressed a critical security flaw that could have been abused to remove gems and replace them with rogue versions under specific circumstances. “Due to a bug in the yank action, it was possible for any RubyGems.org user to remove and replace certain gems even if that user was not authorized to do so,” RubyGems said in a security advisory
The maintainers of the RubyGems package manager have addressed a critical security flaw that could have been abused to remove gems and replace them with rogue versions under specific circumstances.
“Due to a bug in the yank action, it was possible for any RubyGems.org user to remove and replace certain gems even if that user was not authorized to do so,” RubyGems said in a security advisory published on May 6, 2022.
RubyGems, like npm for JavaScript and pip for Python, is a package manager and a gem hosting service for the Ruby programming language, offering a repository of more than 171,500 libraries.
In a nutshell, the flaw in question, tracked as CVE-2022-29176, enabled anyone to pull certain gems and upload different files with the same name, same version number, and different platforms.
For this to happen, however, a gem needed to have one or more dashes in its name, where the word before the dash was the name of an attacker-controlled gem, and which was created within 30 days or had no updates for over 100 days.
“For example, the gem ‘something-provider’ could have been taken over by the owner of the gem 'something,’” the project owners explained.
The project maintainers said that there is no evidence that the vulnerability has been exploited in the wild, adding it didn’t receive any support emails from gem owners alerting them to the removal of the libraries without authorization.
“An audit of gem changes for the last 18 months did not find any examples of this vulnerability being used in a malicious way,” the maintainers said. “A deeper audit for any possible use of this exploit is ongoing.”
The disclosure comes as NPM addressed several flaws in its platform that could have been weaponized to facilitate account takeover attacks and publish malicious packages.
Chief among them is a supply chain threat called package planting that enables malicious actors to pass off rogue libraries as legitimate simply by assigning them to trusted, popular maintainers without their knowledge.
Found this article interesting? Follow THN on Facebook, Twitter and LinkedIn to read more exclusive content we post.
Related news
Rubygems is a package registry used to supply software for the Ruby language ecosystem. Due to a bug in the yank action, it was possible for any RubyGems.org user to remove and replace certain gems even if that user was not authorized to do so. To be vulnerable, a gem needed: one or more dashes in its name creation within 30 days OR no updates for over 100 days At present, we believe this vulnerability has not been exploited. RubyGems.org sends an email to all gem owners when a gem version is published or yanked. We have not received any support emails from gem owners indicating that their gem has been yanked without authorization. An audit of gem changes for the last 18 months did not find any examples of this vulnerability being used in a malicious way. A deeper audit for any possible use of this exploit is ongoing, and we will update this advisory once it is complete. Using Bundler in --frozen or --deployment mode in CI and during deploys, as the Bundler team has always recommended,...