The Axios Security Incident on npm: A Comprehensive Analysis

Discover how the Axios and React Server Components hacks in 2026 exposed critical vulnerabilities in open-source supply chains. Learn the future of hacking, emerging attack methods, and essential strategies to protect your projects from supply chain attacks.

The Axios Security Incident on npm: A Comprehensive Analysis
Photo by Kaptured by Kasia / Unsplash

Introduction: The Growing Threat of Supply Chain Attacks in Open Source

Supply chain attacks in the open-source ecosystem have emerged as one of the most insidious and impactful threats to modern software development. These attacks exploit the implicit trust developers place in widely used libraries and package registries, inserting malicious code into legitimate software components that are then distributed to millions of users. Even libraries as widely trusted and heavily used as Axios—an essential HTTP client for JavaScript with over 100 million weekly downloads—are not immune to such compromises.

The recent Axios security incident on npm is a stark reminder of the fragility of open-source supply chains and the sophisticated tactics employed by threat actors to infiltrate critical infrastructure. This incident, occurring on March 31, 2026, involved the hijacking of the npm account of Axios’ lead maintainer and the publication of malicious versions of Axios that delivered a remote access trojan (RAT) to affected systems. The attack’s short duration and broad reach highlight the urgent need for improved security practices, including dependency pinning, CI/CD pipeline protections, and vigilant registry monitoring.


What Is Axios, and Why Does It Matter?

Axios is a promise-based HTTP client for JavaScript, widely used in web and Node.js applications to simplify making HTTP requests to REST endpoints. Its popularity stems from its intuitive API, support for interceptors, automatic JSON data transformation, and robust error handling. Axios is a foundational library in modern web development, integrated into frameworks such as React, Node.js, and Vue.js, and is downloaded approximately 100 million times weekly from npm.

Given its ubiquitous presence, Axios is a critical dependency in countless applications, making its compromise a significant concern. A malicious version of Axios can potentially affect millions of developers and organizations, exposing sensitive data, intellectual property, and infrastructure to attackers.


The Axios Hack: How It Happened and What Went Wrong

Timeline of the Attack

Time (UTC) Event
~2 weeks before March 31 Social engineering campaign initiated against the lead Axios maintainer.
March 30, 05:57 Attacker publishes clean decoy package plain-crypto-js@4.2.0 to establish credibility.
March 30, 23:59 Malicious plain-crypto-js@4.2.1 (containing RAT dropper) published.
March 31, 00:21 Malicious axios@1.14.1 published via hijacked maintainer account.
March 31, 01:00 Malicious axios@0.30.4 published, targeting both major version branches.
~March 31, 03:15 npm security team unpublishes both malicious Axios versions.
March 31, 03:25 npm places a security hold on plain-crypto-js.
March 31, 04:26 npm publishes clean security stub plain-crypto-js@0.0.1-security.0.

The Malicious Payload: What Did It Do?

The attacker injected a hidden dependency, plain-crypto-js@4.2.1, into the Axios packages. This dependency executed automatically during npm installation via a post-install script, requiring no user interaction. The script connected to a known malicious domain (sfrclak[.]com) owned by Sapphire Sleet, a North Korean state-sponsored threat actor, to fetch a second-stage remote access trojan (RAT) tailored to the operating system of the compromised device (macOS, Windows, Linux).

The RAT payloads were designed to establish persistent remote access, execute arbitrary commands, and exfiltrate data while evading detection through obfuscation and in-memory execution techniques. The malware also self-deleted indicators of compromise to hinder forensic analysis.

Detection and Response

The attack was detected within minutes by automated npm security scanners and security researchers. The npm security team swiftly removed the malicious versions and placed a security hold on the malicious dependency. The coordinated response by maintainers, GitHub, and npm significantly limited the exposure window.

However, given Axios’ massive download volume, even a brief exposure window allowed tens of thousands of npm installations to occur, potentially compromising developer workstations, CI/CD pipelines, and production environments.


Lessons from the React Server Components Hack (December 2025)

How the RSC Incident Unfolded

In December 2025, a critical unauthenticated remote code execution (RCE) vulnerability (CVE-2025-55182, dubbed "React2Shell") was disclosed affecting React Server Components (RSC) versions 19.0, 19.1.0, 19.1.1, and 19.2.0. This vulnerability allowed attackers to execute arbitrary code via a single HTTP request, with a CVSS score of 10.0 indicating maximum severity.

The vulnerability was exploited by multiple threat actors, including state-sponsored groups, to deploy malware such as MINOCAT tunneler, SNOWLIGHT downloader, HISONIC backdoor, COMPOOD backdoor, and XMRIG cryptocurrency miners. The React team worked swiftly to patch the vulnerability and coordinate with hosting providers to mitigate the impact.

Comparing the Axios and RSC Attacks: Shared Patterns

Aspect Axios Hack (March 2026) React Server Components Hack (December 2025)
Attack Vector Compromised npm maintainer account, malicious dependency injection Unauthenticated RCE vulnerability in React Server Components
Payload Remote Access Trojan (RAT) delivered via npm dependency Arbitrary code execution leading to malware deployment
Impact Potential compromise of developer workstations, CI/CD pipelines, and production environments Widespread exploitation affecting web applications using React Server Components
Detection Automated npm security scanners and researcher reports Reported via Meta Bug Bounty, confirmed by Meta security researchers
Mitigation Removal of malicious packages, version pinning, and CI/CD safeguards Patch released, coordination with hosting providers
Shared Vulnerabilities Reliance on npm registry trust, lack of maintainer verification, insufficient package signing Over-reliance on trust in open-source components, delayed patching

