Overview
HSTS forces browsers to use HTTPS only. Without it, attacker can intercept HTTP requests and perform SSL stripping (downgrade HTTPS → HTTP).Check HSTS
Expected Header
Directives
Misconfigurations
Missing HSTS
No header → SSL stripping possible on first visit.Low max-age
max-age=0 disables HSTS. Low values = short protection window.
Missing includeSubDomains
HSTS on HTTP Response
HSTS header on HTTP (not HTTPS) response is ignored by browsers. Must be served over HTTPS.Missing preload
Without preload, first visit to site is still vulnerable (TOFU — Trust On First Use).SSL Stripping Attack
When HSTS is missing or expired:bettercap
sslstrip (Legacy)
HSTS Preload
Browser ships with hardcoded list of HSTS domains. Protects even first visit.- Valid HTTPS on root domain
- Redirect HTTP → HTTPS
- HSTS header with
max-age >= 31536000,includeSubDomains,preload - All subdomains serve HTTPS