Logo Oficial MASTR MASTR Apoyar el trabajo
Contenido
← Inicio de la wiki

Fundamentos de la 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

Los artículos de investigación y las referencias se publican en inglés. La navegación está disponible en siete idiomas.

Personas y proyectos

En este artículo
  1. Why origin matters
  2. The boundary can be weakened
  3. Fuentes y originales

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.

Fuentes y originales

Lecturas relacionadas

MASTR

Apoya la investigación independiente

Las investigaciones, las pruebas originales y las guías son de acceso libre. Las donaciones voluntarias ayudan a financiar la investigación y a mantener disponibles las herramientas de MASTR.

Abrir billetera