Reduce risk from third-party web scripts

8 steps · about 2 h 8 min · Intermediate

  1. Map client-side supply-chain risks (article, OWASP, 18 min)

    Begin with the ways external code can change or abuse a page.

  2. Pin static external resources (article, MDN, 15 min)

    Make the browser reject a script or stylesheet whose bytes changed.

  3. Configure cross-origin integrity requests (article, MDN, 10 min)

    Understand the CORS mode required for integrity checks across origins.

  4. Restrict allowed script sources (article, web.dev, 22 min)

    Limit where executable content may come from when a dependency is compromised.

  5. Sandbox an embedded application (article, MDN, 12 min)

    Remove capabilities from content that does not need full origin privileges.

  6. Disable unnecessary browser capabilities (article, MDN, 15 min)

    Keep embedded and top-level code away from sensors and powerful APIs.

  7. Limit referrer data disclosure (article, web.dev, 12 min)

    Avoid leaking sensitive path and query information to external services.

  8. Create a third-party script governance checklist (article, OWASP Cheat Sheet Series, 24 min)

    Turn technical controls into an inventory, approval and monitoring practice.