Malicious Packages in RubyGems and PyPI Compromise User Credentials and Cryptocurrency

Recent investigations have uncovered a series of malicious packages infiltrating the RubyGems and Python Package Index (PyPI) repositories, posing significant threats to user security and prompting critical changes in package management protocols.

RubyGems Under Siege

Since March 2023, a threat actor operating under aliases such as zon, nowon, kwonsoonje, and soonje has introduced 60 malicious gems into the RubyGems ecosystem. These packages masquerade as automation tools for platforms like Instagram, Twitter/X, TikTok, WordPress, Telegram, Kakao, and Naver. While they deliver the promised functionalities, they clandestinely harvest user credentials through graphical interfaces that prompt users to input their login information. The stolen data is then transmitted to external servers controlled by the attacker, including domains like programzon[.]com, appspace[.]kr, and marketingduo[.]co[.]kr. These domains are known for offering bulk messaging services, phone number scraping, and automated social media tools.

Notably, gems such as njongto_duo and jongmogtolon target financial discussion platforms. They are marketed as tools to flood investment-related forums with stock mentions and narratives, aiming to manipulate public perception and amplify visibility. The primary victims appear to be grey-hat marketers who utilize such tools for spam, search engine optimization (SEO), and engagement campaigns. The campaign predominantly targets Windows users, especially in South Korea, as indicated by Korean-language user interfaces and data exfiltration to .kr domains. The operation’s evolution across multiple aliases and infrastructure waves suggests a mature and persistent threat.

PyPI Faces Typosquatting Attacks

Simultaneously, GitLab’s Vulnerability Research team identified several typosquatting packages on PyPI designed to steal cryptocurrency from Bittensor wallets by hijacking legitimate staking functions. The malicious packages, mimicking legitimate ones, include:

– bitensor (versions 9.9.4 and 9.9.5)

– bittenso-cli

– qbittensor

– bittenso

These packages exploit the technical requirements and user behaviors associated with routine blockchain operations, embedding malicious code within legitimate-looking staking functionalities. This strategy allows attackers to covertly capture sensitive data while maintaining an appearance of legitimacy.

PyPI Implements Security Measures

In response to these threats, PyPI maintainers have introduced new restrictions to protect Python package installers and inspectors from confusion attacks stemming from ZIP parser implementations. Specifically, PyPI will now reject Python package wheels (ZIP archives) that attempt to exploit ZIP confusion attacks to smuggle malicious payloads past manual reviews and automated detection tools. This measure aims to prevent attackers from bypassing security protocols by manipulating ZIP file structures.

Broader Implications and Historical Context

These incidents underscore the persistent vulnerabilities within open-source ecosystems. Malicious actors continue to exploit the trust inherent in these platforms, introducing packages that, while appearing legitimate, serve nefarious purposes. The RubyGems and PyPI incidents are not isolated; similar attacks have targeted other repositories.

For instance, in June 2025, multiple malicious packages were discovered across npm, PyPI, and RubyGems repositories. These packages were designed to drain cryptocurrency wallets, erase entire codebases upon installation, and exfiltrate Telegram API tokens. The attackers employed typosquatting techniques, creating packages with names similar to legitimate ones to deceive developers into downloading them.

In another case, a threat actor uploaded three malicious packages to PyPI under the author name Lolip0p. These packages, named colorslib, httpslib, and libhttps, contained code that, upon installation, executed PowerShell scripts to download and run an information-stealing malware named Oxyz.exe. This malware targeted browser information, compromising user credentials and sensitive data.

Furthermore, in April 2020, over 725 malicious packages were identified in the RubyGems repository. These packages, downloaded nearly 100,000 times, contained scripts that, when executed on Windows systems, hijacked cryptocurrency transactions by replacing the recipient’s wallet address with one controlled by the attacker. The attackers utilized typosquatting, creating packages with names similar to legitimate ones, such as atlas-client instead of the authentic atlas_client.

Recommendations for Developers

Given the increasing sophistication of these attacks, developers are urged to exercise heightened vigilance when incorporating third-party packages into their projects. Best practices include:

– Verify Package Authenticity: Before installation, confirm the legitimacy of packages by checking the author’s credentials, reading user reviews, and examining the package’s update history.

– Monitor Dependencies: Regularly review and update dependencies to ensure they are free from known vulnerabilities.

– Implement Security Tools: Utilize automated tools designed to detect and alert on suspicious package behaviors or anomalies.

– Stay Informed: Keep abreast of security advisories and reports related to the programming languages and frameworks in use.

By adopting these practices, developers can mitigate the risks associated with malicious packages and contribute to a more secure open-source community.