Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is HSTS?

HTTP Strict Transport Security is a response header that tells a browser to reach a site only over HTTPS for a stated period, removing the plaintext request that downgrade attacks rely on.

Illustration for the cybersecurity term HSTS
Home / Blog / Cybersecurity Terms / What Is HSTS?
17 November 2026

What Is HSTS?

What Is HSTS?

HTTP Strict Transport Security, defined in RFC 6797, is a single response header that instructs a browser to communicate with a host over HTTPS only, for a stated number of seconds. Once the policy is cached, the browser rewrites any http:// request for that host before it leaves the machine and refuses to let the user click through a certificate warning. The point is to eliminate the plaintext request that a redirect-based setup still allows.

The Gap a Redirect Leaves Open

A site that listens on port 80 purely to issue a 301 to HTTPS looks secure, and for a user who types the address it is not. That first request travels in clear text, carrying the host and path, and anyone on the network path can answer it. Moxie Marlinspike’s sslstrip, demonstrated in 2009, automated the consequence: the attacker proxies the connection, speaks HTTPS to the site and HTTP to the victim, and rewrites links so the browser never sees a padlock. HSTS removes the opportunity, because after the first successful visit the browser never sends that plaintext request again.

Reading the Header

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Two rules trip people up. The header is ignored when sent over plain HTTP, which is deliberate: an attacker on the network could otherwise set a policy for a host they do not own. And it is ignored on a response served with an invalid certificate, so the policy has to be established on a working HTTPS connection first.

Trust on First Use, and Preloading

A browser that has never seen the header has no policy, so the very first visit is unprotected. The HSTS preload list closes that gap by shipping the policy inside the browser itself. Google maintains the list at hstspreload.org and Mozilla, Microsoft, and Apple consume it. Submission requires a valid certificate, a redirect from HTTP to HTTPS on the same host, the header on the base domain with a max-age of at least 31536000, and both includeSubDomains and preload present. Whole top-level domains, including .dev and .app, are preloaded as a block.

Removal is the part to think about before submitting. Requesting delisting is straightforward, but the change only reaches users as browsers update, which takes months. Treat preloading as a commitment that every current and future host under the domain will serve valid HTTPS.

Rolling It Out Without an Outage

  1. Inventory every subdomain, including those owned by marketing, third-party platforms, and development teams, and confirm each has a valid certificate.
  2. Start with max-age=300 and no includeSubDomains, and watch for errors.
  3. Raise the value gradually to one year.
  4. Add includeSubDomains only once the inventory is clean, then observe for a full business cycle.
  5. Submit for preloading last, if at all.

What It Does Not Do

HSTS protects the transport. It has nothing to say about a certificate issued in error by a trusted authority, which is what Certificate Transparency monitoring addresses, nor about mixed content inside the page, which a Content Security Policy can upgrade. It is one of a small set of HTTP security headers worth configuring together, and it depends entirely on the TLS configuration underneath being sound. The NCSC’s guidance on using TLS recommends HSTS for public services alongside current protocol versions and cipher suites, and our web application security testing reviews the header set and the transport configuration together.

FAQ – Frequently Asked Questions

Does HSTS Protect the Very First Visit?

No, unless the domain is on the browser preload list. The policy is delivered in a response, so a browser that has never connected to the host has nothing cached and will send the initial plaintext request as normal. This trust-on-first-use gap is exactly what preloading exists to close, by shipping the policy inside the browser.

What Happens If a Subdomain Cannot Support HTTPS?

With includeSubDomains in force it becomes unreachable in any browser that has cached the policy, and users cannot override the error. Audit every host under the domain before enabling the directive, including those run by other teams or suppliers. If one genuinely cannot be migrated, move it to a different registrable domain rather than omitting the directive.

Can We Remove HSTS Once It Is Set?

Serving the header with max-age set to zero clears the policy, but only for browsers that make a successful HTTPS request and receive it. Clients that do not return keep the old policy until it expires, which is why a long max-age is adopted gradually. Preload list removal is slower still, taking several browser release cycles.

Is HSTS Required for Compliance?

No standard names the header explicitly, but several require that cardholder or personal data is never transmitted over an unprotected channel, and assessors commonly expect it on public services. The NCSC recommends it in its TLS guidance, and its absence is a routine finding in penetration test reports for externally facing applications.

Related Terms

You May Be Interested In These

What Is Firmware Security?

Cybersecurity Terms

17 November 2026

What Is Firmware Security?

Read More
What Is a Digital Signature?

Cybersecurity Terms

17 November 2026

What Is a Digital Signature?

Read More
What Is QUIC Protocol Security?

Cybersecurity Terms

17 November 2026

What Is QUIC Protocol Security?

Read More