You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
node climbs up to find modules, even in places like /home/node_modules, /node_modules, or C:\node_modules on Windows. The Windows case is particularly problematic because any user can create a directory in C:\.
Whether you like the behavior or not, node is compromising the security of multi-user servers and desktops. A shared hosting provider shouldn't need to know that they need to blacklist a "node_modules" username, and developers on Windows shouldn't need to create and secure a C:\node_modules directory before developing or running node.js software.
Here's a straw man proposal: by default, blacklist certain paths: /node_modules and C:\node_modules. If running inside $HOME, don't climb up outside $HOME (this effectively blacklists /home/node_modules and C:\Users\node_modules). Also, avoid loading from directories that appear to allow anyone to write to them. For the few exotic deployments out there, expose node's original search behavior behind an argument.