Kelly Mears

Same-Origin Policy

The browser rule isolating documents by scheme, host, and port, and the mechanisms for relaxing it.

Web Platform2 min read226 words15 out · 24 in
also calledCross-origin

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. Cross-Origin Resource Sharing 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 defense 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 authorization 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 also12

Multi-Tenancy

One deployment serving many isolated customers, with tenancy threaded through data, routing, and access.

Data & Content12 connections

eSIM

A SIM soldered into the device and provisioned over the air, with profiles downloaded rather than cards swapped.

Networks & Distribution12 connections

Caller ID Authentication

Cryptographic attestation of an originating telephone number, and why spoofed calls survive it.

Networks & Distribution17 connections

Domain Name System

The distributed directory translating names to addresses, and the layer where propagation delays live.

Systems & Tooling27 connections

Least Privilege

Granting only the permissions actually required, so a compromise has a small ceiling.

Systems & Tooling38 connections

Port

The numeric endpoint a network service listens on, and a scarce shared resource on a developer machine.

Systems & Tooling19 connections

Virtual Private Network

An encrypted tunnel that presents a remote network as local, and the narrow set of things a commercial one actually hides.

Networks & Distribution22 connections

Secret Management

Storing, distributing, and rotating credentials without embedding them in code or history.

Systems & Tooling33 connections

Referrer Policy

The rules for when a browser tells a site which page a visitor came from, a header misspelled in the 1990s that leaked private addresses for decades until browsers began trimming it by default.

Web Platform12 connections

Multi-Factor Authentication

Requiring a second kind of proof besides a password to sign in, such as a code, a phone prompt, or a hardware key, and why only the methods tied to the real website stop modern phishing.

Web Platform11 connections

Internationalized Domain Name

Domain names written in non-Latin scripts and accented letters, made to work in an ASCII-only DNS by encoding them as xn-- strings, and the browser rules that decide when to show the real characters and when to show the code to block lookalike attacks.

Web Platform10 connections

Open Redirect

A page that forwards visitors to whatever address a URL parameter names, letting attackers borrow a trusted domain to launch phishing or steal sign-in tokens, and the narrow ways to fix it.

Web Platform15 connections

Linked from24