HSTS — HTTP Strict Transport Security, standardised as RFC 6797 — is the rare security control that works by being remembered rather than announced. A web server sends one response header. The browser writes it down. On every later visit, the upgrade to HTTPS happens before a single plaintext byte leaves the machine. No certificate authority enforces it, no regulator audits it, no committee meets to renew it. A cache entry does the work.
That is the whole trick, and it is worth taking seriously, because the trick answers a specific and embarrassing failure of the web: the first request.
Summary
- RFC 6797, published in November 2012, defines a mechanism that lets a site declare itself reachable only over secure connections and tells user agents to interact with it no other way.
- The policy travels in the
Strict-Transport-Securityresponse header and is cached for a stated lifetime — which is exactly what removes the insecure first request on every visit after the first. - The
preloaddirective is not in the RFC. It is a browser-vendor list, and it is the only part of HSTS that cannot be verified locally.
What RFC 6797 actually puts on the wire
RFC 6797 landed in November 2012, authored by Jeff Hodges, Collin Jackson and Adam Barth, and it remains a Proposed Standard. It is a short document with a narrow ambition: one response header field, one user-agent processing model, no institutional machinery of any kind. The header carries two directives that matter.
max-age— how many seconds the browser should remember the policy. A year is31536000.includeSubDomains— extend the policy to every subdomain of the host.
The processing model is where the discipline lives. A user agent must ignore a Strict-Transport-Security header that arrives over plain HTTP; otherwise anyone on the path could hand you a policy, which is the same as having no policy at all. It must store the host in a "Known HSTS Host" cache keyed on the host name — the policy follows the name, not the port or the path. And max-age=0 must expire the entry, which is the only off switch the specification provides.
Read that list again and notice what is missing. No registry, no authority, no revocation endpoint, no third party to consult. The entire mechanism is a deterministic rule that any implementer can check locally, on one machine, without asking anyone.
The plaintext first hop is the whole ballgame
In 2009, Moxie Marlinspike walked through SSLstrip at Black Hat DC. The attack needed no cryptanalysis and no forged certificate. The victim types a URL; the browser emits a plaintext request; the attacker intercepts it, rewrites every https:// link into http://, and proxies the real TLS session from the middle. The address bar drops to plain HTTP — and SSLstrip even swapped the site's favicon for a padlock, because the address bar was never the part people looked at.
The vulnerability is not in TLS. It sits in the gap between the URL a human types and the scheme the browser chooses — a gap that exists for exactly one round trip, and that one round trip is enough.
The old defence was a server-side 301 redirect from HTTP to HTTPS: a promise made after the plaintext request has already been sent, and therefore a promise the attacker has already read.
HSTS closes the gap by remembering. Once the policy is cached, the browser rewrites http://example.com to https://example.com internally, before the request is formed. The redirect becomes unnecessary. The plaintext round trip stops happening.
RFC 6797 is honest about the residual hole, and this is where most summaries of HSTS go soft. The very first visit to a site is still unprotected: the browser has nothing cached, so it makes the plaintext request, and a fast enough attacker can be waiting. The RFC's security considerations name the problem "Bootstrap MITM". HSTS is, in the language of the field, trust on first use.
Which means the mechanism is not complete. It is complete plus a list.
The preload list: where a local rule becomes a global one
The preload directive does not appear in RFC 6797. It is a browser-vendor convention, bolted on afterwards. A site that promises a max-age of at least one year, sets includeSubDomains, and adds preload can apply to be baked into the browser's compiled-in list. Chrome maintains the canonical list; the other major browsers ship lists derived from it. The first visit stops being a gamble, because the browser already knows before the user types anything.
And here is the part that matters to anyone who watches how Internet institutions actually behave. The one piece of HSTS that is not local, not deterministic, and not verifiable by the operator alone is the piece that became a list. Removal is not instant — the submission process warns that it takes months, because the list ships inside browser builds. A site that preloads has handed a browser vendor a durable, global, non-negotiable statement about its own name, and holds no equivalent lever to take it back.
Thin coordination, in other words, right up until the moment it isn't.
Why HSTS survived and HPKP did not
The comparison is instructive. HTTP Public Key Pinning, RFC 7469, was the stricter sibling: instead of pinning a scheme, it pinned the certificate keys a site would accept. It was published in 2015 and effectively dead within four years. Chrome dropped HPKP support in Chrome 72; Firefox followed. The reason was operational, not cryptographic. A pin set with a long lifetime and a lost backup key bricked the site for the duration of the pin. A pin set with a short lifetime bought little protection. Attackers learned to set pins maliciously. The mechanism was correct and unusable.
HSTS survived because it asked for almost nothing: one header, one number, one cache. No out-of-band state, no key material, no recovery ceremony. An operator who misconfigures it can fix it with max-age=0 and a wait. The rule is small enough to be implemented identically everywhere, which is the only kind of rule that survives contact with a few billion browsers.
The running-code test: a document is not a mechanism
There is a temptation, in standards coverage, to treat publication as the event. RFC 6797 came out in November 2012; therefore, in some sense, HSTS existed. It did not. HSTS existed when browsers shipped the cache, when servers shipped the header, and when the two agreed often enough that an operator could rely on the behaviour. The document described the mechanism. The mechanism was the deployment.
Lu Heng makes the point in his Note on minimum initial specification and voluntary adoption: "A proposal is not reality. A recommendation is not reality. A registry update is not reality. A document is not reality." The same test applies to a header field. A Strict-Transport-Security line in a configuration file is a proposal. A cache entry in a browser is reality.
The shape of the mechanism is a useful template too. RFC 6797 specifies only what is deterministic and locally verifiable: a duration, a scope, a matching rule, an ignore rule. It says nothing about which sites should use it, whether a site's business model justifies the cost, or what a site ought to be. It is a rule about a name and a scheme, and it stops there. That restraint is why it works across every jurisdiction, every vendor and every business model on the web.
RFC 7282 records the older formulation of the same instinct: "We reject: kings, presidents and voting. We believe in: rough consensus and running code." HSTS is that instinct in its purest form — a policy that exists only insofar as it is implemented, and that fails visibly and immediately where it is not. Lu Heng's Note on running-code primacy carries the argument up to the registry layer. The header field is the same argument at a smaller scale.
What the header still cannot do
HSTS is not encryption and it is not a certificate. It does not tell you whether the site you reached is the site you meant; it only tells you that the connection to it will not be downgraded. Without preload it does not protect the first visit. It does not survive a user who clears site data, or a browser that has never heard of the host. It is keyed to a host name, so a client that connects to a bare address gets none of it.
What it does is narrower and more valuable: it removes an entire class of attacker from the path, permanently, for the price of one header and one line of cache. In an industry that routinely confuses complexity with security, that is close to indecent.
The lesson of RFC 6797 is not that HTTPS is good. It is that a rule small enough to be remembered, deterministic enough to be checked locally and cheap enough to be free is a rule that actually holds. Everything else — the committees, the audits, the press release announcing the new standard — is the announcement.
The cache is the enforcement. The browser remembers, and that is the security.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






