3

I'm using HSTS with this header on my website:

 Strict-Transport-Security: max-age=15768000; includeSubDomains

This works as intended and forces the browser to redirect all http connections to https.

In the documentation at https://tools.ietf.org/html/rfc6797#section-6.1.2 I did not find a way to exclude specified subdomains!

I already tried to add max-age=0 for the subdomain, but it does not overwrite includeSubDomains

Is it possible to exclude subdomains from the includeSubDomains rule? Or is the only way to remove this rule and just use the HSTS header for some websites? PS: My webserver is NGINX and I tested the behaviour with firefox and chrome.

  • 4
    No way. Either it works for all subdomains or you have to set it for every subdomain explicitly. Or move your exception to completely unrelated domain – Alexey Ten Apr 20 '16 at 19:26
  • Ok thanks. Then I will just send the header without includeSubdomains. – zuim Apr 20 '16 at 19:36
1

No:

I think one of the points of includeSubdomains is to ensure that it's not possible for an attacker to hijack cookies etc. by forcing end user to load a subdomain over plain http and then them. If there was even one exception to includeSubdomains then it would be useless (assuming it's possible for the attacker to figure out what the exception is).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.