Same-Origin Policy
The browser rule isolating documents by scheme, host, and port, and the mechanisms for relaxing it.
The same-origin policy is the browser's fundamental isolation rule: a document may not read data from another origin, where an origin is the triple of scheme, host, and port. It is what stops a page from reading your mail in another tab.
Because real applications legitimately span origins, several mechanisms relax it. CORS lets a server opt in to being read by named origins. Cookies have their own rules, keyed on domain rather than origin, so a cookie set for a parent domain is sent to subdomains — but scheme and port still matter for the origin check, which is why a subdomain can receive a cookie and still be refused. CSRF protections exist because cookies are sent automatically, so an authenticated state-changing request can be triggered from an unrelated page; the standard defence is a token the attacker cannot read, which is precisely why it fails when a request arrives from an origin not on the allowlist.
The recurring practical symptom is asymmetric: read requests succeed while writes fail with an authorisation error, because reads pass the cookie check and writes hit the origin check. The cause is usually that the application is being driven at a URL that is not the one it was configured with — a bare hostname where a subdomain was expected, or the wrong port.
See also4
Hand-picked in the note itself — the neighbours worth reading next.
Domain Name System
The distributed directory translating names to addresses, and the layer where propagation delays live.
Systems & Tooling4 connections
Least Privilege
Granting only the permissions actually required, so a compromise has a small ceiling.
Systems & Tooling9 connections
Port
The numeric endpoint a network service listens on, and a scarce shared resource on a developer machine.
Systems & Tooling8 connections
Multi-Tenancy
One deployment serving many isolated customers, with tenancy threaded through data, routing, and access.
Data & Content7 connections
Linked from4
Notes elsewhere in the wiki that reach for this one.
- Domain Name SystemSystems & Tooling
The distributed directory translating names to addresses, and the layer where propagation delays live.
- Least PrivilegeSystems & Tooling
Granting only the permissions actually required, so a compromise has a small ceiling.
- Multi-TenancyData & Content
One deployment serving many isolated customers, with tenancy threaded through data, routing, and access.
- PortSystems & Tooling
The numeric endpoint a network service listens on, and a scarce shared resource on a developer machine.