Fileless Linux Malware Found in PyPI Package 'secretslib' | Sonatype

Exploring secretslib PyPI Package: Fileless Linux Cryptominer Malware

August 12, 2022
By Aaron Linskens

This week in malware, we discovered and analyzed nearly 100 packages flagged as malicious, suspicious, or dependency confusion attacks.

Notably, we uncovered a PyPI package that drops fileless Linux malware directly in memory to covertly run a cryptominer. Furthermore, our investigation revealed the threat actor published this malicious package under the stolen identity of a software engineer from a United States National Laboratory.

secretslib PyPI Package Identified as Fileless Linux Malware

In this rundown of malware, Sonatype's automated detection system identified PyPI package secretslib as potentially malicious.

At its release, the package contained the description "secrets matching and verification made easy." Upon investigation, the package contained a different kind of secret — it runs cryptominers on your Linux machine in-memory, directly from your RAM. We see this technique to a great extent with fileless malware and crypters.

Additionally, the threat actor who published the malicious package impersonated a real software engineer who works for a science and engineering research laboratory funded by the U.S. Department of Energy.

For a deep dive on how secretslib used a quasi-clean stripped ELF binary to drop a Linux cryptominer in memory, read Ax Sharma's dedicated blog post.

More Packages: Malicious, Suspicious, Dependency Confusion

We caught the following this week via Sonatype's automated malware detection system, offered as part of Sonatype Firewall:

These discoveries follow our report last week of typosquats and ransomware scripts in PyPI.

Turn on Sonatype Firewall for Automatic Protection

As a DevSecOps organization, we remain committed to identifying and halting attacks, such as those mentioned above, against open source developers and the wider software supply chain.

Users of Sonatype Firewall can rest easy knowing that such malicious packages would automatically be blocked from reaching their development builds.

Sonatype Firewall instances will automatically quarantine any suspicious components detected by our automated malware detection systems, while a researcher is in progress, thereby keeping your software supply chain protected from the start.

Sonatype's world-class security research data, combined with our automated malware detection technology, protects your developers, customers, and software supply chain from infections.

Written by Aaron Linskens
Aaron is a technical writer at Sonatype. He works at a crossroads of technical writing, developer advocacy, and information design. He aims to get developers and non-technical collaborators to work better together in solving problems and building software.