The Boundary That Holds the Web Together
The same-origin policy is the oldest load-bearing rule on the platform, and almost every security feature added since exists either to relax it safely or to patch a place where it leaked. This dossier traces what it protects, what it never protected, and why so much of modern web security is a negotiation around one boundary.
- Level
- RESEARCHER
- Status
- ACTIVE
- Experiments
- 08
- Observations
- 21
Question
If the browser will happily send a cross-origin request with the user's cookies attached, in what sense is the origin a security boundary at all?
Background
An origin is the triple of scheme, host and port. Two documents share an origin only when all three match, and that comparison decides whether one may script the other, read its storage, or read the bytes of its responses. Everything else on the platform is layered on top of that single comparison.
The policy was never a restriction on *sending*. The web is built on cross-origin embedding: images, scripts, stylesheets, iframes and form submissions all cross origins by design, and removing that would remove the web. The boundary sits at readability instead, which is a narrower and stranger guarantee than most developers assume.
| Operation | Cross-origin |
|---|---|
| Load an image, script or stylesheet | Permitted |
| Submit a form | Permitted, and the reason CSRF exists |
| Send a fetch or XHR | Permitted |
| Read the response body | Denied unless CORS grants it |
| Read a frame's DOM | Denied |
| Read localStorage or IndexedDB | Denied |
| Measure timing or size of a response | Partly observable, and the basis of side-channel attacks |
Findings
Finding 1. CORS relaxes the policy, it does not impose it. Developers routinely describe CORS as the thing blocking them. The block predates CORS by a decade; CORS is the server's mechanism for lifting it for named origins.
Finding 2. Cookies are a second, older axis. Ambient authority means a request carries credentials regardless of who initiated it. SameSite retrofits intent onto that model, and the ongoing removal of third-party cookies is the platform conceding that the original design cannot be secured by policy alone.
Finding 3. Embedding leaked more than anyone planned. Response sizes, load timings, and error behaviour are all observable across origins, which is why Cross-Origin Read Blocking, Cross-Origin-Resource-Policy and cross-origin isolation exist. Spectre turned a theoretical side channel into a reason to re-architect process isolation.
Finding 4. Most real breaches sidestep the boundary entirely. Cross-site scripting wins because injected code runs *inside* the origin, where the policy grants it everything. This is why Content-Security-Policy, trusted types and output encoding matter more to most applications than any CORS configuration.
Interpretation
The useful mental model is not a wall but a membrane: things pass through it constantly, and the rule governs what may be observed on the far side. Security work on the web is mostly about who is allowed to run code inside a given origin, and what that code can then reach.
Limitations
This dossier describes the model, not any particular implementation. Browsers differ in their heuristics for private network access, opaque responses and storage partitioning, and the third-party cookie timeline has moved repeatedly. Treat the mechanism as stable and the specifics as perishable.
References
- 01MDNSame-origin policy
- 02WHATWGFetch Standard
- 03W3CPost-Spectre web development