tags:

views:

2208

answers:

11

Is it acceptable to submit from an http form through https? It seems like it should be secure, but it allows for a man in the middle attack (here is a good discussion). There are sites like mint.com that allow you to sign-in from an http page but does an https post. In my site, the request is to have an http landing page but be able to login securely. Is it not worth the possible security risk and should I just make all users go to a secure page to login (or make the landing page secure)?

+26  A: 

Posting a form from an http page to an https page does encrypt the data in the form when it is transmitted in the most simple terms. If there is a man-in-the-middle attack, the browser will warn you.

However, if the original http form was subjected to man-in-the-middle and the https post-back address was modified by the attacker, then you will get no warning. The data will still actually be encrypted, but the man-in-the-middle attacker would be able to decrypt (since he sent you the key in the first place) and read the data.

Also, if the form is sending things back through other means (scripted connections) there may be a possibility of unencrypted data being sent over the wire before the form is posted (although any good website would never do this with any kind of sensitive data).

Jason Coco
+13  A: 

Is there any reason not to use HTTPS for the entire transaction? If you can't find a very good one, use it!

  • It's arguably simpler than switching protocols.

  • The MITM risk is real.

  • Following your link, the user "Helios" makes an excellent point that using 100% HTTPS is far less confusing to the user.

Adam Liss
I've found people /did/ it in the past for performance reasons, which were legitimate at the time. However, it's one of those issues where the pattern of doing it has been taught as almost dogma even though throughput and performance on servers and clients is more than capable now.
Jason Coco
Agreed. Back then, it was also difficult to do vector graphics on an abacus. :-)
Adam Liss
Indeed :) It's one of the things I don't like about CS programs, they're so behind so they teach these outdated methods and then it's part of everyone's religion... *think* people, think! :)
Jason Coco
Outdated? You should've seen the 20-pound resistors we used in my undergrad EE lab! At least Ohm's law hasn't changed. Yet.
Adam Liss
Oh, let's work on that... ;)
Jason Coco
I think it's better for users to get into the habit of NOT entering login information on a page that is not HTTPS. If I see HTTP and it asks me to login, I just hit login and see if it goes HTTPS, then I actually enter some informaton.
Bratch
your wrong. SSL Strip:http://www.thoughtcrime.org/software/sslstrip/index.html
Rook
@unknown: Thanks for the link. This appears to be a classic man-in-the-middle attack that depends on an initial http (not https) connection, which is insecure. The solution I suggested requires the user to browse to an address that begins with https: and is therefore both encrypted _and_ authenticated.
Adam Liss
+2  A: 

This post is the key one. Yes, if the user's data is sent to you, it will have arrived somewhere securely. But there is no reason to believe that somewhere will be your site. The attacker isn't just going to get to listen to the data moving in each direction at this point. He'll be the other end of the user's session. The your site is just going to think the user never bothered to submit the form.

Jay Kominek
A: 

No, it's not secure to go from HTTP to HTTPS. The originating and resulting points of the request must be HTTPS for the secure channel to be established and utilized.

Kon
The question was whether or not it is save to provide an initial form on HTTP, and post the data through HTTPS. It's not possible to switch half-way through a transfer, but is possible to have items placed on both.
Raymond Martineau
+1 This answer is absolutely correct. You can't even guarantee the form will be submitted via HTTPS if it was delivered via HTTP.
Marsh Ray
+5  A: 

This kind of thing is popping up all over the net, especially in sites for which login is optional. However, it's inherently unsafe, for quite subtle reasons, and gives the user a false sense of security. I think there was an article about this recently on codinghorror.com.

The danger is that while you sent your page with a post target of "https://xxx", the page in which that reference occurs is not secure, so it can be modified in transit by an attacker to point to any URL the attacker wishes. So if I visit your site, I must view the source to verify my credentials are being posted to a secure address, and that verification has relevance only for that particular submit. If I return tomorrow, I must view source again, since that particular delivery of the page may have been attacked and the post target subverted - if I don't verify every single time, by the time I know the post target was subverted, it's too late - I've already sent my credentials to the attacker's URL.

You should only provide a link to the login page; and the login page and everything thereafter should be HTTPS for as long as you are logged in. And, really, there is no reason not to; the burden of SSL is on the initial negotiation; the subsequent connections will use SSL session caching and the symmetric crypto used for the link data is actually extremely low overhead.

