News for hackers. Stuff that matters.
Re:Plot to steal cryptocurrency foiled by NPM by MoronInAHurry on Saturday June 08, 2019 @05:31PM (#20135316)
NPM foils plot that was only possible due to ridiculous house of cards built by NPM.

I notice that the NPM blog post also fails to mention that it was actually successful and resulted in about 1 million KMD (current value ~$1.7M) being stolen. The Komodo blog post contains that information: https://komodoplatform.com/update-agama-vulnerability/

Even worse, they had also successfully stolen about 9 times more than that. The only reason it was prevented was because the seeds were being sent to a public server, and Komodo was able to access and use them to "steal" the 8 million coins (and 96 BTC) from those wallets before the attacker did.

This was a successful $10M+ theft that NPM is somehow trying to spin into a positive.

Re:Plot to steal cryptocurrency foiled by NPM by aasasd on Saturday June 08, 2019 @07:50PM (#20135983)
I went straight to the comments on this HN submission because I knew NPM couldn't just be good guys.
Re:Plot to steal cryptocurrency foiled by NPM by wheelerwj on Saturday June 08, 2019 @06:01PM (#20135449)
agreed for the most part. "Foiled" is pretty much the wrong word here. Maybe "Detected and halted further loss..."
Re:Plot to steal cryptocurrency foiled by NPM by gcb0 on Saturday June 08, 2019 @09:41PM (#20136441)
That's wrong too.

What they did was to allow komodo to, vigilante style, outright steal the coins, and hold them hostage until you entertain them with proof of ownership/identity and whatever other ridiculous requirements they come up with.

But it's npm and kleptocurrency. Nothing of value lost.

Re:Plot to steal cryptocurrency foiled by NPM by rbanffy on Monday June 10, 2019 @07:39AM (#20145711)
> kleptocurrency

Love that!

Re:Plot to steal cryptocurrency foiled by NPM by gcb0 on Tuesday June 11, 2019 @07:44PM (#20160530)
trying to make that catch since 2013 :D
Re:Plot to steal cryptocurrency foiled by NPM by spyder on Saturday June 08, 2019 @07:45PM (#20135961)
Hm... to claim the coins they saved, you have to receive and send a small transaction from the compromised wallet to verify ownership. But how do they make sure that it's not claimed by the hackers who may have the seed of these wallets? The only thing they say is that they don't send it if there is multiply claims (probably one from hacker and one from real owner).
Re:Plot to steal cryptocurrency foiled by NPM by Chazprime on Saturday June 08, 2019 @07:05PM (#20135796)
I’m honestly amazed this hasn’t happened more often; it’s ridiculous that a developer has to install thousands of lines of code to create a simple “hello world” website.
Re:Plot to steal cryptocurrency foiled by NPM by aasasd on Saturday June 08, 2019 @07:48PM (#20135969)
Guess someone slipped you a wrong thing instead of Node, because for me, about five lines and zero dependencies work fine.
Re:Plot to steal cryptocurrency foiled by NPM by tedunangst on Saturday June 08, 2019 @08:00PM (#20136035)
Probably confused node and react.
Re:Plot to steal cryptocurrency foiled by NPM by saxonww on Saturday June 08, 2019 @08:20PM (#20136118)
Maybe the post has been edited, but just now it reads '"hello-world" website'. When I search for "create a website with node.js" the top results all talk about using Express.js.

If I `npm init` and then `npm install express` as suggested, the result is 50 packages installed containing 21707 lines of javascript.

edit: trying to show what people are steered towards when looking up how to do this themselves.

Re:Plot to steal cryptocurrency foiled by NPM by dane-pgp on Saturday June 08, 2019 @08:23PM (#20136133)
React is a better example:

https://twitter.com/dylanbeattie/status/1098204272653676544?...

"Before you even open a text editor, your project contains 1.5 million lines of code. Most of it contributed by volunteers and enthusiasts. No formal review or release process."

Re:Plot to steal cryptocurrency foiled by NPM by wgoodall01 on Saturday June 08, 2019 @09:37PM (#20136414)
I feel that this isn't quite a fair comparison.

Take any other language with a web framework---Ruby with Rails, Java with Play/Spring, any web server which exposes a CGI interface, Python with Django/flask/whatever---and you will find a colossal amount of framework code behind the simple "hello, world!" demo.

Web apps are complex things, especially when the framework has to account for common cross-cutting concerns and patterns elegantly and succinctly. The fact that the JS ecosystem with NPM exposes that complexity to the user directly with an (albeit massive) node_modules installation isn't a strike against node per se: other languages have this code too, they just don't stash it all in the same folder as your project.

If you want to criticize the JS ecosystem, doing it on the basis of sheer SLOC downloaded by an `npm install` isn't too great.

We can talk about the quality of these packages, or about code review standards, or about the unique challenges auditing code from many sources for bugs and security problems. But talking about how the framework code gets installed seems counterproductive.

Re:Plot to steal cryptocurrency foiled by NPM by scrollaway on Saturday June 08, 2019 @10:12PM (#20136585)
No need to repeat what others said, but I'll also note that create-react-app is a website boilerplate generator and includes preconfiguration for tons of stuff including test frameworks etc.

So yes, before you even open a text editor, you have eslint, jest, typescript etc all set up. Duh-doy, that's a lot of lines of code.

Sigh…

Re:Plot to steal cryptocurrency foiled by NPM by cameronbrown on Saturday June 08, 2019 @09:05PM (#20136287)
A terrible argument given that React is a Facebook project, initially built and shipped by only Facebook employees, not random volunteers.
Re:Plot to steal cryptocurrency foiled by NPM by fold_left on Saturday June 08, 2019 @07:08PM (#20135803)
[citation needed]
Re:Plot to steal cryptocurrency foiled by NPM by matthewbauer on Saturday June 08, 2019 @05:48PM (#20135395)
I don’t think it’s fair to single npm out here. The truth is any package manager that lets anyone publish package updates is vulnerable to this type of attack.
Re:Plot to steal cryptocurrency foiled by NPM by GordonS on Saturday June 08, 2019 @06:26PM (#20135606)
NPM has, specifically and deliberately, played down the successful theft here, making out that they completely foiled it.

If they hadn't done such a scummy, corporate spin job on this, I'd be inclined to agree with you - but they did.

Re:Plot to steal cryptocurrency foiled by NPM by dtech on Saturday June 08, 2019 @06:11PM (#20135520)
npm encourages an auto-upgrading versioning scheme: take version x or higher.

It's great for keeping dependencies up-to-date, but this makes it immensely vulnerable to the kind of malware injection, as publishing a library version with payload will immediately propagate throughout the ecosystem.

In most other version managers (e.g. maven) every library and application specifies a hard-coded version, which requires users to manually upgrade, giving a window were a malicious version can be detected before it affects anyone.

Re:Plot to steal cryptocurrency foiled by NPM by nullandvoid on Saturday June 08, 2019 @06:26PM (#20135604)
For a security critical app not locking down the dependencies to audited versions seems very dangerous indeed and I believe there is some blame to be had there
Re:Plot to steal cryptocurrency foiled by NPM by matthewbauer on Saturday June 08, 2019 @07:03PM (#20135782)
You’re still vulnerable if you lock down dependencies during the period the malicious code is wild though. You have to actually audit your locked dependencies to consider yourself safe.
Re:Plot to steal cryptocurrency foiled by NPM by undecisive on Saturday June 08, 2019 @08:37PM (#20136177)
Isn't that expecting the car to be invented before the wheel?

From what I've seen, quite a few of these have been targetted attacks - the assailants have targetted specific variables that existed in a specific codebase that they knew imports their module. Of course, if you've only just started writing that codebase, your dependencies have no way of knowing where you're storing private keys (short of somehow scanning the object space for variable names like "private_key")

But yes, in theory I would love for any *-sensitive code to go through a thorough audit after every dependency update before a version gets released in the wild. I'm guessing that next-to-nobody has the resources for that kind of an effort though.

Re:Plot to steal cryptocurrency foiled by NPM by cortesoft on Saturday June 08, 2019 @08:12PM (#20136086)
In this case, though, someone explicitly changed the included version to the malicious one.
Re:Plot to steal cryptocurrency foiled by NPM by matthewbauer on Saturday June 08, 2019 @07:17PM (#20135844)
This same thing is done anywhere semver is used or any other version range system. This includes python, rust, go, and many more.
Re:Plot to steal cryptocurrency foiled by NPM by fwip on Saturday June 08, 2019 @07:27PM (#20135897)
Go's official package management solution actually only fetches the minimum specified version of each dependency. So auto-upgrades never happen except when you explicitly update a dependency to a newer version.
Re:Plot to steal cryptocurrency foiled by NPM by SanchoPanda on Saturday June 08, 2019 @06:00PM (#20135444)
NPM isn't being singled out as part of a hypothetical risk analysis, this is about an attack that actually happened via NPM.
Re:Plot to steal cryptocurrency foiled by NPM by matthewbauer on Saturday June 08, 2019 @05:54PM (#20135416)
Semver probably makes the problem worse though.
Re:Plot to steal cryptocurrency foiled by NPM by wheelerwj on Saturday June 08, 2019 @05:59PM (#20135440)
how?
Re:Plot to steal cryptocurrency foiled by NPM by matthewbauer on Saturday June 08, 2019 @07:00PM (#20135771)
Dependency ranges mean package updates happen automatically. So a minor release could contain malicious code without anyone noticing. I still think semver is worthwhile even if it a little bit more vulnerable to this kind of attack.
Re:Plot to steal cryptocurrency foiled by NPM by solidasparagus on Saturday June 08, 2019 @09:57PM (#20136527)
Yeah, but a dependency attack is a rarer issue than out-of-date dependencies that contain known security vulnerabilities.
Re:Plot to steal cryptocurrency foiled by NPM by pdpi on Saturday June 08, 2019 @07:00PM (#20135773)
Because if you don't consider SemVer as part of your threat model, you'll specify "v1.2.3 or above" instead of "v1.2.3".