Skip to main content
InfoSSLOWASP A02:2021CWE-319

How to fix: HSTS Present on HTTP Response (SSL-Strip Indicator)

A Strict-Transport-Security header was detected in a plain HTTP response. HSTS is only meaningful over HTTPS; its presence on HTTP indicates either a misconfigured server or an active SSL-strip interception where the attacker forwards HSTS headers to create a false sense of security.

Why it matters

An SSL-strip attack sitting between the client and server can forward HSTS headers while still serving HTTP to the victim, preventing the browser from upgrading the connection and exposing all traffic in cleartext.

Strict-Transport-Security is only enforced by browsers when received over a valid HTTPS connection. When the browser sees HSTS over HTTP, it ignores the header. However, an attacker performing SSL-stripping may include HSTS in the stripped response to make the victim think the site is secure while intercepting all traffic.

How to fix it

  1. 1Ensure all HTTP requests are redirected to HTTPS before sending any application response.
  2. 2Never include Strict-Transport-Security in HTTP responses.
  3. 3Submit to the HSTS preload list to protect first-visit users.

Code examples

Nginx: HTTPS only with HSTS

nginx
server {
  listen 80;
  return 301 https://$host$request_uri;
}
server {
  listen 443 ssl;
  add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
}

References

Detected automatically by VulnRadar. The check id is ssl-strip-detected, stable across every scan so you can filter or diff on it.

See every ssl check

Questions

How severe is HSTS Present on HTTP Response (SSL-Strip Indicator)?
VulnRadar rates this info severity in the ssl category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id ssl-strip-detected, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does HSTS Present on HTTP Response (SSL-Strip Indicator) map to?
It maps to CWE-319. In the OWASP Top 10 it falls under A02:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for hsts present on http response (ssl-strip indicator)

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

HSTS Present on HTTP Response (SSL-Strip Indicator) | VulnRadar