Arviser

HSTS missing (Strict-Transport-Security header not set): is it real, how to fix it, what to tell the customer

Facts

Scanner finding
KB-F-0002 · Web and API
Also known as
Strict-Transport-Security Header Not Set, HSTS Missing From HTTPS Server
Tool IDs
ZAP 10035-1 "Strict-Transport-Security Header Not Set" (rule 10035); Nessus 84502 "HSTS Missing From HTTPS Server"; Burp 0x01000300 "Strict transport security not enforced"; nuclei http-missing-security-headers, matcher strict-transport-security
Standard
RFC 6797, HTTP Strict Transport Security
Lab
scanner-findings, last run 2026-11-26 (run 8): nginx 1.30.8, Apache httpd 2.4.71, Express 5.3.0, helmet 8.3.0, images pinned by digest
Test
tests/hsts.sh url..., fails on the vulnerable target, passes after the fix
Next review
2027-05-28

Short answer

The finding (ZAP 10035-1, Nessus 84502, Burp 0x01000300, nuclei http-missing-security-headers:strict-transport-security) means an HTTPS response came back without a Strict-Transport-Security header. Without it, a browser sent to http:// can be intercepted before your redirect. Check the exact URL with curl -sI; the header is often missing on one path or on error pages. Fix: exactly one Strict-Transport-Security: max-age=31536000 on every HTTPS response, set in one layer. Add includeSubDomains only once every subdomain serves HTTPS, or browsers will refuse the ones that do not.

1. What the scanner saw

All four tools look at the response headers of an HTTPS request. ZAP's rule 10035 is passive and has eight alerts; 10035-1 "Header Not Set" is rated Low, and others cover a disabled header, a missing or malformed max-age, and the header sent on plain HTTP (ZAP 10035). Tenable rates 84502 Info, Burp's typical severity is Low. The nuclei matcher fires when the text strict-transport-security appears nowhere in the headers and the status is not 301 or 302; nuclei follows up to three redirects first. It does not read the value, so max-age=0 passes nuclei while ZAP raises 10035-2 "Disabled" (template).

Each tool reports per URL. ZAP listed five URLs on our vulnerable target, including robots.txt and sitemap.xml, which returned 404. A 404 without the header is a valid hit.

2. Is it real on your system?

curl -sI https://app.example.com/ | grep -i strict-transport-security
curl -sI https://app.example.com/some/path/from/the/report | grep -i strict-transport-security
curl -sI https://app.example.com/no-such-page | grep -i strict-transport-security

A fixed host prints one strict-transport-security: line with max-age=31536000 or more for all three. No output for any of them means the finding is real for that URL.

Then check the redirect: curl -sI http://app.example.com/ should return a 301 or 308 to https://. HSTS works only after the browser has seen it over HTTPS once. RFC 6797 says a browser must ignore the header on a plain HTTP response (§8.1), and a server must not send it there (§7.2) (RFC 6797).

Causes of a wrong answer:

3. How serious it is for you

Our view: Low, and worth fixing, since the fix is one header. The attack it prevents needs someone on the network path (public Wi-Fi, a hostile proxy) and a user who reaches your site over http:// first, by typing the bare domain or following an old link. For a login page or an admin panel that is a real path. For an API called only by your own HTTPS clients it matters less, though scanners will still flag it.

Accepted risk is rare here. The one real reason to wait is a subdomain that still serves plain HTTP: includeSubDomains would make browsers refuse it. In that case send the header without includeSubDomains now and add it once that subdomain is on HTTPS.

Preloading into browsers is a separate step with stricter rules and a removal that takes months; read hstspreload.org before you add preload.

4. Fix it on your platform

nginx (lab-tested on 1.30.8)

server {
    listen 443 ssl;
    add_header Strict-Transport-Security "max-age=31536000" always;
    ...
}

Add ; includeSubDomains to the value only when every subdomain of this host serves HTTPS. If you are unsure, start with max-age=300, check the site and its subdomains, then raise it to one year. Set the header in nginx or in the application, not both: two headers count as a finding of their own. If the upstream app sends it too, add proxy_hide_header Strict-Transport-Security; next to add_header.

Repeat the line in every location that has its own add_header, or the header disappears there. nginx 1.29.3 added add_header_inherit to change that rule (nginx headers module); we did not test it. Our fixed target sent the header on /, /api/data, /login and a 404.

Apache httpd (lab-tested on 2.4.71)

Header onsuccess unset Strict-Transport-Security
Header always set Strict-Transport-Security "max-age=31536000"

Put both lines in the HTTPS virtual host, and add includeSubDomains under the same condition as for nginx. always adds the header to error responses too. The onsuccess unset line removes a header that a proxied application already sent: the mod_headers documentation says "always is not a superset of onsuccess" and gives this pair as the pattern (mod_headers). In our lab, Header always set alone, in front of a helmet app, produced two headers; with both lines there was one, on the static page, the proxied page and a 404.

IIS (from documentation, not run by us)

IIS 10.0 version 1709 and later have native HSTS settings on each site: enabled, max-age, includeSubDomains, preload and redirectHttpToHttps, all off or zero by default (IIS hsts element).

Express and Node.js (lab-tested on Express 5.3.0, helmet 8.3.0)

const helmet = require('helmet');
app.use(helmet());

