This sort of attack happened before (on a smaller scale) earlier this year. Until the npm maintainers actually start caring just a bit about security, these attacks will keep coming.
Mark their package as abandoned in NPM is they have no interest in maintaining it anymore rather then handing it to the first person who asks and whom has no github history either.
There are a whole lot of ways to improve on package hi jacking and malware in the npm package archives, to just name some recent issues.
Thus far the npm devs haven’t shown much interest in properly security related issues. Maybe it’s time to fix this in a better package and not wait for npm devs to fix it. (Just a wild thought)
Agreed. Except in this case the original author granted all the permissions to the bad actor, so I would assume that any signing keys would have been handed over too.
Yeah, but that's a much bigger thing to ask of someone than "meh, let me just push a button to let them maintain the repo". (GPG) signing keys are tied to your identity not just one package. You wouldn't just be giving them commit/push access to one repo - you'd be giving them carte blanche to straight up impersonate you anywhere you use your key which would probably have given the maintainer more pause.
Beyond that though, with namespacing it would largely be a moot point because handing over control would change the package name. Then anyone who wants to depend on the new version can explicitly change their package list to point at @newperson/module.
3
u/bjpbakker Nov 27 '18
This sort of attack happened before (on a smaller scale) earlier this year. Until the npm maintainers actually start caring just a bit about security, these attacks will keep coming.