Not pretty, not Windows-only: npm phishing attack laces popular packages with malware
- Reference: 1753351265
- News link: https://www.theregister.co.uk/2025/07/24/not_pretty_not_windowsonly_npm/
- Source link:
This was likely caused by a phishing attack using a typosquatted clone of the official npm site.
The "is" package is used for JavaScript type testing and is downloaded around 2.7 million times a week. Version 3.3.1 includes an obfuscated JavaScript malware loader, as [1]reported by the team at Socket , which provides a security platform for developers.
[2]
The malware captures data including all environment variables (often a source of secrets such as credentials), exfiltrates them via a WebSocket connection, and provides the attacker with an interactive remote shell. The malware runs on Node.js on macOS, Linux and Windows, and persists itself if possible by overwriting an index.js file so that even deleting the node_modules directory, which stores downloaded packages, will not remove it.
[3]
[4]
Maintainer Jordan Harband reported the problem last weekend, stating that it was "due to another maintainer's account being hijacked." According to a [5]thread on Bluesky Harband himself was deceived by an email from a former package owner who had been removed and asked to be re-added.
"Everything seemed normal, so I obliged (irritated that npm would remove an owner without notifying the other owners) and the next morning this was published," he said.
[6]
Socket also found malicious releases of the got-fetch package following another maintainer account compromise.
The incident coincides with the compromise of another set of packages related to (but not including) the prettier code formatter, including eslint-config-prettier and eslint-plugin-prettier. Maintainer Joun Qin received an email apparently from npm asking for email verification. The email linked to npnjs – note npn and not npm – which was a clone site designed to grab credentials.
"I was tricked by a phishing email and a new npm token was added and leaked then some popular packages I'm maintaining were released with malicious software," Qin [7]said on X .
[8]
The infected packages included a Windows DLL (dynamic linked library) which results in an attack on the Chrome browser and stolen configuration files, according to an [9]analysis by cybersecurity company InvokeRE.
Qin did check the sending email address of the phishing email which came from npmjs.org – a domain owned by npm but not normally used for email and therefore lacking DMARC (domain-based message authentication) security. NPM emails normally come from the npmjs.com domain.
[10]LLMs can't stop making up software dependencies and sabotaging everything
[11]GitHub supply chain attack spills secrets from 23,000 projects
[12]Massive spike in use of .es domains for phishing abuse
[13]AI hallucinates software packages and devs download them – even if potentially poisoned with malware
Npm packages are a valuable target for attackers. Developer machines are often a source of valuable credentials, packages are automatically downloaded as dependencies, and there is potential for further infection of deployed applications. The combination of compromised packages and agentic AI, which might download packages without human oversight, could be a perfect storm of automated malware distribution.
Harband also [14]said on X that a new initiative from Google called [15]OSS rebuild is "the actual solution for the thing that provenance will always fail to achieve." Google's project rebuilds a package from source and compares it with the version in the registry, with support for npm, PyPi and Crates.io – therefore covering Node.js, Python and Rust.
"Most packages obtain protection effortlessly without user or maintainer intervention," said the Google Open Source Security Team.
Whether it is OSS rebuild, or something else, the latest npm incident shows that blindly downloading packages, even from the standard official repositories, is a significant risk.
Get our [16]Tech Resources
[1] https://socket.dev/blog/npm-is-package-hijacked-in-expanding-supply-chain-attack
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aIZNOYc6XxRy2hSBY0ud3QAAANA&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aIZNOYc6XxRy2hSBY0ud3QAAANA&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aIZNOYc6XxRy2hSBY0ud3QAAANA&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[5] https://bsky.app/profile/jordan.har.band/post/3ludlwjseec2w
[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aIZNOYc6XxRy2hSBY0ud3QAAANA&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[7] https://x.com/JounQin/status/1946297662069993690
[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aIZNOYc6XxRy2hSBY0ud3QAAANA&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[9] https://invokere.com/posts/2025/07/scavenger-malware-distributed-via-eslint-config-prettier-npm-package-supply-chain-compromise/
[10] https://www.theregister.com/2025/04/12/ai_code_suggestions_sabotage_supply_chain/
[11] https://www.theregister.com/2025/03/17/supply_chain_attack_github/
[12] https://www.theregister.com/2025/07/05/spain_domains_phishing/
[13] https://www.theregister.com/2024/03/28/ai_bots_hallucinate_software_packages/
[14] https://bsky.app/profile/jordan.har.band/post/3lukvutwu722w
[15] https://security.googleblog.com/2025/07/introducing-oss-rebuild-open-source.html
[16] https://whitepapers.theregister.com/
Re: Anyone see the problem?
I think the issue is that people continue to download random software packages from the Internet without any form of verification, not what they're using them for. The behaviour has become so normalised hardly any one seems to give it a second thought.
Re: Anyone see the problem?
"Npm packages are a valuable target for attackers. Developer machines are often a source of valuable credentials, packages are automatically downloaded as dependencies "
That's the problem CI/CD of M alware .
Re: Anyone see the problem?
I have actually worked alongside web devs for a fair bit of my career, so I'm not just making shit up. It is one thing depending on these "non-essentials", but if I were the boss I would limit their use to prototyping.
Next step - download the package _locally_ and check it over. Use your local copy.
Even better, find the bits of functionality that you actually need and extract & sanitize them. Write your own code.
Not exactly rocket science!
Re: Anyone see the problem?
"if I were the boss"
There's the problem, you're not. The actual boss probably wants as many corners cut as possible.
Re: Anyone see the problem?
This. It looks really easy and a no-brainer because you're not at the end of your second 60 hour week with a burgeoning inbox and 50 unread slack notifications demanding you went live yesterday.
Even the most seasoned devs and sysadmins can make big booboos under these kinds of pressures.
Re: Anyone see the problem?
"Next step - download the package _locally_ and check it over. Use your local copy."
Not always possible due to licence retrictions when using commercially
"Even better, find the bits of functionality that you actually need and extract & sanitize them. Write your own code."
Yes, this. If you can't licence it for local use, then don't use it :-)
Re: Anyone see the problem?
I'm still not entirely sure. But here's one definition:
is.defined = function (value) {
return typeof value !== 'undefined';
};
It's syntactic sugar for a language feature.
Some of the others are more involved and there are subtle issues which may need wrapping up in a function (i.e. cross realm). But Jordan could get this in the language, if he wanted. I like Javascript, but I despair of some of this.
Is it any wonder so many of us use NoScript?
Sorry Doc, but this pain be on the serving side; beyond the reach o’ the usual browser medication.
Anyone see the problem?
"The "is" package is used for JavaScript type testing" - WTF?