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.

Vulnerabilities / Threats

5/28/2020
05:25 PM
Connect Directly
Twitter
LinkedIn
RSS
E-Mail
50%
50%

GitHub Supply Chain Attack Uses Octopus Scanner Malware

Octopus Scanner is a new malware used to compromise 26 open source projects in a massive GitHub supply chain attack.

On March 9, the GitHub Security Incident Response Team (SIRT) received a message from security researcher JJ, who had discovered a set of GitHub repositories actively serving malware. A deep-dive analysis of the malware revealed it was built to compromise NetBeans projects, something they hadn't seen before on GitHub. All affected projects were actively serving backdoored code, and the owners of these repositories were completely unaware of it.

Nico Waisman, head of GitHub Security Lab, says the first step in their investigation was to identify whether the campaign was still active. Once the critical assessment was complete and they learned the command-and-control (C2) server was not active, they were able to reduce the risk level and take a closer look at Octopus Scanner, an open source supply chain malware.

"The unique feature around this malware is that it is targeting developers as the means of spreading," Waisman explains. "Once the computer gets infected, it looks for NetBeans files to infect." While GitHub users, as developers, should be concerned about this malware using developers for propagation, Waisman notes this particular technique is "extremely rare."

When Octopus Scanner lands on a machine, it looks for signs indicating the NetBeans IDE is in use on a developer's system, GitHub security researcher Alvaro Muñoz explains in a blog post on their findings. If it doesn't find anything, the malware takes no action. If it does, it ensures that every time a project is built, any resulting JAR files are infected with a dropper. When executed, the payload ensures persistence and spreads a remote access Trojan (RAT), which connects to C2 servers.

The malware continues to spread by infecting NetBeans projects, or JAR files. This way, it backdoors healthy projects so when developers release code to the public, it contains malware. The goal of Octopus Scanner is to insert backdoors into artifacts built by NetBeans so the attacker can use these resources as part of the C2 server, Waisman says.

"When the end user deploys the workload, they have given the attacker access via the backdoor to their resources for use as part of a command-and-control server," he adds.

Octopus Scanner also tries to prevent any new project builds from replacing the infected one. This ensures the malicious build components remain in place. While researching the infected repositories, GitHub found four different versions of affected NetBeans projects. All but one of them, a downstream system, would get infected either by building from an infected repository or by using any of the compromised artifacts that came from an infected build, Muñoz wrote. 

"Infecting build artifacts is a means to infect more hosts since the infected project will most likely get built by other systems and the build artifacts will probably be loaded and executed on other systems as well," he explains in the blog post.

It is interesting the attackers specifically chose to target the NetBeans build process, especially because it's not the most common Java IDE. This could indicate a targeted attack, Muñoz says, or they may have already implemented the malware for build systems like Make, MsBuild, or Gradle, and it could be spreading unnoticed.

Supply Chain Threats: What You Should Know
Developers and companies are growing more reliant on open source code, Waisman says. Open source is easy for developers, meaning it's also easy for adversaries. Attackers are pursuing supply chain compromises because they can have widespread reach: a single attack can give them access to multiple targets. And as Muñoz points out, malware that abuses the build process and its resulting artifacts is "both interesting and concerning" for several reasons. 

In an open source context, this gives the malware an effective means of spreading. The infected projects will likely be cloned and used on different systems, and the artifacts of the builds may spread even further, making it harder to track down.

Because the primary users of these repositories are developers, a successful intrusion could give attackers access to the same resources that developers use. These may include additional passwords, production environments, database passwords, and other sensitive assets, he adds.

While supply chain compromises like this are scary, Waisman says they remain rare.

"The primary issue in supply chain security is unpatched software," he explains. "It's much easier for an attacker to take advantage of an unpatched, known vulnerability in a dependency than to insert a new vulnerability into your code."

For developers, the challenge is knowing their dependencies and knowing when they need to be patched. GitHub aims to help with this through Dependency Graph, which helps users better understand their projects' dependencies and provides security alerts when a dependency has a vulnerability, he says. For open source maintainers, the challenge is in preventing issues and responding when necessary. On GitHub, maintainers can create a security.md file with their reporting and disclosure policy, create fixes when needed, and publish security advisories. 

"Ultimately, this is about surfacing, coordinating, and sharing information between multiple parties, including developers, open source maintainers, security researchers, and enterprises," Waisman says.

Related Content:

 

 
 
 
 
 
 
Learn from industry experts in a setting that is conducive to interaction and conversation about how to prepare for that "really  bad day" in cybersecurity. Click for more information and to register
Kelly Sheridan is the Staff Editor at Dark Reading, where she focuses on cybersecurity news and analysis. She is a business technology journalist who previously reported for InformationWeek, where she covered Microsoft, and Insurance & Technology, where she covered financial ... View Full Bio
 

Recommended Reading:

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
Commentary
How SolarWinds Busted Up Our Assumptions About Code Signing
Dr. Jethro Beekman, Technical Director,  3/3/2021
News
'ObliqueRAT' Now Hides Behind Images on Compromised Websites
Jai Vijayan, Contributing Writer,  3/2/2021
News
Attackers Turn Struggling Software Projects Into Trojan Horses
Robert Lemos, Contributing Writer,  2/26/2021
Register for Dark Reading Newsletters
White Papers
Video
Cartoon Contest
Write a Caption, Win an Amazon Gift Card! Click Here
Latest Comment: George has not accepted that the technology age has come to an end.
Current Issue
2021 Top Enterprise IT Trends
We've identified the key trends that are poised to impact the IT landscape in 2021. Find out why they're important and how they will affect you today!
Flash Poll
How Enterprises are Developing Secure Applications
How Enterprises are Developing Secure Applications
Recent breaches of third-party apps are driving many organizations to think harder about the security of their off-the-shelf software as they continue to move left in secure software development practices.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2021-26814
PUBLISHED: 2021-03-06
Wazuh API in Wazuh from 4.0.0 to 4.0.3 allows authenticated users to execute arbitrary code with administrative privileges via /manager/files URI. An authenticated user to the service may exploit incomplete input validation on the /manager/files API to inject arbitrary code within the API service sc...
CVE-2021-27581
PUBLISHED: 2021-03-05
The Blog module in Kentico CMS 5.5 R2 build 5.5.3996 allows SQL injection via the tagname parameter.
CVE-2021-28042
PUBLISHED: 2021-03-05
Deutsche Post Mailoptimizer 4.3 before 2020-11-09 allows Directory Traversal via a crafted ZIP archive to the Upload feature or the MO Connect component. This can lead to remote code execution.
CVE-2021-28041
PUBLISHED: 2021-03-05
ssh-agent in OpenSSH before 8.5 has a double free that may be relevant in a few less-common scenarios, such as unconstrained agent-socket access on a legacy operating system, or the forwarding of an agent to an attacker-controlled host.
CVE-2021-3377
PUBLISHED: 2021-03-05
The npm package ansi_up converts ANSI escape codes into HTML. In ansi_up v4, ANSI escape codes can be used to create HTML hyperlinks. Due to insufficient URL sanitization, this feature is affected by a cross-site scripting (XSS) vulnerability. This issue is fixed in v5.0.0.