Comment by stickfigure
10 days ago
If it's available, pull the third party JS in at build time via package manager rather than at runtime via a CDN you don't control.
NPM isn't perfect but there's typically a substantial delay between the release of a malicious package and that code getting onto your production environment. Unless you're automatically updating every day, there's a good chance someone will discover the problem before it affects you. And you can always scan your upstream dependencies.
This doesn't work if you're using someone else's CDN. Any change to their content is distributed to all your users immediately.
No comments yet
Contribute on Hacker News ↗