helmet's default is max-age=31536000; includeSubDomains, without preload (helmet README). Because the default includes subdomains, pass helmet({ strictTransportSecurity: { includeSubDomains: false } }) until every subdomain serves HTTPS. With defaults, our fixed Express target sent max-age=31536000; includeSubDomains; a second target with the option above sent max-age=31536000. If TLS ends at a proxy or load balancer in front of Express, you can set the header there instead; one place is enough.

Cloudflare (from documentation, not run by us)

SSL/TLS > Edge Certificates > HTTP Strict Transport Security (HSTS) has switches for the header, max-age, includeSubDomains and preload (Cloudflare HSTS).

AWS CloudFront (from documentation, not run by us)

Attach a response headers policy. The managed SecurityHeadersPolicy sends max-age=31536000 without includeSubDomains, and does not override a value from the origin (CloudFront managed response headers policies). Create your own policy if you want includeSubDomains.

An Application Load Balancer can add Strict-Transport-Security as a response header. If the target's response already has it, the load balancer replaces the value with its own (ALB header modification), so the ALB value wins over the application's.

Vercel and Netlify (from documentation, not run by us)

Vercel sends HSTS by default: max-age=63072000; includeSubDomains; preload on *.vercel.app, and max-age=63072000 for custom domains (Vercel encryption). A finding on a Vercel site usually comes from a response that does not pass through Vercel's edge. We found no official Netlify page on a default HSTS header, only a 2020 forum announcement; check with curl, and set the header in Netlify's _headers file if it is missing. Netlify says those custom headers do not apply to proxied content or to URLs handled by functions.

5. What to tell the customer

Example wording, adapt to what is true.

Fixed:

Thank you for the report. All HTTPS responses from app.example.com now include Strict-Transport-Security: <the header you send>, including error pages. Plain HTTP redirects to HTTPS. Attached are the response headers for the URLs in your report, captured on .

Already present:

We send the header on app.example.com (headers attached, captured on ). Could you share the exact URL your scanner flagged? If it was an http:// URL, the header is not expected there under RFC 6797; that URL redirects to HTTPS.

Partly fixed, with a date:

We send the header on app.example.com now, without includeSubDomains, because legacy.example.com still serves plain HTTP. We will move it to HTTPS and add includeSubDomains by .

Evidence to attach: curl -sI output for each URL in the report and for one 404, plus the HTTP redirect.

6. Test: fails before the fix, passes after

Our script hsts.sh, run as sh hsts.sh url..., requests each URL and checks the header and its max-age.

7. What we ran

Run 8, 2026-11-26: nginx 1.30.8, Apache httpd 2.4.71, Express 5.3.0, images pinned by digest. Every test ran from a GNU and a BusyBox client with the same exit codes, and once more with one required tool removed from PATH, which gave "not tested" (exit 2) every time.

Target URLs Our test ZAP 2.17.0 baseline nuclei 3.11.1
ngx-vuln, no header /, /api/data fail on both 10035-1 strict-transport-security
ngx-fixed, add_header ... always in server and in each location with headers /, /api/data, /login, 404 pass on all 4 no 10035 no STS hit
nginx trap 8443, other add_header in /app/ /, /app/ pass on /, fail on /app/ not scanned STS hit on /app/
nginx trap 12443, two headers, max-age=0 first / fail: two headers not scanned not scanned
nginx trap 13443, max-age=300 / fail: below one year not scanned not scanned
apache 443, onsuccess unset plus always set, helmet app behind /helmet/ /, /helmet/, 404 pass on all 3, one header each not scanned not scanned
apache 8443, always set only, same app /helmet/ fail: two headers not scanned not scanned
app-vuln (Express) / fail 10035-1 not scanned
app-fixed (helmet defaults) / pass, max-age=31536000; includeSubDomains no 10035 not scanned
nginx traps 18443, 19443, 20443 max-age=0; max-age=31536000, max-age=0, max-age=31536000, max-age=31536000abc fail on each not scanned not scanned
nginx traps 21443, 23443, 33443, 34443, 37443 includeSubDomains twice, no max-age, unbalanced quote, a value of one space, includeSubDomains preload without ; fail on each not scanned not scanned
nginx traps 22443, 24443 Max-Age = "31536000" ; includeSubDomains; header name in capitals and a tab pass on both (valid) not scanned not scanned
plain HTTP 8080 sending the header http:// URL not tested (exit 2) not scanned not scanned
app-nosub helmet({ strictTransportSecurity: { includeSubDomains: false } }) pass, max-age=31536000 not scanned not scanned
proxy 14443 / 15443 nginx header over a helmet app, with / without proxy_hide_header pass, one header / fail, two headers not scanned not scanned
a port that never answers / not tested (exit 2) not run not run

The run was done by Claude Opus 5.5 (agent) on an internal Docker network with no outside access. Expected results were written before each run and are in the lab's results folder, with the raw outputs, image digests and file hashes of run 8. Runs 2 to 8 were checked in four rounds by a separate AI agent; the fourth round compared run 8 with its expected results.

Sources

Primary records first. Record identifiers link from the facts box.

Scanner rules and tool documentation

Standards and specifications

Vendor documentation and statements

Our lab

Corrections

No corrections.

Report an error to contact@arviser.com.

How this page was made: Claude Opus 5.5, an AI model, built and ran the lab and wrote this page from the sources listed. Separate AI agents checked the claims and the lab tests in four rounds. Vadim Nareyko approved the family template and the sample pages on 26 November 2026, from a summary in Russian.

Text and data on this page: CC BY 4.0. Code in our lab: MIT. Quoted third-party material keeps its own terms.

Send written scope or question (Free)