Is it typical in the JS space to include dependencies without versioning? Also, curious: does freezing a version really provide much protection? Shouldn’t a commit hash be used? (Attacker can change a tag.)
packages published to npm are immutable. if you pin a version, you get the same exact version as long as MSFT servers are not compromised. Installing from git is not recommended and has more issues than you might think https://dev.to/naugtur/a-phish-on-a-fork-no-chips-52cc You are supposed to update packages, even if you use lockfiles (very common) or tools that pin your direct dependencies (renovate etc. not so comm…
You too can run malware from NPM (I mean without consequences)
21–30 of 122 posts
Re: You too can run malware from NPM (I mean without consequences)
#22Is it typical in the JS space to include dependencies without versioning? Also, curious: does freezing a version really provide much protection? Shouldn’t a commit hash be used? (Attacker can change a tag.)
packages published to npm are immutable. if you pin a version, you get the same exact version as long as MSFT servers are not compromised. Installing from git is not recommended and has more issues than you might think https://dev.to/naugtur/a-phish-on-a-fork-no-chips-52cc You are supposed to update packages, even if you use lockfiles (very common) or tools that pin your direct dependencies (renovate etc. not so comm…
Depends how you'd refer to them... tags ("@latest", "@next" etc.) are not immutable and it's best to rely on the checksums in the lock file.
Re: You too can run malware from NPM (I mean without consequences)
#23Earlier quoted context omitted.
click through to the article, it has a link to a view that lists the laughable profit
I'm actually shocked they have not stolen more seeing the breach impact radius? Perhaps we can thank wallets and exchanges for blacklisting the addresses and showing huge warnings like the one shown in the article.
Re: You too can run malware from NPM (I mean without consequences)
#24Is it typical in the JS space to include dependencies without versioning? Also, curious: does freezing a version really provide much protection? Shouldn’t a commit hash be used? (Attacker can change a tag.)
The package-lock.json includes a hash of the package, not just a version number which should be immutable.
Re: You too can run malware from NPM (I mean without consequences)
#25I’ve been out of the loop with npm for a while, but are there still no package namespaces?
Re: You too can run malware from NPM (I mean without consequences)
#26npm should take responsibility and up their game here. It’s possible to analyze the code and mark it as suspicious and delay the publish for stuff like this. It should prevent publishing code like this even if I have a gun to my head
Or at a minimum support yubikey for 2fa.
Re: You too can run malware from NPM (I mean without consequences)
#27Earlier quoted context omitted.
click through to the article, it has a link to a view that lists the laughable profit
Huh. I read TFA in detail (and shared with my team), but I didn’t see any analysis. (?)
Re: You too can run malware from NPM (I mean without consequences)
#28Earlier quoted context omitted.
click through to the article, it has a link to a view that lists the laughable profit
Huh. I read TFA in detail (and shared with my team), but I didn’t see any analysis. (?)
500 USD, not bad for a month of work if the author is from a 3rd world country.
Re: You too can run malware from NPM (I mean without consequences)
#29Earlier quoted context omitted.
click through to the article, it has a link to a view that lists the laughable profit
Huh. I read TFA in detail (and shared with my team), but I didn’t see any analysis. (?)
>Pretty low impact for an attack this big. Some of it seems to be people mocking the malware author with worthless transfers.
I believe this is the section. As far as I understand the link, it's about $500. I don't understand how you read if a donation is a worthless mockery donation.
Re: You too can run malware from NPM (I mean without consequences)
#30Earlier quoted context omitted.
npm is on life support by msft. But there's socket.dev that can tell you if a package is malicious within hours of it being published.
“within hours” is at least one hour too late, and most likely multiple hours.
Anyway, the case where reactive tools (detections, warnings) don't catch it is why LavaMoat exists. It prevents whole classes of malware from working at runtime. The article (and repo) demonstrates that.