Submitting a form to a secure url from a non-secure page

前端 未结 3 988
抹茶落季
抹茶落季 2021-01-21 22:27

Suppose I have a form on a page at this location...

http://mydomain.com/myform.htm

And the form looks like this...

3条回答
  •  我在风中等你
    2021-01-21 23:19

    The POST request will be transmitted over HTTPS (so encrypted if configured properly). Submitting a form from a page obtained over plain HTTP to an HTTPS page is bad practice. The initial page should also be served over HTTPS. The reason for this is that a MITM attacker could intercept the response that loads the page with the form and replace the link to point to another target.

    See the first rule here (of course, not specific to login pages):

    • https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Use_TLS_for_All_Login_Pages_and_All_Authenticated_Pages

    Rule - Use TLS for All Login Pages and All Authenticated Pages

    The login page and all subsequent authenticated pages must be exclusively accessed over TLS. The initial login page, referred to as the "login landing page", must be served over TLS. Failure to utilize TLS for the login landing page allows an attacker to modify the login form action, causing the user's credentials to be posted to an arbitrary location. Failure to utilize TLS for authenticated pages after the login enables an attacker to view the unencrypted session ID and compromise the user's authenticated session.

提交回复
热议问题