TECH NEWS

npm and PyPI Ecosystems Hit by Supply Chain Malware

npm and PyPI ecosystems hit by supply chain malware have sent shockwaves through the developer community, with a sophisticated attack targeting popular open-source packages. Cybersecurity researchers, including experts from Aikido Security, have uncovered a malicious campaign compromising over a dozen GlueStack packages, affecting nearly 1 million weekly downloads. This attack, detected on June 6, 2025, at 9:33 p.m. GMT, exploits vulnerabilities in the “lib/commonjs/index.js” file to deliver malware capable of executing shell commands, capturing screenshots, and uploading sensitive files. As developers rely heavily on these ecosystems for efficient software development, this incident underscores the growing threat of supply chain attacks and the urgent need for robust security measures.

Key Takeaways

  • A supply chain attack targeted npm and PyPI ecosystems, compromising over a dozen GlueStick packages with nearly 1 million weekly downloads.

  • Malicious code in “lib/commonjs/index.js” enables attackers to run commands, steal data, and disrupt systems.

  • Detected on June 6, 2025, by Aikido Security, the attack highlights vulnerabilities in open-source package management.

  • Developers must prioritize dependency auditing and adopt security best practices to mitigate risks.

Understanding Supply Chain Attacks in Open-Source Ecosystems

What Are Supply Chain Attacks?

Supply chain attacks target the software development pipeline, exploiting trusted relationships between developers and third-party libraries. In the context of npm and PyPI, attackers infiltrate popular packages to distribute malicious code, which can then spread to countless applications. These attacks are particularly insidious because developers often assume open-source packages are safe, especially those with high download counts like the GlueStack libraries, which see nearly 1 million weekly downloads.

The Role of npm and PyPI in Software Development

npm (Node Package Manager) and PyPI (Python Package Index) are cornerstones of modern software development, hosting millions of packages that streamline coding for JavaScript and Python developers. npm alone hosts over 1.7 million packages, while PyPI supports a vast array of Python libraries. These ecosystems enable rapid development but also create a large attack surface for cybercriminals. The recent GlueStack compromise is a stark reminder of how attackers can exploit this trust.

The GlueStack Malware Attack: A Closer Look

How the Attack Unfolded

On June 6, 2025, Aikido Security detected the first signs of compromise in GlueStack’s npm packages, with malicious code injected into the “lib/commonjs/index.js” file. This code allowed attackers to execute shell commands, capture screenshots, and upload files from infected systems. The affected packages, including @gluestack-ui/utils (versions 0.1.16 and 0.1.17) and @react-native-aria/button (version 0.2.11), are widely used in mobile and web development, amplifying the attack’s impact.

Impact of the Malicious Code

The malware’s capabilities are alarming. By running shell commands, attackers could manipulate infected systems, potentially installing additional malware or exfiltrating sensitive data. The ability to take screenshots and upload files poses a significant risk for data breaches, while follow-on actions like cryptocurrency mining or service disruptions could cripple affected organizations. With over 1 million weekly downloads across the compromised packages, the potential for widespread damage is immense.

The Threat Actor’s Tactics

The attack leveraged obfuscated code appended to the “lib/commonjs/index.js” file, making it difficult to detect without thorough inspection. Cybersecurity firm Aikido Security noted that the malicious code was padded with spaces to evade casual scrutiny on npm’s code viewer. This sophisticated approach highlights the evolving tactics of threat actors, who exploit the trust developers place in popular packages. Additionally, a PyPI package linked to a user named im_ad__213 was found stealing credentials for platforms like Instagram, further broadening the attack’s scope.

Why npm and PyPI Are Vulnerable

Open-Source Ecosystem Challenges

Open-source ecosystems like npm and PyPI are inherently vulnerable due to their open nature. Anyone can publish packages, and while this fosters innovation, it also allows malicious actors to upload compromised or typosquatted packages. For instance, the MUT-8694 campaign, tracked by Datadog Security Labs, used typosquatting to distribute infostealer malware across both ecosystems, demonstrating the cross-platform risks.

Lack of Robust Verification

Unlike proprietary software, open-source packages often lack rigorous vetting. npm and PyPI rely on community oversight, but with millions of packages, manual review is impractical. The GlueStack attack exploited this gap, with compromised versions published without immediate detection. Even when maintainers deprecated affected versions, dependent packages prevented unpublishing, prolonging exposure.

Dependency Chain Risks

Modern applications often rely on complex dependency chains, where a single compromised package can affect thousands of projects. The GlueStack attack’s impact was magnified because its packages are dependencies for numerous applications. This ripple effect makes supply chain attacks particularly devastating, as seen in past incidents like the 2018 “flatmap-stream” compromise, which spread malware through the popular “event-stream” library.

Protecting Against Supply Chain Malware

Best Practices for Developers

To safeguard against supply chain attacks, developers must adopt proactive security measures:

  • Audit Dependencies Regularly: Use tools like Dependabot or Snyk to scan for vulnerabilities in dependencies.

  • Pin Package Versions: Specify exact versions in package-lock.json or requirements.txt to avoid auto-updating to malicious versions.

  • Enable Two-Factor Authentication (2FA): Protect npm and PyPI accounts with 2FA to prevent unauthorized access.

  • Use Security Tools: Leverage platforms like Aikido Security’s Intel feed or Socket’s malware detection to identify threats early.

  • Verify Package Integrity: Check package source code against GitHub repositories to ensure consistency.

Tools and Technologies for Enhanced Security

Several tools can help mitigate supply chain risks:

  • Aikido Security Intel: Detects malicious packages in real-time, as demonstrated in the GlueStack attack.

  • Socket: Offers proactive protection by analyzing package behavior and flagging anomalies.

  • GuardDog by Datadog: Scans npm, PyPI, and Go modules for malicious activity, as seen in the MUT-8694 campaign.

  • Snyk: Provides vulnerability scanning and automated fixes for open-source dependencies.