Software Monkey
+2  A: 

Jay and Kiwi are right about the MITM attack. However, its important to note that the attacker doesn't have to break the form and give some error message; the attacker can instead insert JavaScript to send the form data twice, once to him and once to you.

But, honestly, you have to ask, what's the chance of an attacker intercepting your login page and modifying it in flight? How's it compare to the risk of (a) doing a MITM attack strait on the SSL session, and hoping the user presses "OK" to continue; (b) doing the MITM on your initial redirect to SSL (e.g., from http://domain.com to https://domain.com) and redirecting to https://doma1n.com instead, which is under the attacker's control; (c) You having a XSS, XSRF, or SQL injection flaw somewhere on your site.

Yes, I'd suggest running the login form under SSL, there isn't any reason not to. But I wouldn't worry much if it weren't, there are probably much lower hanging fruit.

derobert
Yes, there is likely lower hanging fruit; but that mindset is why the web is so incredibly insecure... everyone's out there saying it's not that important... but what if some unsuspecting user uses the same password on your site and on their bank's website???
Software Monkey
"what's the chance of an attacker intercepting your login page and modifying it in flight?" It's not a question of probability, it happens or not at the choice of the attacker. And yes, MITM does happen in practice. "There are probably much lower hanging fruit" is just about the weakest argument one can make about anything. Really, can you think of a weaker one that not just plain false? Besides, even if your attacker can be counted on to pick the lowest fruit first, what is to say they stop there?
Marsh Ray
"Chance" is definitely a bad choice of words on my part. However, I don't think you're gaining much actual security, because of the other attack vectors. A MITM attack may compromise your users one user (or ISP) at a time, but a SQL injection may compromises all your uses at once. It makes sense, I argue, to spend your security time where you'll get the most bang for the buck, and that's probably not SSL vs. non-SSL login pages.
derobert
+2  A: 

For me (as an end-user), the value of an HTTPS session is not only that the data is encrypted, but that I have verification that the page I'm typing my super-secrets into has come from the place I want it to.

Having the form in a non-HTTPS session defeats that assurance.

(I know - this is just another way of saying that the form is subject to an MITM attack).

Michael Burr
A: 

I think the main consideration of this question has to do with the URL that users know and the protocol scheme (http:)that browsers substitute by default.

In that case, the normal behavior of a site that wants to ensure an encrypted channel is to have the http://home-page redirect to https://home-page. There is still a spoofing / MitM opportunity, but if it is by DNS poisoning, the risk is no higher than if one starts out with the https: URL. If a different domain name comes back, you need to worry then.

This is probably safe enough. After all, if you are subject to a targetted MitM, you might as well start worrying about keyboard loggers, your local HOSTS file, and all sorts of other ways of finding out about your secure transactions involving your system already being owned.

orcmid
"After all, if you are subject to a targetted MitM, you might as well start worrying about keyboard loggers, your local HOSTS file, and all sorts of other ways of finding out about your secure transactions involving your system already being owned". And how did your system get owned in the first place I wonder?
Marsh Ray
+2  A: 

IE Blog explains: Critical Mistake #1: Non-HTTPS Login pages (even if submitting to a HTTPS page)

  • How does the user know that the form is being submitted via HTTPS? Most browsers have no such UI cue.
  • How could the user know that it was going to the right HTTPS page? If the login form was delivered via HTTP, there's no guarantee it hasn't been changed between the server and the client.
porneL
And yet they don't practice it themselves.
John Mee
+1  A: 

I know this is an old post. I was just on the godaddy.com site (http://www.godaddy.com/). I was able to login from the non-secure main page. I would assume given the visibility of this site and the importance of the stored data that they would take every precaution to secure the data. But it seems this is not the case?

M Schenkel
How about http://login.live.com/ ?
Joe
"I was just on the godaddy.com site" Are you so sure about that?
Marsh Ray
Yes - on the main page: http://www.godaddy.com. They have the user name and password fields on that page. But it is not https.
M Schenkel
A: 

Everyone suggesting that you provide only a link to the login page seems to be forgetting that the link could easily be changed using a MITM attack.

RWS
But then, when the user follows the link to the (secure) login page, the SSL negotiation can alert them if any shenanigans are going on.
Mr. Shiny and New