▲ | erpderp 3 days ago | |||||||
In the example snippets from OP, the code shown is in the browser. I'm failing to see how the interception, as described, couldn't be handled by a decent Content Security Policy - instead of requiring yet another npm package. Seems safer than installing another package to address risk from ... installing packages. | ||||||||
▲ | ghrl 3 days ago | parent [-] | |||||||
I suppose if you're using a bundler, you will ship JS bundles including the malicious packages from your own trusted domain. How could CSP prevent this or similar attacks? | ||||||||
|