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

By Vadim Nareyko, founder, Arviser. Published 2026-11-28 · Updated 2026-11-28 · Last reviewed 2026-11-28

## 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](https://www.zaproxy.org/docs/alerts/10035-1/) "Strict-Transport-Security Header Not Set" (rule [10035](https://www.zaproxy.org/docs/alerts/10035/)); Nessus [84502](https://www.tenable.com/plugins/nessus/84502) "HSTS Missing From HTTPS Server"; Burp [0x01000300](https://portswigger.net/kb/issues/01000300_stricttransportsecuritynotenforced) "Strict transport security not enforced"; nuclei [`http-missing-security-headers`](https://github.com/projectdiscovery/nuclei-templates/blob/eb2824963c8aebdf147743042fedeee2b0416709/http/misconfiguration/http-missing-security-headers.yaml), matcher `strict-transport-security`
- Standard: [RFC 6797](https://www.rfc-editor.org/rfc/rfc6797.html), HTTP Strict Transport Security
- Lab: [scanner-findings](https://github.com/nareyko/arviser-labs/tree/e225f47fc1f1ab3f5755419c419dada190c7c53d/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...`](https://github.com/nareyko/arviser-labs/blob/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings/tests/hsts.sh), fails on the vulnerable target, passes after the fix

## 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](https://www.zaproxy.org/docs/alerts/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](https://github.com/projectdiscovery/nuclei-templates/blob/eb2824963c8aebdf147743042fedeee2b0416709/http/misconfiguration/http-missing-security-headers.yaml)).

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?

```sh
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](https://www.rfc-editor.org/rfc/rfc6797.html)).

Causes of a wrong answer:

- **Header on `/`, missing on one path.** In nginx, `add_header` is inherited from the level above only if the current level has no `add_header` of its own ([nginx headers module](https://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header)). Our trap target sets HSTS in `server` and `Cache-Control` in `location /app/`: `/` had the header, `/app/` did not. A spot check of the home page says "fixed", the scanner says "missing", and the scanner is right.

- **Missing on error responses.** nginx `add_header` without `always` adds headers only to 200, 201, 204, 206, 301, 302, 303, 304, 307 and 308 responses ([nginx `add_header`](https://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header)). Our fixed target uses `always`, and `/no-such-page` (404) carried the header.

- **The scanner read a plain HTTP response.** If the report shows an `http://` URL, the header is not expected there; the redirect to HTTPS is what to check. ZAP raises 10035-4 if the header is sent on plain HTTP, and our test refuses `http://` URLs instead of reporting them as fixed.

- **Two headers.** When a response carries the header twice, RFC 6797 §8.1 says the browser "MUST process only the first such header field". If the first one says `max-age=0`, HSTS is off. This happens when the application and a proxy both set it. Our trap with two `add_header` lines, `max-age=0` first, is reported by our test; ZAP calls it 10035-3. On Apache, `Header always set` in front of an app that sends its own header produced two headers in our lab.

- **One header, but not valid.** RFC 6797 §6.1 says every directive may appear only once and that a browser must ignore a header whose directives do not conform. So `max-age=0; max-age=31536000`, a value that a proxy joined from two headers (`max-age=0, max-age=31536000`) and `max-age=31536000abc` all give no HSTS, though each contains a year. An earlier version of our test passed all three; the lab now has a trap for each.

- **A short trial value.** `max-age=300` is a sensible first step, but our test and most customers expect one year. Raise it once nothing breaks.

- **Parent domain has `includeSubDomains`.** A browser applies that only after it has visited the parent domain over HTTPS. A scan of `api.example.com` will still report the header missing, and adding it to the subdomain is cheap.

## 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](https://hstspreload.org/) before you add `preload`.

## 4. Fix it on your platform

### nginx (lab-tested on 1.30.8)

```nginx
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](https://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header_inherit)); 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)

```apache
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](https://httpd.apache.org/docs/2.4/mod/mod_headers.html#header)). 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](https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/hsts)).

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

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

helmet's default is `max-age=31536000; includeSubDomains`, without `preload` ([helmet README](https://github.com/helmetjs/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](https://developers.cloudflare.com/ssl/edge-certificates/additional-options/http-strict-transport-security/)).

### 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](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-response-headers-policies.html)). 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](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/header-modification.html)), 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](https://vercel.com/docs/cdn-security/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](https://docs.netlify.com/manage/routing/headers/) 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 <date>.

**Already present:**
> We send the header on app.example.com (headers attached, captured on <date>). 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 <date>.

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`](https://github.com/nareyko/arviser-labs/blob/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings/tests/hsts.sh), run as `sh hsts.sh url...`, requests each URL and checks the header and its `max-age`.

- **Pass rule, written before the run:** exit 0 when every URL carries exactly one `Strict-Transport-Security` header with an integer `max-age` of at least `MIN_AGE` (default 31536000). Exit 1 when the header is missing or appears twice, when the value contains a comma, when any directive appears twice or its name is not a valid token (such as `includeSubDomains preload` with the `;` missing), or when `max-age` is missing, not a plain number (quotes allowed) or too short. Exit 2, not tested, for a URL that is not `https://`, cannot be reached or does not answer with HTTP.

- **Run it on your host:** remove `-k` from the script for a real site, then `sh hsts.sh https://app.example.com/ https://app.example.com/login https://app.example.com/no-such-page`. List one URL from each `location` or route group, and one 404. It needs a POSIX shell, `curl`, `awk`, `grep`, `tr` and `head`, and exits 2 if one is missing; we ran it with GNU tools and with BusyBox.

- **What the test cannot detect:** URLs you did not list (one `location` without the header is enough to fail a scan); whether the HTTP redirect exists (check it separately); whether `includeSubDomains` is safe for your subdomains; subdomains themselves; and responses that differ by method, cookie or user agent, since it sends one plain GET.

## 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](https://github.com/nareyko/arviser-labs/tree/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings/results/2026-11-26), with the raw outputs, image digests and file hashes of [run 8](https://github.com/nareyko/arviser-labs/tree/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings/results/2026-11-26/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.

## Related pages

- [Cookie without Secure or HttpOnly flag: is it real, how to fix it, what to tell the customer](/library/findings/cookie-without-secure-httponly)
- [ZAP alert 10098, Cross-Domain Misconfiguration: is it real, how to fix it, what to tell the customer](/library/findings/zap-10098-cross-domain-misconfiguration)
- [TLS 1.0 or TLS 1.1 enabled: is it real, how to fix it, what to tell the customer](/library/findings/tls-1-0-1-1-enabled)
- [SSL Certificate Cannot Be Trusted (Nessus 51192): is it real, how to fix it, what to tell the customer](/library/findings/ssl-certificate-cannot-be-trusted)
- [Server version disclosure (Server, X-Powered-By): is it real, how to fix it, what to tell the customer](/library/findings/server-version-disclosure)
- [Missing anti-clickjacking header (X-Frame-Options): is it real, how to fix it, what to tell the customer](/library/findings/missing-anti-clickjacking-header)

## Sources

- ZAP, alert 10035: https://www.zaproxy.org/docs/alerts/10035/ (accessed 2026-11-26)
- ZAP, alert 10035-1: https://www.zaproxy.org/docs/alerts/10035-1/ (accessed 2026-11-26)
- Tenable, Nessus plugin 84502: https://www.tenable.com/plugins/nessus/84502 (accessed 2026-11-26)
- PortSwigger, issue 0x01000300: https://portswigger.net/kb/issues/01000300_stricttransportsecuritynotenforced (accessed 2026-11-26)
- ProjectDiscovery, nuclei template http-missing-security-headers.yaml at commit eb28249 (MIT): https://github.com/projectdiscovery/nuclei-templates/blob/eb2824963c8aebdf147743042fedeee2b0416709/http/misconfiguration/http-missing-security-headers.yaml (accessed 2026-11-26)
- IETF, RFC 6797: https://www.rfc-editor.org/rfc/rfc6797.html (accessed 2026-11-26)
- hstspreload.org, submission requirements: https://hstspreload.org/ (accessed 2026-11-26)
- nginx, headers module: https://nginx.org/en/docs/http/ngx_http_headers_module.html (accessed 2026-11-26)
- Apache httpd, mod_headers: https://httpd.apache.org/docs/2.4/mod/mod_headers.html (accessed 2026-11-26)
- Microsoft, IIS hsts element: https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/hsts (accessed 2026-11-26)
- helmet README: https://github.com/helmetjs/helmet#readme (accessed 2026-11-26)
- Cloudflare, HSTS setting: https://developers.cloudflare.com/ssl/edge-certificates/additional-options/http-strict-transport-security/ (accessed 2026-11-26)
- AWS, CloudFront managed response headers policies: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-response-headers-policies.html (accessed 2026-11-26)
- AWS, ALB header modification: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/header-modification.html (accessed 2026-11-26)
- Vercel, encryption: https://vercel.com/docs/cdn-security/encryption (accessed 2026-11-26)
- Netlify, custom headers: https://docs.netlify.com/manage/routing/headers/ (accessed 2026-11-26)
- Our lab, arviser-labs at commit e225f47, scanner-findings: https://github.com/nareyko/arviser-labs/tree/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings (accessed 2026-11-26)
- Our test, hsts.sh: https://github.com/nareyko/arviser-labs/blob/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings/tests/hsts.sh (accessed 2026-11-26)
- Our lab, run 8 of 2026-11-26: raw outputs, image digests and file hashes: https://github.com/nareyko/arviser-labs/tree/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings/results/2026-11-26/run-8 (accessed 2026-11-26)

## Corrections

No corrections.

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](https://creativecommons.org/licenses/by/4.0/). Code in [our lab](https://github.com/nareyko/arviser-labs/tree/e225f47fc1f1ab3f5755419c419dada190c7c53d/scanner-findings): [MIT](https://opensource.org/license/mit). Quoted third-party material keeps its own terms.
