5

What if I was an evil proxy operator who wanted to modify response content, but did not care if the victim sees http://? What happens if the browser requests https://example.com, but example.com has never had a valid SSL certificate? Will the browser automatically redirect to the http:// version? If so then an evil proxy operator should be able to simulate that response, right?

4

What happens if the browser requests https://example.com, but example.com has never had a valid SSL certificate? Will the browser automatically redirect to the http:// version?

No. Modern browsers don't downgrade to plain HTTP autonomously. If a certificate is invalid, the user will simply see a certificate warning (and eventually an option to add an exception).

If so then an evil proxy operator should be able to simulate that response, right?

If browsers did redirect to plain HTTP when seeing an invalid certificate, a MITM could silently downgrade any new secure connection by modifying the transmitted certificate details. That would be a major security problem. That's why, as long as you use HTTPS right from the beginning, a MITM can't redirect you anywhere.

Rather, what an attacker can do is try to intercept a plain HTTP response before the connection is upgraded to HTTPS. E.g., if you type in mybank.com, your browser doesn't know if the site provides HTTPS yet and tries http://mybank.com first. Even if this HTTP site immediately responds with a redirect to https://mybank.com, a MITM could already intercept the response and remove the redirect to keep you on plain HTTP. (The HTTP Strict Transport Security (HSTS) feature prevents this exact attack by instructing your browser to always visit the site over HTTPS and reject all attempts to use plain HTTP.)

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.