-
Notifications
You must be signed in to change notification settings - Fork 147
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
Secure NPM #94
base: master
Are you sure you want to change the base?
Secure NPM #94
Conversation
Refs to: yarnpkg/yarn#1169 |
Hey! Thanks, I have a few comments
Overall I personally don't think this solves enough problem to be worth the added complexity. |
This PoC is an improvement for facing issues like this and this.
If the build is sand-boxed (for instance on docker on a separate CI server), then there shouldn't be no threat for the registry.
Nothing but then you'll become an untrusted author.
The public repository holds only the source code.
Github is a placeholder for a generic public repository.
It wouldn't.
So, yarn do not really publish anything on any registry?
Fair enough. |
Unless I misunderstood something, the worm was only detected because it was bogus, not because someone actually checked the source code. Your proposal would help a bit, but only because the maintainers could see more easily that something has been pushed on their repository than on their npm releases. But that's something that should be fixed on the registry side imo.
That's a big
What if they do? You're fighting against an ecosystem, so you need to be prepared to have an answer. I can see multiple reasons why someone would want not to bother with a delegated build system.
We do publish, but if the registry doesn't implement your "please build the package from my repository" spec, I don't see what point there would be implementing something on our side.
I agree, but I don't think this proposal will prevent this situation. |
Overall this sounds somewhat similar to how Packagist (PHP) works. With Packagist, the only way to push a package is by tagging your repo with a version number, and then their server pulls from your repo and produces a tarball. However, it works in PHP because there's no compilation step, so the code in the repo is exactly the code that's executed. That's not the case with a lot of modern JavaScript, which unfortunately requires a compilation step before execution. I'm not quite sure I understand the benefit of pushing the compiled code to a Git repo. Now instead of creating a tarball of arbitrary code, you're just pushing that arbitrary code into a Git repo before packaging? I don't see how that's more secure - it's still arbitrary code being packaged. It won't prevent someone from hiding malicious code somewhere.
Yarn uses the npm registry; we don't have a separate registry. |
Additionally, there's no requirement that any npm package have any JavaScript in it at all. |
This is how Open Source Software works.
How?
All systems can be hacked. Even hardware.
This is the current situation.
I explained myself badly.
The point is: if an author is publishing a package, the registry cannot trust him just because it's easier to do.
That's right, then this PR is non-sense here on Yarn 👍
As I said, this is not the solution: it's just an improvement to stay closer to the Open Source specs and thus an improvement to the security (community-watched). May I suggest you to read (or to read again) the article I've linked above?
And this is a reason more to implement something like SNPM and to separate closed source packages from open source ones. Frankly, I think NPM's consumers (yes, me included) trust NPM just for convenience and the status quo will be kept until a sever major security issue happens. |
No description provided.