Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Application Security

12:25 PM

Attackers Aim at Software Supply Chain with Package Typosquatting

Attackers seed Ruby Gems repository with more than 760 malicious packages using names just a bit different than the standard code libraries.

Developers who make a simple typing mistake could find their systems compromised by malware in the latest attack on the software supply chain, say researchers at ReversingLabs, a software analysis platform provider.

The researchers analyzed the package repository for the Ruby language looking for code packages, known as Ruby Gems, submitted to the repository with names similar to existing baseline packages. They found more than 760 malicious Gems with similar names to legitimate packages had polluted the Ruby Gems repository.

The attack is similar to the typosquatting the company found in Python and the Node Package Manager repositories, says Robert Perica, principal engineer and threat analyst at ReversingLabs.

"Like other developers, when a developer mistypes a name and tries to download a package that does not exist, they expect an error that tells them that the package is not available," he says. "But malicious actors are taking advantage of typos and delivering malware instead."

The use of typosquatting to attempt to compromise developers' software and systems is a continuation of attacks on the software supply chain. In the past, developers mainly had to worry about keeping the packages they used up-to-date to close any vulnerabilities in their software. 

Over the past few years, however, companies that track open source software packages have noted that attackers have focused on the components that developers often use as the basis for their applications. In 2018, for example, a popular JavaScript package in the Node Package Manager (NPM) repository known as event-stream was compromised with Bitcoin-stealing code and remained undetected for more than two months.

"The presumed attacker ... reportedly offered to help maintain the library," said Danny Grander, co-founder and security lead at software-security firm Snyk, in an analysis of the incident. "Since adding libraries is a common practice, it's easy to see how the new library was not reviewed too carefully. Furthermore, the library appears to have performed the promised functionality."

Compromising an existing open source project is a long con that takes time, however. Typosquatting is much easier and does not require as many resources. The common attack typically focuses on creating file or domain names that are similar to common runtimes or destinations, respectively, in an attempt to catch infrequent typos. The strategy typically pays off when a large volume of requests are involved, making a low percentage mistake still amount to a reasonable number of potential victims.

In the early 2000s, for example, domain registrars began redirecting mistyped domains to their own landing pages — a move to which many privacy advocates, Internet service providers, and browser makers took exception. In 2008, Oliver Friedrichs, then a researcher for Symantec, warned that typosquatting could be used to capture sensitive emails. As an experiment, he registered 124 domains that had close spellings to US presidential candidates and found more than 1,100 connection attempts were sent to the mail handler for those domains.

In the latest case, two developer accounts submitted different misspelled version of RubyGems, such as "atlas-client" instead of the actual "atlas_client," according to ReversingLabs' analysis. The malicious component installed by the fake component infects the developer's system with persistent malware to replace any Bitcoin wallet address on the clipboard with the attacker's wallet address, Perica says.

While most popular more than a decade ago, Ruby continues to be a relevant programming language for back-end Web developers because it powers the Ruby on Rails application framework. The language ranked No. 8 out of all programming languages in May 2016, but it has since fallen to No. 13, according to the ranking maintained by TIOBE, a software quality firm. Developer-knowledge site StackOverflow places the language at No. 12 with about 8% of all developers using Ruby.

The attack against the Ruby Gems repository was fairly simple to spot because the attacker used portable executable files — not typically part of a Ruby Gem — and obvious names, such as "aaaa.png," for the file components. A sneakier attacker could make the malware more difficult to spot, Perica says. 

"It all depends on the level of caution that developers have in dealing with the package management frameworks," he says. "We have to practice due diligence as developers and expect mistakes to happen."

Related Content:

A listing of free products and services compiled for Dark Reading by Omdia analysts to help meet the challenges of COVID-19. 


Check out The Edge, Dark Reading's new section for features, threat data, and in-depth perspectives. Today's top story: "Cybersecurity Home-School: The Robot Project."

Veteran technology journalist of more than 20 years. Former research engineer. Written for more than two dozen publications, including CNET News.com, Dark Reading, MIT's Technology Review, Popular Science, and Wired News. Five awards for journalism, including Best Deadline ... View Full Bio

Recommended Reading:

Comment  | 
Print  | 
More Insights
Newest First  |  Oldest First  |  Threaded View
More SolarWinds Attack Details Emerge
Kelly Jackson Higgins, Executive Editor at Dark Reading,  1/12/2021
Vulnerability Management Has a Data Problem
Tal Morgenstern, Co-Founder & Chief Product Officer, Vulcan Cyber,  1/14/2021
Register for Dark Reading Newsletters
White Papers
Current Issue
2020: The Year in Security
Download this Tech Digest for a look at the biggest security stories that - so far - have shaped a very strange and stressful year.
Flash Poll
Assessing Cybersecurity Risk in Today's Enterprises
Assessing Cybersecurity Risk in Today's Enterprises
COVID-19 has created a new IT paradigm in the enterprise -- and a new level of cybersecurity risk. This report offers a look at how enterprises are assessing and managing cyber-risk under the new normal.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
PUBLISHED: 2021-01-19
Mautic before 3.2.4 is affected by stored XSS. An attacker with permission to manage companies, an application feature, could attack other users, including administrators. For example, by loading an externally crafted JavaScript file, an attacker could eventually perform actions as the target user. ...
PUBLISHED: 2021-01-19
Mautic before 3.2.4 is affected by stored XSS. An attacker with access to Social Monitoring, an application feature, could attack other users, including administrators. For example, an attacker could load an externally drafted JavaScript file that would allow them to eventually perform actions on th...
PUBLISHED: 2021-01-19
A CSRF vulnerability exists in Anchor CMS 0.12.7 anchor/views/users/edit.php that can change the Delete admin users.
PUBLISHED: 2021-01-19
Bleichenbacher's attack on PKCS #1 v1.5 padding for RSA in Microchip Libraries for Applications 2018-11-26 All up to 2018-11-26. The vulnerability can allow one to use Bleichenbacher's oracle attack to decrypt an encrypted ciphertext by making successive queries to the server using the vulnerable li...
PUBLISHED: 2021-01-19
Pixelimity 1.0 has cross-site request forgery via the admin/setting.php data [Password] parameter.