Websites Must Use HSTS in Order to Be Secure
eff.org
eff.org
1. You can't go back! As soon as a browser sees Strict-Transport-Security "max-age=31536000", it will refuse to load your site over HTTP for the next year.
2. The includeSubDomains option can cause problems in hard-to-predict ways. For example, Mailgun lets you set a CNAME for unsubscribe links. If a browser tries to load the HTTPS version, they'll get mailgun.com's cert, which is invalid for your domain.
3. Secure transport doesn't stop XSS, CSRF, etc. There are other headers such as Content-Security-Policy that can ameliorate some of these attacks. Also, sanitize!
4. HSTS is just one part of ensuring secure transport. It's also important to check your cipher suites. Not all TLS is created equal. SSL Labs is an extremely useful tool for testing your config: https://www.ssllabs.com/ssltest/analyze.html?d=floobits.com
If you're curious what the final result of all this paranoia looks like, take a look at the httpd config for floobits.com: https://gist.github.com/ggreer/9984770
You'll also notice mod_authn_yubikey. We require multi-factor auth (YubiKey + password) for our admin interface. There's tons of other stuff I could go into, but the real lesson is that security is like raking pine needles: You will never be done.
This sounds like a powerful way to DOS a site if you can set up a temporary https server on the domain and send this signal.
https://tools.ietf.org/html/rfc6797#section-14.5
It's true that HSTS could be a way for someone who can set up a seemingly valid but nonetheless fake HTTPS listener on a domain to prevent people from later communicating with a genuine HTTP service on that domain.
Three remedies for this, with different degrees of applicability to different sites:
* Put a CAA record for your domain into your DNS (see https://tools.ietf.org/html/rfc6844) to prevent legitimate certificate authorities from issuing the cert to the impostor. (This only provides protection if the attacker doesn't control your DNS zone.)
* Actually switch to HTTPS!
* If this attack happens to you and you don't want to switch to HTTPS, run a legitimate HTTPS listener on your domain that clears the HSTS status and then redirects users back to HTTP.
Is this true? What if you send a new header with a max-age of 1 second, or send one with a garbage value?
I'm pretty sure I've seen a way for a website to disable HSTS, but I can't confirm right now.
As with HTTPS, you need a shared secret before communication begins for anything like this to combat MITM attacks. Unless the browser communicates with a secure server to assess whether the website should be sending HSTS headers... Is that the idea?
Chrome and Firefox also ship with a baked-in HSTS preload list containing sites that should always use HTTPS, without depending on the HSTS header: http://src.chromium.org/viewvc/chrome/trunk/src/net/http/tra...
This just kind of seems unwinnable, a million holes.
HSTS disallows the user from overriding the certificate warning and accepting a self-signed cert.
Does it in fact reject connections to self-signed certs? Or just disallow you from accepting the broken cert? Because the real goal would just be to get the user onto http:// as quick as possible, and then the untrusted warning is gone.
No, any sort of HTTPS interception will be detected by the browser (assuming of course that the certificate authority infrastructure has not been compromised). There's no way to redirect "quick enough" to bypass certificate checking.
What in HSTS protects you from that? Because it seems to me if you can get there, you can get back to http:// before the user notices the verification failure. Unless the browser simply refuses to load the site due to the verification failure, which I only see for "suspected attack sites"
Intercept 443 => Issue insecure page with new HSTS timeout => Redirect to 80 before user notices insecure page warning> Does it in fact reject connections to self-signed certs?
Yes, you don't even need HSTS for this. HSTS just disallows the user from overriding the browser and accepting the self-signed (or otherwise bad) certificate.
Edit: Apparently all of them now, I sure didn't notice that. Not a concern, then
Test site: https://tv.eurosport.com/
The initial connection of an intercepted HTTPS connection would throw a security error, because the attacker would be using the wrong cert, but if you redirect the victim quickly...
You can defeat this particular hole by getting more aggressive about untrusted certificates, but it seems browsers are very reluctant to do that.
If there's no HSTS record for the domain,
- if it's HTTP, the attacker succeeds.
- if it's HTTPS with an invalid cert, the browser will display a warning and not honor any redirects.
- if it's HTTPS with a valid cert, we assume there is no attack (cert misissuance is an attack outside the scope of HSTS).
If there's an HSTS record for the domain,
- if it's HTTP, the browser will automatically rewrite to HTTPS.
- if it's HTTPS with an invalid cert, the browser produces a hard fail that the user can't override (and ignores redirects).
- if it's HTTPS with a valid cert, as above, the browser accepts the cert and we assume it's not an attack.
This also means that once you switch to using HSTS, you can't go back.
At the moment, these lists appear to be b) tied to specific browsers 2) tied to specific releases of those browsers.
Would it be viable to run some kind of global open registry where any website can be registered for mandatory HSTS? That way, every individual website owner doesn't need to submit a bug to Chromium and Mozilla - the browser just needs to securely connect to the registry and download the latest list. Or maybe DNSSEC can help ...
Maybe work on this is already underway, but I was reading some MLs a few weeks ago and I didn't see any forthcoming solutions ...
1. https://blog.mozilla.org/security/2012/11/01/preloading-hsts...
I agree that a global registry would be better, but it should probably be updated using the browser's normal update channel, to avoid re-inventing the wheel. (And DNSSEC has way too many issues.) It's true that ties the list to specific releases, but since browsers have good, and frequent, auto-updating, I think that's OK.
Getting the UI right is pretty challenging, though. It's not even completely clear what getting it right would mean. Even if the user clearly understands that they're interacting with some network operator rather than, say, Gmail or their organizational webmail server, the user still has no way to know whether the portal they're talking to is actually operated by the operator of the network that they think they're connecting to!
(More detail at http://www.chromium.org/chromium-os/chromiumos-design-docs/n...)
That stores one bit of information. Repeat 32 times (with 32 different host names) and you can store a unique 32-bit tracking number that persists even when cookies are cleared.
[Edit] Duh. As agentS points out, this won't work.
(It sounds like this attack depends on a complete version of the website being available over port 80)
No, it doesn't. An attacker can always connect to the website over HTTPS and proxy the content to the victim over port 80.
Any attempt to defeat that model will be handled by the US Postal Inspection Service, (see also https://postalinspectors.uspis.gov/aboutus/mission.aspx)