Summary

  • RFC 6454, "The Web Origin Concept", December 2011, Standards Track, defines "the concept of an 'origin,' which is often used as the scope of authority or privilege by user agents", sets out how to compute an origin from a URI, how to serialise one, and registers the Origin HTTP header field.
  • The rule is one sentence: two URIs are part of the same origin "if, and only if, their schemes, hosts, and ports are the same". Everything a browser permits, forbids, shares or isolates hangs on that triple.
  • The document answers its own hardest question — "Including the scheme in the origin tuple is essential for security" — because without the scheme, the plaintext and TLS versions of one host would be a single principal, and an attacker who rewrote the plaintext copy would already be standing inside the protected one.

Fifteen years of folklore

For the web's first fifteen years, every browser enforced a same-origin policy and no standard said what an origin was. The rule was folklore: same scheme, same host, same port, therefore same principal. Same cookie jar. Same script context. Same permission to read, and to be read.

Folklore is not nothing. It is what millions of pages were written against, what a decade of security advice described in prose, and what every new browser had to reverse-engineer from its competitors — Netscape's behaviour first among them — before it could safely load somebody else's script. A rule that lives only in five implementations is a rule with five dialects and no dictionary.

The rule is one sentence long

RFC 6454 supplied the dictionary. Its central definition is almost aggressively short: "Two URIs are part of the same origin (i.e., represent the same principal) if, and only if, their schemes, hosts, and ports are the same."

Read it twice, because the rest of the web's security architecture is downstream of it. A script may read a response from its own origin and not from another. A frame may reach into its siblings and not its cousins. A cookie is scoped by host and ignores the port entirely — one of the few places where the cookie jar and the origin disagree, and a reliable source of bugs to this day.

Why not one protection domain per URI

The document explains the compromise it inherited. Treating every URI as its own protection domain, with consent sought for each interaction, "is cumbersome for developers because web applications often consist of a number of resources acting in concert".

Grouping is the concession that makes the web usable. The price is that anything which can write to a page inherits that page's authority — one sentence that describes both how sites are built and how they are attacked.

The scheme is the load-bearing wall

The decision that mattered is small enough to miss. Had the origin been host and port only, a page served over plaintext and its twin served over TLS would be the same principal. An active attacker on the network could then rewrite the plaintext copy and use the resulting script to reach into the protected one.

So the document says it plainly: "Including the scheme in the origin tuple is essential for security." Put the scheme in the triple and https://example.com stops being the same place as http://example.com — the isolation that makes "secure" mean anything at all when a page mixes the two.

Which reframes mixed content. It is not a design flaw the standard forgot to prevent. It is the seam the standard drew so that the flaw would be visible.

Serialising a boundary

The document also fixes how an origin becomes a string, which sounds clerical and is not. A header, a log line, a cache key and an access check all need the same spelling. A boundary that cannot be written down cannot be compared, and a boundary that cannot be compared is enforced by nothing except habit.

It also gives the web a way to say "nowhere". RFC 6454's second kind of origin is a "globally unique identifier" — an origin with no host at all, serialised as the string null, for documents that belong to no site: a sandboxed frame, a page synthesised from a data: URL. The HTML standard later gave it a better name, the opaque origin. The alternative would have been a fake hostname, and a fake hostname is a real hostname waiting to be trusted by mistake.

What the written rule unlocked

Once origin had a definition and a header, cross-origin requests could be described, restricted and argued about in specifications instead of in browser bug trackers. CORS is a negotiation over an origin string. postMessage takes a target origin. Sandboxing hands a document an opaque one. None of it is thinkable before the term had a text.

That is the sequence worth remembering: fifteen years of practice, one document, then an ecosystem of rules expressed in the new vocabulary. The paper did not create the boundary. It made the boundary portable.

Running code first, paper second

There is a general lesson here that Internet governance keeps rediscovering the hard way: implementation is where a rule becomes real, and the document ratifies what already runs. Lu Heng makes the case in his Note on running-code primacy — specification, distributed state, local validation, running implementation, voluntary adoption, and documentation last rather than first.

RFC 6454 is that order in miniature. Five browsers ran the rule for a decade and a half. The IETF wrote it down. The writing is what let anyone test it, teach it, and change it on purpose rather than by accident.

A standard that caught up and then led

RFC 6454 is the rare document that codifies an existing boundary without inventing one — and by codifying it, makes the boundary usable in protocol design. It did not make the web safer in theory. It made the web's oldest assumption citable, which is the practical difference between folklore and a rule.

Every institution that runs on unwritten rules is borrowing stability from the people who happen to agree today. Writing the rule down costs you the freedom to change it quietly. It buys you the ability to change it deliberately — and, more usefully, the ability to notice when somebody is trying to move it.