Article Details
Scrape Timestamp (UTC): 2026-02-13 10:48:55.383
Source: https://thehackernews.com/2026/02/npms-update-to-harden-their-supply.html
Original Article Text
Click to Toggle View
npm’s Update to Harden Their Supply Chain, and Points to Consider. In December 2025, in response to the Sha1-Hulud incident, npm completed a major authentication overhaul intended to reduce supply-chain attacks. While the overhaul is a solid step forward, the changes don’t make npm projects immune from supply-chain attacks. npm is still susceptible to malware attacks – here’s what you need to know for a safer Node community. Let’s start with the original problem Historically, npm relied on classic tokens: long-lived, broadly scoped credentials that could persist indefinitely. If stolen, attackers could directly publish malicious versions to the author’s packages (no publicly verifiable source code needed). This made npm a prime vector for supply-chain attacks. Over time, numerous real-world incidents demonstrated this point. Shai-Hulud, Sha1-Hulud, and chalk/debug are examples of recent, notable attacks. npm’s solution To address this, npm made the following changes: In combination, these practices improve security. They ensure credentials expire quickly and require a second factor during sensitive operations. Two important issues remain First, people need to remember that the original attack on tools like ChalkJS was a successful MFA phishing attempt on npm’s console. If you look at the original email attached below, you can see it was an MFA-focused phishing email (nothing like trying to do the right thing and still getting burned). The campaign tricked the maintainer into sharing both the user login and one-time password. This means in the future, similar emails could get short-lived tokens, which still give attackers enough time to upload malware (since that would only take minutes). Second, MFA on publish is optional. Developers can still create 90-day tokens with MFA bypass enabled in the console, which are extremely similar to the classic tokens from before. These tokens allow you to read and write to a token author’s maintained packages. This means that if bad actors gain access to a maintainer’s console with these token settings, they can publish new, malicious packages (and versions) on that author’s behalf. This circles us back to the original issue with npm before they adjusted their credential policies. To be clear, more developers using MFA on publish is good news, and future attacks should be fewer and smaller. However, making OIDC and MFA on-publish optional still leaves the core issue unresolved. In conclusion, if (1) MFA phishing attempts to npm’s console still work and (2) access to the console equals access to publish new packages/versions, then developers need to be aware of the supply-chain risks that still exist. Recommendations In the spirit of open source security, here are three recommendations that we hope GitHub and npm will consider in the future. In short, npm has taken an important step forward by eliminating permanent tokens and improving defaults. Until short-lived, identity-bound credentials become the norm — and MFA bypass is no longer required for automation — supply-chain risk from compromised build systems remains materially present. A new way to do it This entire time, we’ve been talking about supply-chain attacks by uploading packages to npm on a maintainer’s behalf. If we could build every npm package from verifiable upstream source code rather than downloading the artifact from npm, we’d be better off. That’s exactly what Chainguard does for its customers with Chainguard Libraries for JavaScript. We’ve looked at the public database for compromised packages across npm and discovered that for 98.5% of malicious packages, the malware was not present in the upstream source code (just the published artifact). This means an approach of building from source would reduce your attack surface by some 98.5%, based on past data, because Chainguard’s JavaScript repository would never publish the malicious versions available on npm. In an ideal world, customers are most secure when they use Chainguard Libraries and apply the recommendations above. Per the “Swiss cheese model of security,” all of these features are layers of additive security measures, and companies would be best off using a combination of them. If you’d like to learn more about Chainguard Libraries for JavaScript, reach out to our team.
Daily Brief Summary
npm has revamped its authentication process to combat supply-chain attacks, following incidents like Sha1-Hulud, by replacing long-lived tokens with short-lived, identity-bound credentials.
Despite improvements, npm remains vulnerable to attacks, as MFA on publishing remains optional, allowing potential bypass and exploitation by attackers.
Recent attacks, including those on ChalkJS, highlight the risks of MFA phishing, where attackers trick maintainers into sharing login credentials and one-time passwords.
The introduction of short-lived tokens aims to enhance security, but the persistence of MFA bypass for automation continues to pose a significant risk.
Chainguard's approach of building npm packages from verifiable upstream source code could significantly reduce the attack surface, as 98.5% of malicious packages were not present in the source code.
Adoption of Chainguard Libraries for JavaScript and layered security measures, like MFA, could strengthen defenses against supply-chain threats.
Companies are encouraged to adopt a multi-layered security strategy, combining npm's new practices with additional tools and protocols to mitigate ongoing risks.