-
Notifications
You must be signed in to change notification settings - Fork 74
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
Package name integrity in compartment maps, lavamoat policies #629
Comments
|
See also #619 |
@dckc theres a few other ways a "non-canonical" (wrt to the npm registry) package name can be used, such as |
Policies are applied based on the Meanwhile, we're also debating alternatives to current aa canonical names that would not rely on the layout of node_modules on disk. Package name should be distinct by dependency source in all cases but bundled dependencies so we'd only need to find a way to identify those. |
I've created a test case specifically for that bundled dependency scenario.
We do have a place in the codebase that seems to be affected by this trick though. Not sure where, but the test is failing with @kriskowal I might need some help figuring this out. |
At time of writing, the Endo compartment-mapper’s
compartmentMapFromNodeModules
utility generates a compartment map for a Node.js application as described on disk, as laid out presumably by a Node.js package manager. An alternative approach is to generate a compartment map from the information noted in apackage-lock.json
oryarn.lock
, which have additional metadata.Lavamoat policies apply to any package with a matching name. There is a potential attack where a dependency declares a dependency with a URL instead of a version range predicate, thereby allowing that package to pose as the named package to the rest of the application. Instead, the Lavamoat policy should apply to any package with a matching resolved name pattern, and the name should be inferred from the dependency entry in the dependee package.json.
This can also be mitigated by having
compartmentMapFromNodeModules
forbid URL dependency values, but this is probably impractically proscriptive.cc @erights @kumavis
The text was updated successfully, but these errors were encountered: