by wolfgang42 · 9y ago · 0 comments
Paper: http://incolumitas.com/data/thesis.pdf
Blog post: http://incolumitas.com/2016/06/08/typosquatting-package-mana...
Discussion: https://news.ycombinator.com/item?id=11862217 https://www.reddit.com/r/netsec/comments/4n4w2h/
The paper also discusses possible mitigation measures, including prohibiting registering new packages within a certain Levenshtein distance of existing packages and using additional namespacing.
Even if NPM isn't prohibiting packages, you'd imagine they'd have internal security alerting for Levenshtein distance from the names of very popular npm packages. Such an alerting script wouldn't take terribly long to write (or to run). It'd let them catch this type of abuse much faster even if they decided (for some inane reason) that banning the names outright would break UX.
`npm install` runs code as part of the initial step.
Also, `npm install foo` will of course not just run code from `foo` but from all its dependencies and their dependencies dependencies as well.