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
COVID-19: Latest Security News & Commentary
Dark Reading Staff 10/1/2020
9 Tips to Prepare for the Future of Cloud & Network Security
Kelly Sheridan, Staff Editor, Dark Reading,  9/28/2020
Attacker Dwell Time: Ransomware's Most Important Metric
Ricardo Villadiego, Founder and CEO of Lumu,  9/30/2020
Register for Dark Reading Newsletters
White Papers
Current Issue
Special Report: Computing's New Normal
This special report examines how IT security organizations have adapted to the "new normal" of computing and what the long-term effects will be. Read it and get a unique set of perspectives on issues ranging from new threats & vulnerabilities as a result of remote working to how enterprise security strategy will be affected long term.
Flash Poll
How IT Security Organizations are Attacking the Cybersecurity Problem
How IT Security Organizations are Attacking the Cybersecurity Problem
The COVID-19 pandemic turned the world -- and enterprise computing -- on end. Here's a look at how cybersecurity teams are retrenching their defense strategies, rebuilding their teams, and selecting new technologies to stop the oncoming rise of online attacks.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
PUBLISHED: 2020-10-01
The Web application on Rittal CMC PU III 7030.000 V3.00 V3.11.00_2 to V3.15.70_4 devices fails to sanitize user input on the system configurations page. This allows an attacker to backdoor the device with HTML and browser-interpreted content (such as JavaScript or other client-side scripts) as the c...
PUBLISHED: 2020-10-01
In Istio 1.5.0 though 1.5.8 and Istio 1.6.0 through 1.6.7, when users specify an AuthorizationPolicy resource with DENY actions using wildcard suffixes (e.g. *-some-suffix) for source principals or namespace fields, callers will never be denied access, bypassing the intended policy.
PUBLISHED: 2020-10-01
Unisys Stealth(core) before 4.0.132 stores Passwords in a Recoverable Format.
PUBLISHED: 2020-10-01
Envoy through 1.15.0 only considers the first value when multiple header values are present for some HTTP headers. Envoy’s setCopy() header map API does not replace all existing occurences of a non-inline header.
PUBLISHED: 2020-10-01
Envoy master between 2d69e30 and 3b5acb2 may fail to parse request URL that requires host canonicalization.