Malicious Packages Across Open-Source Registries: Detection Statistics and Trends (Q2 2025)
文章指出开源软件仓库被滥用为恶意软件传播渠道的趋势持续存在。2025年第二季度数据显示,攻击者通过NPM和PyPI包进行数据窃取等行为依然频繁。攻击者采用最小化代码 footprint、利用安装脚本及混淆技术等方式隐藏恶意行为。Fortiguard Labs监测到大量恶意包,并提供防护建议以应对供应链威胁。 2025-8-4 13:0:0 Author: feeds.fortinet.com(查看原文) 阅读量:20 收藏

In this previous blog, Fortiguard Labs highlighted a growing trend in the use of open source software (OSS) repositories as channels for malware distribution in supply chain security. With the continued reliance on third-party packages in development workflows, threat actors are increasingly exploiting vulnerabilities in the open-source ecosystem to propagate malicious code, exfiltrate data, and cause other harm.

By leveraging our proprietary AI-powered malware detection and continuous monitoring system, FortiGuard Labs has established real-time tracking and detection of newly published packages. This ongoing, global monitoring enables us to rapidly identify emerging threats and evolving attack techniques.

Analysis of data collected during the second quarter (Q2 2025) reveals that the use of OSS repositories as malware distribution channels in supply chains is not only persistent but remains essentially unchanged in its core tactics. In this report, we present updated statistics on malicious package activity observed in the wild during the second quarter. It also presents a couple of selected examples of malicious packages uncovered during the quarter, offering insights into trends and techniques observed in OSS ecosystems.

During the quarter, our automated threat detection platform scanned over 1.4 million NPM (Node Package Manager) and 400,000 PyPI (Python Package Index) packages, uncovering a substantial number of malicious packages. A significant portion of these packages highlighted data exfiltration as one of the most common malicious behaviors utilizing setup or install scripts, reaffirming the persistence of threat patterns and trends observed in our previous blog.

As shown in the statistics above, based on over a thousand analyst-confirmed malicious packages, the high percentage of low file counts, missing repositories, and the use of install scripts suggests that malware authors aim to minimize their code footprint, reduce traceability, and silently deploy malicious payloads during the installation process. We also observed an increase in the use of obfuscation compared to the previous quarter.

To provide a closer look, here are a couple of examples from our Q2 findings:

Malicious Python Packages Steal Credentials and Wallets Targets

Several malicious PyPI packages were discovered in Q2, namely simple-mali-pkg-0.1.0, confighum-0.3.5, sinontop-utils-0.3.5, solana-sdkpy-1.2.5, and solana-sdkpy-1.2.6, which serve as strong examples of the tactics reflected in our statistical findings. They employ several common techniques used by threat actors, including install script execution, command overwriting, a low file count, absence of a linked repository, code encryption or obfuscation aimed at evading the true nature of the code, and executing malicious behavior during installation.

Figure 1: setup.py of simple-mali-pkg-0.1.0

In the setup.py file of simple-mali-pkg-0.1.0, a suspicious file is executed in its package, “mali.py”. Looking into the mali.py file, we see a large amount of encrypted code. This code has dozens of layers of encryption to hide its true intentions.

Figure 2: mali.py of simple-mali-pkg-0.1.0

After full decryption, its behavior is revealed. Here is a snippet of the code hinting at the theft of credentials and wallets.

Figure 3: Decrypted mali.py indicating the stealing of personal data and wallets

NPM Malware Package Follows Suit – Obfuscated Code Used to Steal Data

This NPM package example demonstrates similar malicious behavior of data theft and exfiltration. A package, postcss-theme-vars-7.0.7, while differing in implementation, shares similar core behaviors with simple-mali-pkg-0.1.0. In this package, the malicious code resides in a file named test-simples.dat, a possible attempt at misdirection, as the extension conceals the fact that the content is JavaScript. This file also contains a large amount of obfuscated code. At the beginning of last quarter, Socket reported a similarly named package that impersonated the legitimate PostCSS library. Since that disclosure, the threat persists but is now resurfacing with variations in its code. This highlights the ongoing persistence of data theft campaigns within open source ecosystems.

