Skip to content

Secure NPM #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Secure NPM #16

wants to merge 2 commits into from

Conversation

wilk
Copy link

@wilk wilk commented Jul 13, 2018

No description provided.

@wilk wilk changed the title first draft of SNPM RFC Secure NPM Jul 13, 2018
@wilk
Copy link
Author

wilk commented Jul 13, 2018

I tried to link it to the rfc's community forum but I can't do that because I got the following error: "Sorry you cannot post a link to that host."
May I consider this RFC opened?

@devsnek
Copy link

devsnek commented Jul 14, 2018

how does this fix the situation when malicious code runs on a user's computer, like with the most recent worm? in most cases people don't lock down their git push any more than they lock down their npm publish...

not to say that increased visibility is bad but I think this dodges the actual problem. some form of 2fa on every publish might be a better solution, although I'm sure that isn't a complete solution either.

@wilk
Copy link
Author

wilk commented Jul 16, 2018

@devsnek That's right, this is not THE solution, this is A solution, kinda improvement.
Preventing malicious code is a complex topic but this solution improves visibility and implement a sort of double-check by the NPM's server before a new package is being published.

@naugtur
Copy link

naugtur commented Aug 5, 2018

Would that be mandatory for each publish after it gets introduced? Sounds like a lot of work for the kinds of people with 100 published packages.

Would it be possible to have automation applicable to ~80% of cases?

@mjp0
Copy link

mjp0 commented Oct 8, 2018

In my opinion this needs to be merged asap and should be mandatory in any future package updates. It makes no sense that we sacrifice even a small part of the security of all possible end users for the small inconvenience of adding a verification step in the build process that can and should be automated anyway.

@wilk
Copy link
Author

wilk commented Nov 27, 2018

Another relevant issue for this topic: dominictarr/event-stream#116

@superlbr
Copy link

why not maintain a blacklist in github

@kurtextrem
Copy link

@superlbr I don't think that would be the right solution, because you have to find compromised packages first in order to add them to a list. When that is the case, it is too late already (most likely).

@dead-claudia
Copy link

@wilk Attacking this is simple: direct npm to a Git branch that conveniently confirms its "integrity", then once you confirm it's published successfully, delete the commit and branch to cover your tracks.

@superlbr
Copy link

superlbr commented Nov 28, 2018

@kurtextrem there should be whitelist also, who is able to granted to maintain such an important repository,like grades in credit card

@zkat
Copy link
Contributor

zkat commented Jan 24, 2019

Hey, thanks for submitting this!

I believe this is a very roundabout way of achieving the sort of thing you'd get when using package signing, and the preferred solution here would be for us to get around to actually implementing and releasing package signing support in the CLI.

There are two significant problems with this proposal that I think are blockers to it moving forward:

  1. It assumes git repositories will be existent and available reliably.
  2. A large % of packages out there use files to selectively publish, and/or they use some sort of transpilation or bundling process, which will make shasums simply not match, or often not match.

As far as the quoted attacks, and other attacks go, this would either not solve it, or there's other, better solutions for the same attack, such as two-factor authentication and package signing.

We've decided we're going to continue to proceed in that direction, and so we'll be closing this PR. Thank you so much again for taking the time to write this and submit it, and thanks a bunch for everyone involved in the conversation. Keep an eye out for package signing! It's on our roadmap, as are other security features coming in 2019. Making sure the registry is safe to use is a very high priority for us, as is making sure that security doesn't compromise the quality of user experience our userbase has come to expect from npm.

@zkat zkat closed this Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants