r/programming • • Nov 27 '18

event-stream vulnerability explained

https://schneid.io/blog/event-stream-vulnerability-explained/
147 Upvotes

21 comments sorted by

View all comments

15

u/Vakz Nov 28 '18

Really is a very creative attack. Still, my understanding is that at the very core, it's still a case of social engineering. The attacker couldn't have done this if he hadn't been given full access to the git repo. I've seen a lot of people blaming NPM for this, but surely this attack would've been possible in any environment which uses package management, be it NPM, Nuget, Maven, pip or any other. The only exception I can see here is that it's harder to detect here, due to the custom of minifying, as my understanding from this summary is that the malicious code was only present in the minified version.

0

u/[deleted] Nov 28 '18

[deleted]

1

u/Vakz Nov 28 '18

NPM will automatically update you to the latest compatible version of all of your dependencies every time you build

But it doesn't, though. You can specify the exact version you want to use. NPM does produce lock files.

5

u/joesb Nov 28 '18

Except npm installwill happily install new patch version and silently override your lock file.

Really, look it up.

You have to use npm ci if you want npm to really follow the lock file.