{"id":16027,"date":"2026-03-31T20:47:11","date_gmt":"2026-03-31T20:47:11","guid":{"rendered":"https:\/\/newestek.com\/?p=16027"},"modified":"2026-03-31T20:47:11","modified_gmt":"2026-03-31T20:47:11","slug":"attackers-trojanize-axios-http-library-in-highest-impact-npm-supply-chain-attack","status":"publish","type":"post","link":"https:\/\/newestek.com\/?p=16027","title":{"rendered":"Attackers trojanize Axios HTTP library in highest-impact npm supply chain attack"},"content":{"rendered":"<div>\n<div id=\"remove_no_follow\">\n<div class=\"grid grid--cols-10@md grid--cols-8@lg article-column\">\n<div class=\"col-12 col-10@md col-6@lg col-start-3@lg\">\n<div class=\"article-column__content\">\n<section class=\"wp-block-bigbite-multi-title\">\n<div class=\"container\"><\/div>\n<\/section>\n<p>Attackers compromised the npm account of the lead maintainer of Axios, a widely used JavaScript HTTP client library, and used it to publish malicious versions of the package that deployed a cross-platform remote access trojan on developer machines. The incident represents the highest-impact npm supply chain attack on record given Axios\u2019 approximately 100 million weekly downloads and its presence in frontend frameworks, backend services, and countless enterprise applications.<\/p>\n<p>Luckily the trojanized versions, axios@1.14.1 and axios@0.30.4, were detected by multiple security companies monitoring the npm registry within minutes of publication, triggering a rapid response that saw the malicious packages removed by the npm team between two to three hours later. That said, given the high download activity this project sees, the short time window was enough to impact a significant number of developer environments.<\/p>\n<p>According to cloud security firm Wiz, <a href=\"https:\/\/www.wiz.io\/blog\/axios-npm-compromised-in-supply-chain-attack\">Axios is used in 80% of cloud and code environments<\/a>; the company observed execution of the malware in roughly 3% of impacted environments. Researchers with security firm Snyk noted that \u201ceven a two-hour malicious window represents an enormous potential blast radius\u201d given the library\u2019s popularity. Almost 175,000 other projects on npm list Axios as a dependency, meaning this had a huge cascade effect through the ecosystem.<\/p>\n<p>The attack follows <a href=\"https:\/\/www.csoonline.com\/article\/4149938\/trivy-supply-chain-breach-compromises-over-1000-saas-environments-lapsus-joins-the-extortion-wave.html\">a series of supply chain attacks that impacted multiple open-source projects <\/a>across different package repositories over the past several weeks, most of them attributed to a group known as TeamPCP. However, the Google Threat Intelligence Group (GTIG) has attributed the Axios attack to a North Korean threat actor it tracks as UNC1069.<\/p>\n<p>\u201cNorth Korean hackers have deep experience with supply chain attacks, which they\u2019ve historically used to steal cryptocurrency,\u201d said John Hultquist, chief analyst with GTIG. \u201cThe full breadth of this incident is still unclear, but given the popularity of the compromised package, we expect it will have far reaching impacts.\u201d<\/p>\n<p>In their analysis, Snyk researchers also noted the sophistication of techniques involved in the attack.<\/p>\n<p>\u201cThe attacker also showed meaningful operational sophistication, pre-staging the malicious dependency, using a \u2018clean\u2019 version history, double-obfuscating the dropper, building platform-specific RATs, and implementing anti-forensic self-deletion,\u201d the Snyk researchers said in <a href=\"https:\/\/snyk.io\/blog\/axios-npm-package-compromised-supply-chain-attack-delivers-cross-platform\/\">their report<\/a>. \u201cThis was not opportunistic.\u201d<\/p>\n<h2 class=\"wp-block-heading\" id=\"how-the-attack-unfolded\">How the attack unfolded<\/h2>\n<p>Attackers began preparing the Axios attack roughly 18 hours before when an account named nrwise published a package called plain-crypto-js@4.2.0. This was a clean decoy designed to establish registry history and legitimacy. The malicious payload arrived later the same day in plain-crypto-js@4.2.1, which contained a <code>postinstall<\/code> hook that would execute a dropper script when it was pulled in by a different package as a dependency.<\/p>\n<p>Shortly after midnight UTC on March 31 a new version of the Axios package, axios@1.14.1, was published on npm followed by axios@0.30.4 39 minutes later. Both listed plain-crypto-js@4.2.1 as a dependency in their <code>package.json<\/code> files, but the rest of the components remained unchanged.<\/p>\n<p>A package that appears in the manifest but has zero usage or imports in the codebase is called a phantom dependency and is a high-confidence indicator of compromise, <a href=\"https:\/\/www.stepsecurity.io\/blog\/axios-compromised-on-npm-malicious-versions-drop-remote-access-trojan\">according to researchers at StepSecurity<\/a>. Another indicator was that these versions appeared only on npm and not in the project\u2019s GitHub repo as tagged releases.<\/p>\n<p>Axios\u2019 legitimate 1.x releases were configured to use npm\u2019s OIDC Trusted Publisher mechanism bound to GitHub Actions, but the 1.14.1 release was published manually via a stolen token with no corresponding commit or tag in the repository.<\/p>\n<p><a href=\"https:\/\/github.com\/axios\/axios\/issues\/10604\">In comments on GitHub<\/a>, the project\u2019s principal maintainer Jason Saayman acknowledged that while v1.x had trusted publishing configured, the v0.x branch still relied on a legacy long-lived token. A community member further pointed out that the v1.x publish workflow still passed <code>NODE_AUTH_TOKEN<\/code> to npm, which takes precedence over OIDC when both are present, meaning the long-lived token was also being used for v1.x rather than the intended trusted publishing mechanism.<\/p>\n<h2 class=\"wp-block-heading\" id=\"cross-platform-malware\">Cross-platform malware<\/h2>\n<p>The obfuscated and encrypted <code>postinstall<\/code> script contacted a command-and-control (C2) server on a domain registered the day before by the attackers and downloaded platform-specific second-stage RAT payloads.<\/p>\n<p>On macOS, the binary is written to <code>\/Library\/Caches\/com.apple.act.mond<\/code> and can self-sign injected payloads via <code>codesign \u2014force \u2014deep \u2014sign<\/code>, bypassing macOS Gatekeeper protections. The malware fingerprints the system, collects hostname, username, macOS version, boot and install times, CPU architecture, and running processes, and then reaches out to the C2 server every 60 seconds.<\/p>\n<p>On Windows machines the payload is a PowerShell script copied to <code>%PROGRAMDATA%wt.exe<\/code>, masquerading as Windows Terminal. The malware establishes persistence through a registry Run key named \u201cMicrosoftUpdate\u201d and a re-download batch file. Meanwhile Linux systems receive a Python script stored as <code>\/tmp\/ld.py<\/code> that gets executed via <code>nohup python3<\/code>.<\/p>\n<p>The RAT supports four commands: <code>peinject<\/code> for deploying additional binaries, <code>runscript<\/code> for executing shell or AppleScript code, <code>rundir<\/code> for directory enumeration, and <code>kill<\/code> for self-termination.<\/p>\n<p><a href=\"https:\/\/socket.dev\/blog\/axios-npm-package-compromised\">According to researchers from security firm Socket<\/a>, after execution the malware attempts to erase its tracks by deleting <code>setup.js<\/code>, removing the malicious <code>package.json<\/code> that contained the postinstall hook and replacing it with a clean copy that reports version 4.2.0 instead of 4.2.1. This means users running <code>npm list<\/code> in an affected project directory will see plain-crypto-js@4.2.0, potentially misleading them into believing the installed version predates the attack.<\/p>\n<h2 class=\"wp-block-heading\" id=\"detection-and-maintainer-response\">Detection and maintainer response<\/h2>\n<p>Security firms monitoring npm flagged plain-crypto-js@4.2.1 within minutes after it was published, triggering a series of responses, including by the npm registry team that removed the packages. However, the Axios project itself had difficulty containing the issue because the incident happened during the lead maintainer\u2019s nighttime.<\/p>\n<p>A core collaborator of the project responded to the community-reported issue on GitHub also within minutes, but his permissions were lower than those of the maintainer whose token was compromised.<\/p>\n<p>This underscores a potential incident response gap open-source projects might face, because even if project contributors notice a breach immediately, the attacker could have higher privileges than them through a stolen token and could slow down attempts at damage control.<\/p>\n<p>In <a href=\"https:\/\/www.csoonline.com\/article\/4149938\/trivy-supply-chain-breach-compromises-over-1000-saas-environments-lapsus-joins-the-extortion-wave.html\">the recent Trivy compromise<\/a>, attackers flooded the GitHub issue with spam comments from bots to make it harder for maintainers to respond and communicate with the community.<\/p>\n<h2 class=\"wp-block-heading\" id=\"prepare-for-more-compromises\">Prepare for more compromises<\/h2>\n<p>The cascade effect of the Axios incident became visible as dependency scanning tools flagged hundreds of downstream projects that had pulled the malicious versions. One user posted warnings to more than 50 repositories after detecting plain-crypto-js in their lockfiles, while another identified dozens more, from personal blogs to enterprise apps.<\/p>\n<p>This demonstrates how quickly the compromise of a popular npm package propagates through the ecosystem, even if the breach is detected within a few hours.<\/p>\n<p>Organizations should audit lockfiles and installed dependencies for the malicious versions immediately. If the malicious versions were installed, assume the development environments are fully compromised. Security teams should isolate affected systems, rotate all credentials present on them such as npm tokens, cloud provider keys, SSH private keys, CI\/CD secrets, etc.<\/p>\n<p>\u201cDo not rotate in place; revoke and reissue,\u201d the Snyk researchers advised. \u201cDo not attempt to clean compromised systems. Rebuild from a known-clean snapshot.\u201d<\/p>\n<p>In the long term, organizations should enforce <code>npm ci \u2014ignore-scripts<\/code> in CI\/CD pipelines to prevent <code>postinstall<\/code> hooks from executing during automated builds and consider package age policies such as <a href=\"https:\/\/socket.dev\/blog\/npm-introduces-minimumreleaseage-and-bulk-oidc-configuration\">npm\u2019s minimumReleaseAge setting<\/a>. This gives development teams the ability to block the installation of packages that don\u2019t have a minimum age, which would have blocked this attack since \u201cplain-crypto-js\u201d existed for less than 24 hours before being pulled into Axios\u2019 dependency tree.<\/p>\n<p>The use of AI tools like Claude Code or OpenAI Codex in enterprise environments via their respective desktop apps extend the impact past developer environments. These tools are increasingly being used by non-developers in their work workflows, and LLMs tend to rely heavily on the npm and PyPI ecosystems for CLI tools.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Attackers compromised the npm account of the lead maintainer of Axios, a widely used JavaScript HTTP client library, and used it to publish malicious versions of the package that deployed a cross-platform remote access trojan on developer machines. The incident represents the highest-impact npm supply chain attack on record given Axios\u2019 approximately 100 million weekly downloads and its presence in frontend frameworks, backend services, and&#8230; <\/p>\n<p class=\"more\"><a class=\"more-link\" href=\"https:\/\/newestek.com\/?p=16027\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16027","post","type-post","status-publish","format-standard","hentry","category-uncategorized","is-cat-link-borders-light is-cat-link-rounded"],"_links":{"self":[{"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/posts\/16027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16027"}],"version-history":[{"count":0,"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/posts\/16027\/revisions"}],"wp:attachment":[{"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}