| ▲ | chuckadams 4 hours ago | |||||||||||||
> It's not "node" or "Javascript" the problem, it's this convenient packaging model. That and the package runtime runs with all the same privileges and capabilities as the thing you're building, which is pretty insane when you think about it. Why should npm know anything outside of the project root even exists, or be given the full set of environment variables without so much as a deny list, let alone an allow list? Of course if such restrictions are available, why limit them to npm? The real problem is that the security model hasn't moved substantially since 1970. We already have all the tools to make things better, but they're still unportable and cumbersome to use, so hardly anything does. | ||||||||||||||
| ▲ | pas 3 hours ago | parent [-] | |||||||||||||
pnpm (maybe yarn too?) requires explicit allowlisting of build scripts, hopefully npm will do the same eventually > security model yep, some kind of seccomp or other kind of permission system for modules would help a lot. (eg. if the 3rd party library is parsing something and its API only requires a Buffer as input and returns some object then it could be marked "pure", if it supports logging then that could be also specified, and so on) | ||||||||||||||
| ||||||||||||||