Both incidents illustrate the critical importance of supply chain security in open-source software. They highlight how attackers exploit trust in widely used libraries and the challenges of securing complex dependency chains.


The Future of Hacking: What’s Next for Open-Source Security?

AI and Automation in Cyberattacks

The cybersecurity landscape is rapidly evolving with the integration of artificial intelligence (AI) and automation. Attackers leverage AI to maximize attack efficiency, precision, and scalability, while defenders deploy AI-driven security systems for predictive and automated protection. Generative AI, in particular, is transforming social engineering by producing highly personalized spear-phishing emails at scale, making them far more convincing and effective.

The Rise of "Sleeper" Malware

Malware that lies dormant until specific conditions are met—such as deployment in a production environment—is becoming more prevalent. These "sleeper" malware variants evade detection by remaining inactive during development and testing phases, only activating in high-value target environments.

Social engineering campaigns targeting maintainers and contributors of open-source projects are increasing. Phishing, credential theft, and even bribery are used to compromise high-profile package accounts, enabling attackers to inject malicious code directly into trusted libraries.

Evasion Techniques

Attackers employ sophisticated evasion techniques, including polymorphic code that constantly changes to bypass static analysis, and the use of legitimate AI cloud services to disguise malicious communications. These methods make detection and mitigation significantly more challenging.


The Open-Source Dilemma: Trust, Funding, and Accountability

Underfunded Maintenance

Many critical open-source projects rely on unpaid or underpaid maintainers, making them vulnerable to burnout or coercion. This underfunding creates an environment where security best practices and proactive monitoring are difficult to sustain.

Lack of Verification

Package registries like npm lack mandatory identity or code provenance checks, allowing attackers to publish malicious packages with minimal scrutiny. The absence of OIDC provenance checks and SLSA level 2+ compliance enables unauthorized access and supply chain compromises.

Over-Reliance on Trust

The assumption that popular packages are "safe by default" persists despite repeated incidents proving otherwise. This over-reliance on trust without verification creates a significant attack surface.

Fragmented Responsibility

The complexity of open-source supply chains spans multiple layers—npm, GitHub, CI/CD pipelines—making it difficult to assign accountability when attacks occur. This fragmentation hinders effective response and remediation.


What Can We Do? A Call to Action for Developers and Organizations

Adopt SBOMs and Dependency Tracking

Implementing Software Bill of Materials (SBOMs) and dependency tracking tools is essential to gain visibility into the origins, licensing, and maintenance status of each line of code. Continuous monitoring for new vulnerabilities is critical.

Enforce MFA and Code Signing

Enforcing multi-factor authentication (MFA) for package maintainers and implementing code signing for releases can significantly reduce the risk of account hijacking and unauthorized package modifications.

Support Sustainable Funding Models

Supporting open-source projects through sustainable funding models (e.g., Open Collective, GitHub Sponsors) helps maintainers focus on security and maintenance without financial stress.

Use Runtime Protection Tools

Leveraging runtime protection tools such as npm audit, Snyk, or custom sandboxing can detect anomalies and prevent malicious code execution during development and deployment.

Advocate for Policy Changes

Advocating for policy changes in package registries to mandate OIDC provenance checks, SLSA compliance, and stricter publishing controls can improve security standards and reduce supply chain risks.


Conclusion: Securing the Foundation of Modern Software

The Axios security incident on npm is a wake-up call for the open-source community and the broader software development ecosystem. It demonstrates how even the most trusted and widely used libraries are vulnerable to sophisticated supply chain attacks. The incident underscores the importance of strict dependency pinning, CI/CD safeguards, and vigilant registry controls to prevent similar attacks in the future. The quick detection and response by automated npm security scanners and npm administration were crucial in mitigating the impact of the attack. However, the short window of exposure was sufficient to affect many organizations dependent on the Axios package, emphasizing the need for enhanced security measures in the open-source ecosystem.

The React Server Component hack and the Axios hack both involved the exploitation of vulnerabilities in widely used JavaScript libraries. The React Server Component hack was a critical RCE vulnerability that affected multiple versions of React Server Components, while the Axios hack involved the injection of malicious dependencies into the Axios package. Both incidents highlight the importance of strict dependency pinning, CI/CD safeguards, and vigilant registry controls to prevent similar attacks in the future. The quick detection and response by automated npm security scanners and npm administration were crucial in mitigating the impact of the attacks. However, the short window of exposure was sufficient to affect many organizations dependent on the packages, emphasizing the need for enhanced security measures in the open-source ecosystem.

The broader implications of supply chain attacks on the open-source community highlight the need for enhanced security measures and proactive strategies to mitigate risks. The future of hacking in open-source software is expected to see an increase in sophisticated attacks driven by AI and state actors. To address these challenges, the open-source community must adopt comprehensive security measures, foster collaboration across the industry, and advocate for policy changes in package registries to improve security standards.

This comprehensive analysis synthesizes the Axios security incident within the context of broader open-source security challenges, providing technical depth and forward-looking insights for developers, security professionals, and open-source maintainers. The incident serves as a critical case study for the evolving threats in the JavaScript ecosystem and the urgent need for improved security practices and policies.