Organizational Strategies

Organizations should implement supply chain security frameworks:

  • Software Bill of Materials (SBOM): Create an SBOM to track all dependencies and their versions.

  • Zero Trust Architecture: Assume no package is inherently safe and verify all components.

  • Regular Security Training: Educate developers on recognizing typosquatting and other attack vectors.

The Broader Impact on the Developer Community

Economic and Operational Consequences

Supply chain attacks can lead to significant financial losses. For example, the 2020 SolarWinds attack, which compromised multiple organizations, cost millions in remediation efforts. The GlueStack attack’s potential for cryptocurrency mining and data theft could similarly disrupt businesses, especially those relying on affected packages for critical applications.

Erosion of Trust

Frequent attacks erode trust in open-source ecosystems. Developers may hesitate to adopt new packages, slowing innovation. The GlueStack incident, combined with earlier attacks like the XRP Ledger compromise in April 2025, underscores the need for stronger ecosystem protections.

Call for Industry-Wide Action

The open-source community, including npm, PyPI, and organizations like OpenSSF, must collaborate to enhance security. Initiatives like OpenSSF’s OSPS Baseline aim to establish minimum security standards for open-source projects, but adoption remains slow. The GlueStack attack highlights the urgency of implementing these standards.

Lessons from Past Supply Chain Attacks

Notable Incidents

The GlueStack attack is not an isolated event. Past incidents provide valuable lessons:

  • XRP Ledger (April 2025): Compromised npm package stole cryptocurrency keys, affecting thousands of applications.

  • rand-user-agent (May 2025): Injected a remote access trojan, highlighting the need for vigilant monitoring.

  • ua-parser-js (2021): Compromised to deliver malware, impacting 7 million weekly downloads.

Evolving Threat Landscape

Threat actors are becoming more sophisticated, using techniques like obfuscation and typosquatting. The MUT-8694 campaign, for instance, targeted both npm and PyPI with infostealer malware, showing how attackers exploit multiple ecosystems simultaneously.

The Future of Open-Source Security

Strengthening Package Registries

npm and PyPI must enhance their security protocols. Requiring 2FA for all maintainers, implementing automated code scanning, and enforcing stricter package verification could reduce risks. PyPI’s recent move to allow project archiving is a step forward, but more is needed.

Community-Driven Solutions

The open-source community can drive change by:

  • Crowdsourcing Security Audits: Encourage developers to review popular packages.

  • Promoting Reproducible Builds: Ensure package code matches GitHub repositories.

  • Funding Security Research: Support initiatives like Aikido Security’s open-source malware feed.

Role of AI in Security

AI-driven tools, like Aikido’s Intel feed, are revolutionizing malware detection. By analyzing package behavior and identifying anomalies, these tools can flag threats faster than traditional methods. The GlueStack attack’s rapid detection within 5 minutes demonstrates AI’s potential.

Summary

The npm and PyPI ecosystems hit by supply chain malware in June 2025 exposed critical vulnerabilities in open-source software development. The GlueStack attack, compromising packages with 1 million weekly downloads, introduced malicious code capable of devastating follow-on actions. Detected by Aikido Security, this incident highlights the need for developers to audit dependencies, use security tools, and adopt best practices like 2FA and version pinning. As threat actors grow more sophisticated, the open-source community must unite to strengthen package registries and restore trust. By leveraging AI-driven tools and industry standards, developers can protect their projects and ensure the integrity of the software supply chain.

FAQs

1. What is a supply chain attack in the context of npm and PyPI?

A supply chain attack targets the software development pipeline, injecting malicious code into trusted packages on registries like npm and PyPI to compromise downstream applications.

2. How did the GlueStack attack affect npm packages?

The GlueStack attack compromised over a dozen npm packages by injecting malicious code into “lib/commonjs/index.js,” enabling attackers to run commands, capture screenshots, and steal data.

3. What actions can developers take to protect against such attacks?

Developers should audit dependencies, pin package versions, enable 2FA, use security tools like Aikido or Snyk, and verify package integrity against GitHub repositories.

4. Why are npm and PyPI vulnerable to supply chain attacks?

Their open nature allows anyone to publish packages, and limited vetting combined with complex dependency chains creates opportunities for attackers to exploit trust.

5. What was the role of Aikido Security in this incident?

Aikido Security detected the GlueStack attack on June 6, 2025, and flagged compromised packages, helping mitigate the spread of malware.

6. How can organizations mitigate supply chain risks?

Organizations should adopt SBOMs, implement zero trust architecture, and train developers to recognize threats like typosquatting and malicious updates.

7. What are the consequences of supply chain attacks?

These attacks can lead to data breaches, financial losses, service disruptions, and eroded trust in open-source ecosystems.

8. Are there tools to detect malicious packages?

Yes, tools like Aikido Security’s Intel feed, Socket, GuardDog by Datadog, and Snyk can detect malicious packages and vulnerabilities.

9. How can the open-source community improve security?

By enforcing 2FA, implementing automated code scanning, promoting reproducible builds, and funding security research, the community can strengthen defenses.

10. What lessons can be learned from the GlueStack attack?

The attack underscores the need for vigilant dependency management, robust security tools, and industry-wide collaboration to secure open-source ecosystems.

TechBeams

TechBeams Team of seasoned technology writers with several years of experience in the field. The team has a passion for exploring the latest trends and developments in the tech industry and sharing their insights with readers. With a background in Information Technology. TechBeams Team brings a unique perspective to their writing and is always looking for ways to make complex concepts accessible to a broad audience.

Leave a Reply

Back to top button