Figure 4: test-samples.dat of postcss-theme-vars-7.0.7

Upon deobfuscation, the code reveals functions designed to steal sensitive information, including multiple browser profiles, wallets, credentials, and documents, while also employing techniques such as screenshot capture and keylogging to transmit data to a remote server controlled by the attacker. Some deobfuscated snippets of test-samples.dat are shown below.

Figure 5: This code snippet makes a socket connection to the attacker-controlled remote server

Figure 6: This code snippet targets Chrome and Brave browser profiles and collects saved passwords, autofill data, and extension settings

Figure 7: This code snippet silently scans the victim's computer for sensitive files for exfiltration

Figure 8: This code snippet logs keyboard input, monitors clipboards, and takes screenshots

Conclusion

The findings from our Q2 2025 data analysis reinforce the observations we made in the previous quarter. The abuse of OSS repos to propagate malware remains persistent. While overall tactics have not evolved significantly, attackers continue to rely on proven techniques, such as minimizing file count, using installation scripts, and employing discreet data exfiltration methods that maximize impact.

A continued rise in obfuscation also further notes the importance of vigilance and ongoing monitoring required by users of these services. And as OSS continues to grow, so too will the attack surface for supply chain threats.

It is highly recommended that organizations and individuals strengthen their defenses with knowledge and awareness of OSS supply chain threats. This is an essential first step toward effectively mitigating or preventing potential risks.

Fortinet Protections

FortiGuard AntiVirus detects the malicious files identified in this report as

simple-mali-pkg-0.1.0: Python/FreeCodingTools.10037449!tr
confighum-0.3.5: Python/FreeCodingTools.10037449!tr
sinontop-utils-0.3.5: Python/FreeCodingTools.10037449!tr
solana-sdkpy-1.2.5: Python/FreeCodingTools.10037449!tr
solana-sdkpy-1.2.6: Python/FreeCodingTools.10037449!tr
postcss-theme-vars-7.0.7: JS/Stealer.A!tr

The FortiGuard AntiVirus service is supported by FortiGate, FortiMail, FortiClient, and FortiEDR. Customers running current AntiVirus updates are protected.

The FortiGuard Web Filtering Service detects and blocks the download URLs cited in this report as Malicious.

The FortiDevSec SCA scanner detects malicious packages, including those cited in this report that may operate as dependencies in users' projects in test phases, and prevents those dependencies from being introduced into users' products.

If you believe these or any other cybersecurity threat has impacted your organization, please contact our Global FortiGuard Incident Response Team.

IOCs

Package name

Sha256

Detection

simple-mali-pkg-0.1.0

a9114a446a136ddf38c16f9e1bb1a83400cba423d0d97df121a54b67829be7b9

Python/FreeCodingTools.10037449!tr

confighum-0.3.5

2e037be549c01fec14d9cad59075708476e90456deb53811f4301eb111c1104b         

Python/FreeCodingTools.10037449!tr

sinontop-utils-0.3.5

00892955b1a2302536f4d7175cd30d89f961c1f45d56461e62ba0549b5906ae9

Python/FreeCodingTools.10037449!tr

solana-sdkpy-1.2.5

d63099defcc1ee6dcbcbb68383e435347b661a9e399f5a028f735b5f6f3f86d7         

Python/FreeCodingTools.10037449!tr

solana-sdkpy-1.2.6

de23b7350619938388cc01f8086df95858495c6c8d73743a3c20d0ced3aece5b         

Python/FreeCodingTools.10037449!tr

postcss-theme-vars-7.0.7

2d9d200b8e167fc95120e893dd3d7d02789a8ba41ba2632af2e342f35d1d2283

JS/Stealer.A!tr


文章来源: https://feeds.fortinet.com/~/922680806/0/fortinet/blog/threat-research~Malicious-Packages-Across-OpenSource-Registries-Detection-Statistics-and-Trends-Q
如有侵权请联系:admin#unsafe.sh