upvote
Is this more secure?? I would genuinely love to know
reply
Yes (assuming they're doing frontend dev and including the resources from the page). The code is fetched and executed from the browser, so It'll have to escape the browser sandbox to do something nefarious.
reply
Yes, none of npm's lifecycle hooks. You're just pulling bytes over the wire.
reply
Except now you're making http calls to remote servers that could be compromised.
reply
Can be mitigated, as the sibling comment points out, but even in the situation you described, the blast radius is reduced, especially for frontend libs.
reply
As long as you embed it with an SRI integrity hash, you're safe, even if the remote server is compromised.
reply
Same. I came back to do a little frontend work a couple of years ago and was horrified by the replacement of script tags with subresource integrity with npm and bundlers.
reply