Logo officiel du MASTR MASTR Soutenir le travail
Sommaire
← Accueil du wiki

Comprendre le Web

Same-origin policy: the browser's boundary between sites

Scheme, host and port determine which documents share an origin.

Web2 foundation · 1 min read

Les enquêtes et les fiches de référence sont publiées en anglais. La navigation est disponible en sept langues.

Personnes et projets

Dans cet article
  1. Why origin matters
  2. The boundary can be weakened
  3. Sources et originaux

Why origin matters

The same-origin policy restricts how scripts from one origin interact with resources from another. An origin is defined by the scheme, host and port. Changing a path normally leaves the origin unchanged; changing a host or protocol does not.

This prevents an unrelated page from freely reading another site's authenticated data simply because the same browser has both open. Cross-origin embedding and sending requests are not identical to permission to read the response.

The boundary can be weakened

CORS provides a controlled way for servers to allow certain cross-origin reads. A permissive response must be assessed with the endpoint's data and credential handling. A configuration that is reasonable for public assets may be inappropriate for private account data.

The boundary also does not protect an application from scripts it deliberately loads into its own page. A third-party script can become part of the trusted execution environment. Review who can change those dependencies. Connect this to Content Security Policy and wallet-facing page content.

Sources et originaux

Lectures associées

MASTR

Soutenir la recherche indépendante

Les enquêtes, les preuves originales et les guides sont en accès libre. Les dons volontaires contribuent au financement de la recherche et au maintien des outils MASTR.

Ouvrir le portefeuille