Replies
I guess a good starting point would be to look at the npm cli because those problems are all also present there; they're just hidden behind the veneer of the cli. I think we also need to clarify something from the discussion that happened over in the PR: when we say "HTTPS imports" do we mean that they are simply another way to reference and import modules into the node_modules, or are they implicitly dynamic imports? |
Concern to Mitigate: Cross Origin Access E.G. |
HTTPS Agent support. Given we are going to download many files, hopefully from the same domain it's critical for "first time" startup performance to keep the connections alive. |
Visible caching on disk. I think we should cache what is downloaded in the project folder and recommend this to be committed to the repo itself. I propose we use a |
HTTP Proxy support for downloading modules. A good way to mitigate many availability attack is to download the modules through an HTTP proxy. Currently Node.js does not have this functionality built-in. |
I've made https://github.com/bmeck/local-fs-https-imports to play around with the purely ahead of time idea before trying to merge such a feature into core itself. |
Concern To Mitigate: process
the hole process contains way to much information that can be leaked |
I've made a doodle to have a call to discuss how to move this forward, likely this call will try to recur every 2 months as various things are likely to be around phasing and when/how to address concerns in this discussion when implementing this and how to move towards a stable release. |
Concern: npm packages using HTTPS imports. Posting this to link discussion from @ljharb in #36328 (comment) re implications for supporting in node_modules. Personally I would be concerned about npm packages being published that use HTTPS imports as that very much changes the security model / contract that npm provides to users in being able to comprehensively replicate a module graph via only a node_modules filesystem model. This likely won't be a problem initially as no one would publish a package to npm that isn't supported in older Node.js versions, but once support reaches all versions, some company might think it's a good way to automatically manage updates / ensure registered code delivery. While that is already possible today via network based processes and even install hooks, it's a pattern that we have luckily so far avoided from happening too much and I hope we can continue to work towards ensuring strong guarantees around the registry and package contracts that ensure end user agency. I haven't watched the video so apologies if this is repeating talking points already said, feel free to fill in further here. |
meta concern to mitigate: accidental inclusion of transitive mutable state via node_modules. A user should not have node_modules introduce transitive mutable state unless they opt-in to allow such behavior. This is important to ensure that node_modules can be seen as effectively immutable. While node_modules are not technically immutable today the general practice allows them to be treated as immutable; the introduction of network based transitive mutable state is actively more unstable and a concern around security and robustness that needs to be mitigated by other means as seen in this discussion. |
Concern to mitigate: using other protocols to hop to local resources. It is possible currently for |
Concern to mitigate: preventing injection of arbitrary locations to It should be possible to differentiate if a dependency is allowed to be loaded by dynamic import. Static import has hard coded strings and is less vulnerable to manipulation than CC: @vdeturckheim per https://docs.google.com/document/d/1tS80LmzraV4yXEYIQ-fWaCm2MIpXfbtrSYjsI8kWKko/edit#heading=h.ifctpvwuev0a |
This comment has been minimized.
This comment has been minimized.
IMHO this feature should be provided by Therefore, it is more important to work on loaders API stability which will allow to loading modules from anywhere (e.g. from tgz file etc.) and however (on the fly, with file cache etc.). |
Github PR UI is not well suited to this level of conversation
Discussing PR #36328Discussing implications of HTTPS imports as a whole