Free security runbook · Transport policy

HSTS and preload: the header that can lock you out

HSTS tells the browser to refuse plaintext HTTP for a host. Preload writes that rule into the browser itself, before the first request. A wrong max-age, an includeSubDomains you did not inventory, or a certificate that fails on one subdomain turns a security improvement into a lockout that a rollback cannot clear.

This page is free. It covers how to read the header that is actually being sent, how to inventory the subdomains it will bind, and why a preload entry is a one-way door for the lifetime of the installed browser.

Scope: reviewed from the RFC and the preload program documentation, no live reproduction
Verified against RFC 6797 and the Chromium HSTS preload documentation on 2026-11-26. Command output below is the expected shape, not a capture from a live host. Browser policy and preload-list timing differ by vendor and release; confirm on your own domain before shipping.
Read the header

What is actually on the wire

Only HTTPS counts

RFC 6797 says a browser must ignore Strict-Transport-Security delivered over plaintext HTTP. A header added by a redirect page that is still HTTP does nothing.

Scope follows the host

By default the policy binds the exact host that sent it. includeSubDomains extends it to every descendant name, including the ones you forgot.

Preload is not a header

The preload token is a request to be added to a browser-shipped list. Until that list ships, the token changes nothing; after it ships, removing the header does not remove the rule.

max-age is a countdown

Every response restarts the clock. A host that stops sending the header keeps the policy until the last max-age expires, which is why short values are a weak promise and long values are a long lock-in.

Detect

Prove the policy before you extend it

Command or viewWhat it tells you
curl -sSI "https://$HOST" | grep -i strict-transport-securityThe header on the first HTTPS response. Empty output means no policy, even if the site always redirects.
curl -sSI "http://$HOST" | head -5Whether plaintext is redirected before any content is served. The HSTS header on this response is ignored.
curl -sSI "https://$HOST/some/deep/path" | grep -i strict-transport-securityWhether the header is applied at the edge or only on the home page. Error and API responses need it too.
for h in www api static cdn; do echo "== $h"; curl -sSI "https://$h.$PARENT" | head -3; doneWhether every name under the parent can complete a TLS handshake today.
echo | openssl s_client -connect "$HOST:443" -servername "$HOST" 2>/dev/null | openssl x509 -noout -subject -dates -ext subjectAltNameThe name the certificate actually covers and when it expires.
https://hstspreload.org/?domain=$HOSTPreload status: unknown, pending, preloaded, or removable, plus the requirements that are still unmet.
Failure modes

Seven ways the header locks people out

#Failure modeWhat you seeWhat to do
1includeSubDomains before the subdomain inventoryERR_SSL_PROTOCOL_ERROR or a certificate error on an internal name that still speaks HTTP.Enumerate every name under the parent from DNS and certificate transparency, fix each one to HTTPS, then widen the policy.
2Preload requested without a working redirectThe submission page reports unmet requirements; the domain sits in pending for weeks.Serve a 301 from HTTP on the apex and every subdomain, keep the header on the redirect response, and re-check the status page.
3A short or zero max-ageThe policy silently disappears after a deploy that stops sending the header, so the next plaintext request is allowed.Use at least one year for preload, and alert when the header is missing from production responses.
4The header only on the happy pathAPI clients and error pages are still reachable over HTTP; the browser sends a cookie that should have been HTTPS-only.Set the header at the edge for the whole host, including 4xx and 5xx responses, and keep the redirect for plaintext.
5Preload on a domain you do not fully controlA third-party subdomain or a wildcard certificate you cannot renew breaks for every returning visitor.Inventories and contracts first. Preload only names for which you control DNS, the certificate and the renewal path.
6Certificates that fail on renewal dayVisitors cannot click through: an HSTS host with a bad certificate has no bypass page in current browsers.Monitor expiry and renewal, keep a fallback certificate, and test renewal on a staging hostname first.
7Rollback that does not roll backmax-age=0 clears the header for new responses, but visitors with the preload list still refuse HTTP.Treat preload as a release, not a config flag: plan the removal request, the browser update lag, and the support script before you submit.
Design

Decide the blast radius first

DecisionQuestion to answer
Host or parentDo you control every descendant name, including the ones created by customers or partners?
max-ageOne year is the preload floor. Anything shorter is a temporary test and should be labelled as one.
RedirectDoes plaintext return 301 to the same host, path and query, before any body is written?
CertificateDoes every name have a valid chain and an automated renewal path you have watched succeed?
PreloadIs the domain meant to be HTTPS-only for the next several browser release cycles, not just this quarter?
Verify

A rollout you can stop

Start at one host

Send the header on a staging hostname with a short max-age, then on production without includeSubDomains. Confirm the header on 200, 301, 404 and 500 responses.

Inventory the parent

Pull names from DNS zone files and certificate transparency logs, then request each one over HTTPS and record the status. Any failure is a blocker, not a follow-up ticket.

Watch the redirect

Request the apex over HTTP with a path and query string. The 301 must preserve both and must not serve a body first.

Prove removal

Before preload, write the removal runbook: submit the removal request, keep sending max-age=0, and tell support what visitors will see until browsers update.

FAQ

Questions from the security review

We redirect HTTP to HTTPS. Do we still need the header?

Yes. The redirect is a server behaviour and is only seen after a plaintext request has already crossed the network. HSTS makes the browser refuse that first plaintext request on later visits, and the redirect response is what teaches it.

Can we clear HSTS by setting max-age to zero?

For a host that is only in browser state, yes: max-age=0 over HTTPS removes the policy once the browser receives it. For a host on the preload list, the list still applies until the browser vendor ships an update, which is why removal is measured in months, not minutes.

Does preload protect API clients and curl?

No. It is a browser policy. Command-line clients, mobile SDKs and mail servers keep their own trust rules, so certificate validity and a server-side redirect still carry the load.

What breaks first when includeSubDomains is wrong?

Usually an internal or legacy name: a status page, a mail host, a partner CNAME. It fails with a TLS error and no click-through, and the fix is DNS or a certificate, not a browser setting.

Sources

Primary sources

  • RFC 6797 — HTTP Strict Transport Security, including the rule that the header is ignored over HTTP (accessed 2026-11-26).
  • hstspreload.org — submission requirements and removal process (accessed 2026-11-26).
  • Chromium: HSTS — preload list behaviour and the preload token (accessed 2026-11-26).
  • MDN: Strict-Transport-Security — syntax and includeSubDomains scope (accessed 2026-11-26).

Going deeper on transport changes?

The paid runbooks cover the surrounding failures: certificate lifetimes that shrink on a public schedule, cache rules that hide a deploy, and production defaults that only bite on a real domain.

This page is free, no checkout. Paid runbooks are $9.99 each and covered by the 7-day refund policy at /runbooks/refund.