A web of trust for NPM
&gt; Some have argued that the ill health of the npm registry is a social, rather than a technical problem<p>In some cases it is, yes, for packages that require so many access privileges that they can subvert the entire system they run on.<p>But this is not the case for (I&#x27;d estimate) the majority of libraries, because they are purely <i>computational</i>, they only transform data and do not need access rights to any external interfaces (filesystem, network, user input, displays, ...). Malicious data generated by sandboxed programs is still a problem, still the problem would be localized.<p>There are efforts underway that would allow Javascript programs to effectively and economically sandbox each other and grant only the minimum number of privileges they need to perform their tasks: <a href="https:&#x2F;&#x2F;medium.com&#x2F;agoric&#x2F;pola-would-have-prevented-the-event-stream-incident-45653ecbda99" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;agoric&#x2F;pola-would-have-prevented-the-even...</a><p>Avoiding global mutable state and <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ambient_authority" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ambient_authority</a>, being able to grant rights in an opt-in fashion and to transfer them in a way that is robust in multi-party settings in accordance with <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Capability-based_security" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Capability-based_security</a><p>This is the <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Principle_of_least_privilege" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Principle_of_least_privilege</a> and I encourage every language, virtual machine and operating system designer to understand it and implement it in their systems.<p>Then, the social attack surface can be technically minimized.