Documentation Index
Fetch the complete documentation index at: https://docs.bytejmp.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Directive | Description |
|---|---|
max-age | Seconds browser remembers HTTPS-only. OWASP recommends 63072000 (2 years). Minimum 31536000 (1 year) for preload |
includeSubDomains | Apply to all subdomains. Required for preload submission |
preload | Eligible for browser preload list. Has permanent consequences — hard to undo |
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
Testing
Check Preload Status
Check HTTP → HTTPS Redirect
Check Certificate
Quick Reference
| Issue | Risk |
|---|---|
| No HSTS | SSL stripping on any visit |
| Low max-age | Short protection window |
| No includeSubDomains | Subdomain MITM |
| No preload | First visit vulnerable (TOFU) |
| HSTS over HTTP | Ignored by browser |