-
Notifications
You must be signed in to change notification settings - Fork 6
feat(shims): Bundle endoify dependencies #31
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
Conversation
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is a deprecated package?The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed. Research the state of the package and determine if there are non-deprecated versions that can be used, or if it should be replaced with a new, supported solution. What is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. What is an AI-detected potential code anomaly?AI has identified unusual behaviors that may pose a security risk. An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding. What is new author?A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package. Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights. What is shell access?This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code. Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
It was supposed that, because a critical behavior of the shims is their behavior under bundling, the test command in the shims package should include building prior. However, it is worth noting that the build is assumed to run in node 20 and fails in node 18 due to the nonexistence of import.meta.dirname at that version. However, the hard requirement is only that the build be performed prior to testing. The CI does this already, building with node 20 and then testing under both 18 and 20. Thus the build prephase can be safely removed from the test command without endangering the consistency of the `main` branch; caveat that developers may need to rebuild before testing while developing in the shims package.
bce5810 to
e08bdaa
Compare
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
SMotaal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good with all the tests now running. So pending a review for the SocketSecurity notices, it is otherwise GTG!
|
Noting for posterity: The CI build job requires that In order to allow the shims package to test its built shims, we prefix the shims test command with As @SMotaal noted, we can meet this constraint by replacing the node 20 implementation of |
Closes #9
Refs: #21
Copies untransformed the dependencies of
src/endoify.mjsinto the header ofdist/endoify.mjs. Replaces the import statements of the source file with the commentsto suggest that the bundler will inline them directly. These comments are not functional but as we learn more about vitest plugins I suspect they may be the maintainable method to effect this behavior.
The tests for this implementation are run by ava, not vitest, in accordance with the reasoning I outlined in #21 (comment)
Adds the
avadev dependency.