Harden a web application with browser controls

8 steps · about 4 h 20 min · Intermediate

  1. Map the browser threat surface (guide, MDN Web Docs, 30 min)

    Prioritise core controls before individual headers.

  2. Configure transport security (guide, MDN Web Docs, 35 min)

    Protect requests from interception and downgrade.

  3. Design a content security policy (guide, MDN Web Docs, 45 min)

    Restrict executable content and add defence in depth against injection.

  4. Deploy CSP carefully (guide, MDN Web Docs, 35 min)

    Use report-only testing before enforcing a strict policy.

  5. Restrict cross-origin access (guide, MDN Web Docs, 35 min)

    Grant only the origins and resources an application needs.

  6. Protect session cookies (guide, MDN Web Docs, 35 min)

    Use secure scope and attributes for sensitive state.

  7. Limit referrer leakage (guide, MDN Web Docs, 25 min)

    Control which URL details leave the site.

  8. Block MIME confusion (guide, MDN Web Docs, 20 min)

    Prevent browsers from interpreting resources as an unexpected type.