-
Notifications
You must be signed in to change notification settings - Fork 809
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
Security of dependencies #619
Comments
Also worth mentioning that some production dependencies have been vendored:
However these versions are not yet locked down in the bcoin |
So I've looked at forking mocha (as mentioned at #628 (comment)) with vendored dependencies at https://github.com/braydonf/mocha/commits/vendor and the associated bcoin branch using that version is at https://github.com/braydonf/bcoin/commits/lockfile There are 23 dependencies for mocha, here is a breakdown of the lines:
That's not including the development dependencies for mocha which go over 2000, and several with known vulnerabilities, which can't be fixed by upgrading to the latest versions of each of the development dependencies. |
Here is another view of mocha dependencies based on maintenance (last updated):
|
Mmm, mocha is messier than I thought it was. I started working on a minimal reimplementation: https://gist.github.com/chjj/4fc87c2b3e882c9d240a544488639f7e It's quick and dirty, but it's good enough to run the entire bcoin test suite. Don't know if we want to pursue this more. |
Okay cool, was taking a look at something similar based on a minimal test bootstrap from: https://github.com/braydonf/chainbeacon/blob/master/test/bootstrap.js |
Package up here: https://github.com/chjj/bmocha I've been testing it all day and it seems to work. I think I'm going to start migrating packages over to it. I figure if it turns out it's somehow broken, we can just point the bmocha repo to your vendored mocha. |
I tried in on one of my work-in-progress branches (#605) and ran into a few issues. |
Just pulled master df1e8c0 reinstalled:
...but this only happened once and it will not reproduce! Reinstalling and running individual tests is all fine. ✅ No error recurrence since the first run test. I have had tests RANDOMLY fail before -- Javed fixed the last case: #529 |
As of v1.0.2 of bcoin, dependencies are not locked to a specific hash, and can be installed with any matching version regardless of what code there might be associated with that version.
Aside from one's own diligence and review of dependencies, bcoin installation would, at best, inherit the security of the npmjs repository. There have been known with executed attacks against the repository (see https://eslint.org/blog/2018/07/postmortem-for-malicious-package-publishes).
Furthermore, there are many development dependencies that have not been published in over a year, and therefore have not upgraded to use secure hash functions, as there has been known and practices collision attacks against sha1 (see https://shattered.io/) for over a year. So even with a package lockfile there would still be issues.
From discussion with npmjs security about mitigating issues with sha1, there is possible migration process, however it has not yet been made a priority there.
I've opened a PR to add a lockfile and move development dependencies that would be then required to be manually installed, however there hasn't been activity or review (see #569).
What are the next steps?
The text was updated successfully, but these errors were encountered: