Reduce risk from third-party web scripts
8 steps · about 2 h 8 min · Intermediate
- Map client-side supply-chain risks (article, OWASP, 18 min)
Begin with the ways external code can change or abuse a page.
- Pin static external resources (article, MDN, 15 min)
Make the browser reject a script or stylesheet whose bytes changed.
- Configure cross-origin integrity requests (article, MDN, 10 min)
Understand the CORS mode required for integrity checks across origins.
- Restrict allowed script sources (article, web.dev, 22 min)
Limit where executable content may come from when a dependency is compromised.
- Sandbox an embedded application (article, MDN, 12 min)
Remove capabilities from content that does not need full origin privileges.
- Disable unnecessary browser capabilities (article, MDN, 15 min)
Keep embedded and top-level code away from sensors and powerful APIs.
- Limit referrer data disclosure (article, web.dev, 12 min)
Avoid leaking sensitive path and query information to external services.
- Create a third-party script governance checklist (article, OWASP Cheat Sheet Series, 24 min)
Turn technical controls into an inventory, approval and monitoring practice.