Description
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 a package-lock.json
or yarn.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.