Skip to content
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

Create mechanism for committing hashes/checksums of published binaries to repos, and verifying them on install #358

Open
apendleton opened this issue Mar 24, 2018 · 3 comments

Comments

@apendleton
Copy link

node-pre-gyp currently has no mechanism for detecting a situation in which a built binary has been tampered with on s3 since its initial publication. We should have a way, after publishing a binary or set of binaries, to commit a hash (potentially signed, but might not be necessary) of the published binary to source control, publish it to npm, etc. This hash can be checked at node-pre-gyp install time, and can fail if a file on s3 has been tampered with.

For repositories that build and publish automatically on CI infrastructure in a single step as part of a release, we'll have to think about how these hashes would best make their way back into the repo. Maybe we can come up with best practices for producing them as build artifacts of some kind?

cc @mapbox/security @flippmoke

@daniel-j-h
Copy link

By now lots of sensitive packages are using node-pre-gyp to download pre-built binaries, e.g.

and without a mechanism to verify the binary's integrity and authenticity, overwriting the packages with a malicious binary can not be detected and will never be noticed by users installing these packages.

@NilSet
Copy link

NilSet commented Apr 24, 2023

A security researcher recently acquired a lapsed s3 bucket which was previously being used by a widely distributed NPM package to host pre-gyp binaries, and uploaded his own binaries which phoned home environment variables, so this is no longer a theoretical problem.

@calebbrown
Copy link

This exploit could have been avoided with this feature. GHSA-xv2f-5jw4-v95m

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

No branches or pull requests

4 participants